Author: jawi
Date: Tue Nov 5 16:43:53 2013
New Revision: 1539054
URL: http://svn.apache.org/r1539054
Log:
Minor usability improvements:
- do not expand all tree-nodes by default;
- highlight the parent of an associated/related child to denote
this even when the child itself is not visible.
Modified:
ace/trunk/org.apache.ace.webui.vaadin/resources/VAADIN/themes/reindeer/styles.css
ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/component/BaseObjectPanel.java
Modified:
ace/trunk/org.apache.ace.webui.vaadin/resources/VAADIN/themes/reindeer/styles.css
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/resources/VAADIN/themes/reindeer/styles.css?rev=1539054&r1=1539053&r2=1539054&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.webui.vaadin/resources/VAADIN/themes/reindeer/styles.css
(original)
+++
ace/trunk/org.apache.ace.webui.vaadin/resources/VAADIN/themes/reindeer/styles.css
Tue Nov 5 16:43:53 2013
@@ -6006,12 +6006,24 @@ textarea.v-textarea-readonly,
.v-table-row-odd.v-table-row-broken-association {
background: #a9b;
}
+.v-table-row-associated-parent {
+ background: #ace;
+}
+.v-table-row-odd.v-table-row-associated-parent {
+ background: #9bd;
+}
.v-table-row-related {
background: #9ab;
}
.v-table-row-odd.v-table-row-related {
background: #89a;
}
+.v-table-row-related-parent {
+ background: #bcd;
+}
+.v-table-row-odd.v-table-row-related-parent {
+ background: #abc;
+}
/* makes the description less prominent */
.v-table-cell-content-description {
color: #9ab;
Modified:
ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/component/BaseObjectPanel.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/component/BaseObjectPanel.java?rev=1539054&r1=1539053&r2=1539054&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/component/BaseObjectPanel.java
(original)
+++
ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/component/BaseObjectPanel.java
Tue Nov 5 16:43:53 2013
@@ -350,6 +350,8 @@ abstract class BaseObjectPanel<REPO_OBJ
Item item = getItem(itemId);
if (propertyId == null) {
+ updateItemIcon(itemId);
+
// no propertyId, styling row
if (m_associations.isAssociated(itemId)) {
return "associated";
@@ -358,11 +360,25 @@ abstract class BaseObjectPanel<REPO_OBJ
return "related";
}
- updateItemIcon(itemId);
- }
- else if (OBJECT_NAME.equals(propertyId)) {
- if (getParent(itemId) != null) {
- return "name-pad-left";
+ // Try to highlight the parent of any dynamic link...
+ Collection<?> children = getChildren(itemId);
+ if (children != null && !children.isEmpty()) {
+ Set<?> activeSelection = m_associations.getActiveSelection();
+ if (Collections.disjoint(children, activeSelection)) {
+ // Not in the active selection, check whether we've got an
associated or related child...
+ for (Object child : children) {
+ if (m_associations.isAssociated(child)) {
+ return "associated-parent";
+ }
+ if (m_associations.isRelated(child)) {
+ return "related-parent";
+ }
+ }
+ }
+ else {
+ // one of the children is selected...
+ return "associated-parent";
+ }
}
}
else if (OBJECT_DESCRIPTION.equals(propertyId)) {
@@ -465,7 +481,7 @@ abstract class BaseObjectPanel<REPO_OBJ
Association<LEFT_ASSOC_REPO_OBJ, REPO_OBJ> association =
doCreateLeftSideAssociation(String.valueOf(leftObjectId),
String.valueOf(rightObjectId));
if (association != null) {
m_leftTable.recalculateRelations(Direction.RIGHT);
-
+
// Request the focus again...
focus();
}
@@ -483,7 +499,7 @@ abstract class BaseObjectPanel<REPO_OBJ
Association<REPO_OBJ, RIGHT_ASSOC_REPO_OBJ> association =
doCreateRightSideAssociation(String.valueOf(leftObjectId),
String.valueOf(rightObjectId));
if (association != null) {
m_rightTable.recalculateRelations(Direction.LEFT);
-
+
// Request the focus again...
focus();
}
@@ -526,7 +542,7 @@ abstract class BaseObjectPanel<REPO_OBJ
m_associations.clear();
m_leftTable.recalculateRelations(Direction.RIGHT);
-
+
// Request the focus again...
focus();
}
@@ -545,7 +561,7 @@ abstract class BaseObjectPanel<REPO_OBJ
m_associations.clear();
m_rightTable.recalculateRelations(Direction.LEFT);
-
+
// Request the focus again...
focus();
}
@@ -575,12 +591,12 @@ abstract class BaseObjectPanel<REPO_OBJ
if (parentId != null) {
setParent(itemId, parentId);
- setCollapsed(parentId, false);
+ setCollapsed(parentId, true);
setItemIcon(object);
}
setChildrenAllowed(itemId, false);
-
+
// Request the focus again...
focus();
}
@@ -832,7 +848,7 @@ abstract class BaseObjectPanel<REPO_OBJ
item.getItemProperty(OBJECT_NAME).setValue(getParentDisplayName(object));
item.getItemProperty(OBJECT_DESCRIPTION).setValue("");
// XXX add unlink button when we can correctly determine dynamic
links...
-// item.getItemProperty(ACTION_UNLINK).setValue(new
RemoveLinkButton(object));
+ // item.getItemProperty(ACTION_UNLINK).setValue(new
RemoveLinkButton(object));
// we *must* set a non-null icon for the parent as well to ensure that
the tree-table open/collapse icon is
// rendered properly...
setItemIcon(parentId,
createIconResource("resource_workingstate_unchanged"));
@@ -870,7 +886,7 @@ abstract class BaseObjectPanel<REPO_OBJ
removeItem(parentID);
}
}
-
+
// Request the focus again...
focus();
}