JBoss Tools SVN: r29891 - in branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-03-17 18:14:22 -0400 (Thu, 17 Mar 2011)
New Revision: 29891
Modified:
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
Log:
JBIDE-8567
https://issues.jboss.org/browse/JBIDE-8567
Modified: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2011-03-17 22:09:02 UTC (rev 29890)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2011-03-17 22:14:22 UTC (rev 29891)
@@ -42,18 +42,25 @@
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.actions.ActionFactory;
import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.meta.action.XAttributeData;
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.meta.key.WizardKeys;
+import org.jboss.tools.common.model.XModelFactory;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.widgets.DefaultSettings;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
/**
* @author eskimo
*/
public class XAttributeSupport {
+ public static interface IAttributeDependency extends java.beans.PropertyChangeListener {
+ public void setSupport(XAttributeSupport support);
+ }
+
boolean isDebugging = ModelUIPlugin.getDefault().isDebugging();
private ArrayList<IModelPropertyEditorAdapter> adapters = new ArrayList<IModelPropertyEditorAdapter>();
@@ -114,6 +121,8 @@
alwaysGreedy.add(attribute[i].getName());
}
}
+
+ initDependencies(xmo.getModelEntity());
}
public void init(XModelObject xmo, XEntityData data, boolean useObject) {
@@ -145,7 +154,17 @@
}
}
+ initDependencies(data.getModelEntity());
}
+
+ void initDependencies(XModelEntity entity) {
+ String dependencies = entity.getProperty("formDependencies");
+ if(dependencies == null || dependencies.length() == 0) return;
+ IAttributeDependency d = (IAttributeDependency)ModelFeatureFactory.getInstance().createFeatureInstance(dependencies);
+ if(d == null) return;
+ d.setSupport(this);
+ addPropertyChangeListener(d);
+ }
public void dispose() {
if (editors!=null) {
@@ -398,7 +417,7 @@
}
public void save() {
- if(xmo == null) throw new IllegalArgumentException("" + //$NON-NLS-1$
+ if(xmo == null) throw new IllegalArgumentException("" + //$NON-NLS-1$
"Init support with XModelObject before saving"); //$NON-NLS-1$
if(xmo.getModel()==null) throw new IllegalArgumentException("Cannot store deleted or removed XModel object"); //$NON-NLS-1$
xmo.getModel().saveOptions();
Modified: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2011-03-17 22:09:02 UTC (rev 29890)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2011-03-17 22:14:22 UTC (rev 29891)
@@ -83,6 +83,8 @@
private ModifyListener modifyListener;
private DisposeListener disposeListener;
+ private SimpleContentProposalProvider cpp;
+
public ComboBoxFieldEditor() {
// setStyle(SWT.DROP_DOWN | SWT.BORDER);
}
@@ -253,14 +255,7 @@
}
String[] ts = getTags();
- Set<String> set = new TreeSet<String>();
- for (int i = 0; i < ts.length; i++) set.add(ts[i]);
- if(elements != null) for (int i = 0; i < elements.length; i++) {
- set.add(elements[i].toString());
- }
-
-
- SimpleContentProposalProvider cpp = new SimpleContentProposalProvider(set.toArray(new String[0]));
+ cpp = new SimpleContentProposalProvider(prepareProposals(ts, elements));
cpp.setFiltering(true);
KeyStroke ks = AttributeContentProposalProviderFactory.getCtrlSpaceKeyStroke();
@@ -280,6 +275,15 @@
return comboField;
}
+ private String[] prepareProposals(String[] tags, Object[] elements) {
+ Set<String> set = new TreeSet<String>();
+ for (int i = 0; i < tags.length; i++) set.add(tags[i]);
+ if(elements != null) for (int i = 0; i < elements.length; i++) {
+ set.add(elements[i].toString());
+ }
+ return set.toArray(new String[0]);
+ }
+
protected void valueChanged() {
/*added by Max Areshkau
*hack which was applied for fix JBIDE-1694
@@ -444,14 +448,17 @@
String v = comboField.getText();
valueProvider.removeValueChangeListener(this);
String[] tags = getTags();
+ cpp.setProposals(prepareProposals(tags, elements));
comboField.setItems(tags);
comboField.setText(v);
int i = comboField.getSelectionIndex();
valueProvider.addValueChangeListener(this);
- if(i < 0 && tags != null && tags.length > 0) {
- comboField.setText(tags[0]);
- } else if(i < 0) {
- comboField.setText(""); //$NON-NLS-1$
+ if((propertyEditor.getInput() instanceof DefaultValueAdapter) && !((DefaultValueAdapter)propertyEditor.getInput()).getAttribute().getConstraint().accepts("anyRandomValue")) {
+ if(i < 0 && tags != null && tags.length > 0) {
+ comboField.setText(tags[0]);
+ } else if(i < 0) {
+ comboField.setText(""); //$NON-NLS-1$
+ }
}
}
}
@@ -532,4 +539,15 @@
comboField.setFocus();
}
}
+
+ public void setFocusAndKeepSelection() {
+ if (comboField != null) {
+ Point p = comboField.getSelection();
+ comboField.getParent().setFocus();
+ comboField.setFocus();
+ if(p != null) {
+ comboField.setSelection(p);
+ }
+ }
+ }
}
13 years, 10 months
JBoss Tools SVN: r29890 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-03-17 18:09:02 -0400 (Thu, 17 Mar 2011)
New Revision: 29890
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
Log:
JBIDE-8567
https://issues.jboss.org/browse/JBIDE-8567
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2011-03-17 21:53:33 UTC (rev 29889)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2011-03-17 22:09:02 UTC (rev 29890)
@@ -42,18 +42,25 @@
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.actions.ActionFactory;
import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.meta.action.XAttributeData;
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.meta.key.WizardKeys;
+import org.jboss.tools.common.model.XModelFactory;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.widgets.DefaultSettings;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
/**
* @author eskimo
*/
public class XAttributeSupport {
+ public static interface IAttributeDependency extends java.beans.PropertyChangeListener {
+ public void setSupport(XAttributeSupport support);
+ }
+
boolean isDebugging = ModelUIPlugin.getDefault().isDebugging();
private ArrayList<IModelPropertyEditorAdapter> adapters = new ArrayList<IModelPropertyEditorAdapter>();
@@ -114,6 +121,8 @@
alwaysGreedy.add(attribute[i].getName());
}
}
+
+ initDependencies(xmo.getModelEntity());
}
public void init(XModelObject xmo, XEntityData data, boolean useObject) {
@@ -145,7 +154,17 @@
}
}
+ initDependencies(data.getModelEntity());
}
+
+ void initDependencies(XModelEntity entity) {
+ String dependencies = entity.getProperty("formDependencies");
+ if(dependencies == null || dependencies.length() == 0) return;
+ IAttributeDependency d = (IAttributeDependency)ModelFeatureFactory.getInstance().createFeatureInstance(dependencies);
+ if(d == null) return;
+ d.setSupport(this);
+ addPropertyChangeListener(d);
+ }
public void dispose() {
if (editors!=null) {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2011-03-17 21:53:33 UTC (rev 29889)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2011-03-17 22:09:02 UTC (rev 29890)
@@ -83,6 +83,8 @@
private ModifyListener modifyListener;
private DisposeListener disposeListener;
+ private SimpleContentProposalProvider cpp;
+
public ComboBoxFieldEditor() {
// setStyle(SWT.DROP_DOWN | SWT.BORDER);
}
@@ -253,14 +255,7 @@
}
String[] ts = getTags();
- Set<String> set = new TreeSet<String>();
- for (int i = 0; i < ts.length; i++) set.add(ts[i]);
- if(elements != null) for (int i = 0; i < elements.length; i++) {
- set.add(elements[i].toString());
- }
-
-
- SimpleContentProposalProvider cpp = new SimpleContentProposalProvider(set.toArray(new String[0]));
+ cpp = new SimpleContentProposalProvider(prepareProposals(ts, elements));
cpp.setFiltering(true);
KeyStroke ks = AttributeContentProposalProviderFactory.getCtrlSpaceKeyStroke();
@@ -280,6 +275,15 @@
return comboField;
}
+ private String[] prepareProposals(String[] tags, Object[] elements) {
+ Set<String> set = new TreeSet<String>();
+ for (int i = 0; i < tags.length; i++) set.add(tags[i]);
+ if(elements != null) for (int i = 0; i < elements.length; i++) {
+ set.add(elements[i].toString());
+ }
+ return set.toArray(new String[0]);
+ }
+
protected void valueChanged() {
/*added by Max Areshkau
*hack which was applied for fix JBIDE-1694
@@ -444,14 +448,17 @@
String v = comboField.getText();
valueProvider.removeValueChangeListener(this);
String[] tags = getTags();
+ cpp.setProposals(prepareProposals(tags, elements));
comboField.setItems(tags);
comboField.setText(v);
int i = comboField.getSelectionIndex();
valueProvider.addValueChangeListener(this);
- if(i < 0 && tags != null && tags.length > 0) {
- comboField.setText(tags[0]);
- } else if(i < 0) {
- comboField.setText(""); //$NON-NLS-1$
+ if((propertyEditor.getInput() instanceof DefaultValueAdapter) && !((DefaultValueAdapter)propertyEditor.getInput()).getAttribute().getConstraint().accepts("anyRandomValue")) {
+ if(i < 0 && tags != null && tags.length > 0) {
+ comboField.setText(tags[0]);
+ } else if(i < 0) {
+ comboField.setText(""); //$NON-NLS-1$
+ }
}
}
}
@@ -532,4 +539,15 @@
comboField.setFocus();
}
}
+
+ public void setFocusAndKeepSelection() {
+ if (comboField != null) {
+ Point p = comboField.getSelection();
+ comboField.getParent().setFocus();
+ comboField.setFocus();
+ if(p != null) {
+ comboField.setSelection(p);
+ }
+ }
+ }
}
13 years, 10 months
JBoss Tools SVN: r29889 - trunk/workingset/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:53:33 -0400 (Thu, 17 Mar 2011)
New Revision: 29889
Modified:
trunk/workingset/docs/reference/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/workingset/docs/reference/en-US/master.xml
===================================================================
--- trunk/workingset/docs/reference/en-US/master.xml 2011-03-17 21:52:40 UTC (rev 29888)
+++ trunk/workingset/docs/reference/en-US/master.xml 2011-03-17 21:53:33 UTC (rev 29889)
@@ -48,12 +48,12 @@
<releaseinfo>
Version: 2.1.0.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/workingset/pdf/Worki...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29888 - trunk/struts/docs/struts_tools_tutorial/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:52:40 -0400 (Thu, 17 Mar 2011)
New Revision: 29888
Modified:
trunk/struts/docs/struts_tools_tutorial/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/struts/docs/struts_tools_tutorial/en-US/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en-US/master.xml 2011-03-17 21:51:50 UTC (rev 29887)
+++ trunk/struts/docs/struts_tools_tutorial/en-US/master.xml 2011-03-17 21:52:40 UTC (rev 29888)
@@ -53,12 +53,12 @@
Version: 3.1.1.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/struts_tools_tutoria...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29887 - trunk/struts/docs/struts_tools_ref_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:51:50 -0400 (Thu, 17 Mar 2011)
New Revision: 29887
Modified:
trunk/struts/docs/struts_tools_ref_guide/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/struts/docs/struts_tools_ref_guide/en-US/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en-US/master.xml 2011-03-17 21:49:45 UTC (rev 29886)
+++ trunk/struts/docs/struts_tools_ref_guide/en-US/master.xml 2011-03-17 21:51:50 UTC (rev 29887)
@@ -56,12 +56,12 @@
Version: 3.1.1.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/struts_tools_ref_gui...">PDF version</ulink>
</para>
-</abstract>
+</abstract> -->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29886 - trunk/smooks/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:49:45 -0400 (Thu, 17 Mar 2011)
New Revision: 29886
Modified:
trunk/smooks/docs/reference/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/smooks/docs/reference/en-US/master.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/master.xml 2011-03-17 21:47:50 UTC (rev 29885)
+++ trunk/smooks/docs/reference/en-US/master.xml 2011-03-17 21:49:45 UTC (rev 29886)
@@ -35,13 +35,13 @@
Version: 1.1.1.GA
</releaseinfo>
- <abstract>
+<!-- <abstract>
<title/>
<para>
<ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/smooks/pdf/Smooks_Re...">PDF version</ulink>
</para>
- </abstract>
+ </abstract> -->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29885 - trunk/seam/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:47:50 -0400 (Thu, 17 Mar 2011)
New Revision: 29885
Modified:
trunk/seam/docs/reference/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/seam/docs/reference/en-US/master.xml
===================================================================
--- trunk/seam/docs/reference/en-US/master.xml 2011-03-17 21:45:02 UTC (rev 29884)
+++ trunk/seam/docs/reference/en-US/master.xml 2011-03-17 21:47:50 UTC (rev 29885)
@@ -66,12 +66,12 @@
Version: 3.1.1.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/pdf/Seam_Refere...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29884 - trunk/jsf/docs/userguide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:45:02 -0400 (Thu, 17 Mar 2011)
New Revision: 29884
Modified:
trunk/jsf/docs/userguide/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/jsf/docs/userguide/en-US/master.xml
===================================================================
--- trunk/jsf/docs/userguide/en-US/master.xml 2011-03-17 21:43:34 UTC (rev 29883)
+++ trunk/jsf/docs/userguide/en-US/master.xml 2011-03-17 21:45:02 UTC (rev 29884)
@@ -34,21 +34,21 @@
<title>Visual Web Tools Reference Guide</title>
<copyright>
- <year>2007</year>
+ <year>2007</year>
<year>2008</year>
- <year>2009</year>
+ <year>2009</year>
<year>2010</year>
<holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 3.0.1.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jsf/pdf/Visual_Web_T...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29883 - trunk/jsf/docs/jsf_tools_tutorial/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:43:34 -0400 (Thu, 17 Mar 2011)
New Revision: 29883
Modified:
trunk/jsf/docs/jsf_tools_tutorial/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/jsf/docs/jsf_tools_tutorial/en-US/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en-US/master.xml 2011-03-17 21:41:51 UTC (rev 29882)
+++ trunk/jsf/docs/jsf_tools_tutorial/en-US/master.xml 2011-03-17 21:43:34 UTC (rev 29883)
@@ -56,12 +56,12 @@
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jsf_tools_tutorial/p...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months
JBoss Tools SVN: r29882 - trunk/jsf/docs/jsf_tools_ref_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-03-17 17:41:51 -0400 (Thu, 17 Mar 2011)
New Revision: 29882
Modified:
trunk/jsf/docs/jsf_tools_ref_guide/en-US/master.xml
Log:
Removed PDF link from book
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en-US/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en-US/master.xml 2011-03-17 21:37:18 UTC (rev 29881)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en-US/master.xml 2011-03-17 21:41:51 UTC (rev 29882)
@@ -56,12 +56,12 @@
Version: 3.1.1.GA
</releaseinfo>
-<abstract>
+<!--<abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jsf_tools_ref_guide/...">PDF version</ulink>
</para>
-</abstract>
+</abstract>-->
</bookinfo>
13 years, 10 months