Author: scabanovich
Date: 2010-09-01 07:33:11 -0400 (Wed, 01 Sep 2010)
New Revision: 24594
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6085
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java 2010-09-01
09:52:39 UTC (rev 24593)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java 2010-09-01
11:33:11 UTC (rev 24594)
@@ -83,7 +83,7 @@
public Control[] getControls(Composite parent) {
Control label = null;
- if (makeGroup()) {
+ if (makeGroup() || hideLabel()) {
label = new Label(parent,SWT.NONE);
} else {
label = getLabelComposite(parent);
@@ -122,7 +122,9 @@
}
/// change!
int k = getTags().length;
- if(k != 3 || makeGroup) k = 1;
+ if(!isHorizontalLayout()) {
+ if(k != 3 || makeGroup) k = 1;
+ }
GridLayout layout = new GridLayout(k, false);
panel.setLayout(layout);
// panel.setFont(font);
@@ -156,6 +158,24 @@
return false;
}
+ boolean hideLabel() {
+ Object input = propertyEditor.getInput();
+ if(input instanceof DefaultValueAdapter) {
+ DefaultValueAdapter adapter = (DefaultValueAdapter)input;
+ return
"false".equals(adapter.getAttribute().getProperty("label"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return false;
+ }
+
+ boolean isHorizontalLayout() {
+ Object input = propertyEditor.getInput();
+ if(input instanceof DefaultValueAdapter) {
+ DefaultValueAdapter adapter = (DefaultValueAdapter)input;
+ return
"true".equals(adapter.getAttribute().getProperty("horizontal"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return false;
+ }
+
protected void valueChanged() {
setPresentsDefaultValue(false);
boolean oldState = isValid;