Author: jm
Date: 2012-08-28 11:01:57 -0700 (Tue, 28 Aug 2012)
New Revision: 30283
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
Log:
Fixes #1392: Filtered out SUID columns from AttributeComboBoxPropertyEditor
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
===================================================================
---
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
2012-08-28 17:53:21 UTC (rev 30282)
+++
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
2012-08-28 18:01:57 UTC (rev 30283)
@@ -5,7 +5,9 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -85,8 +87,9 @@
for (CyNetwork net : networks) {
final AttributeSet currentSet =
this.attrManager.getAttributeSet(net, graphObjectType);
- for (String attrName : currentSet.getAttrMap().keySet())
- sortedName.add(attrName);
+ for (Entry<String, Class<?>> entry:
currentSet.getAttrMap().entrySet())
+ if (columnIsAllowed(entry.getKey(),
entry.getValue()))
+ sortedName.add(entry.getKey());
}
for (final String attrName : sortedName)
@@ -99,6 +102,13 @@
+ targetSet.getAttrMap().keySet());
}
+ private boolean columnIsAllowed(String name, Class<?> type) {
+ if (!Long.class.equals(type) && !List.class.equals(type)) {
+ return true;
+ }
+ return !CyIdentifiable.SUID.equals(name) &&
!name.endsWith(".SUID");
+ }
+
private final class AttributeComboBoxCellRenderer extends
BasicComboBoxRenderer {
private static final long serialVersionUID =
6828337202195089669L;
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.