Author: scabanovich
Date: 2007-11-06 09:59:02 -0500 (Tue, 06 Nov 2007)
New Revision: 4740
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
Log:
JBIDE-1274
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2007-11-06
14:17:07 UTC (rev 4739)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2007-11-06
14:59:02 UTC (rev 4740)
@@ -10,16 +10,27 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.attribute.editor;
+import java.util.ArrayList;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.IValueChangeListener;
import org.jboss.tools.common.model.ui.IValueProvider;
import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
import
org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.action.Action;
@@ -253,4 +264,36 @@
}
return null;
}
+
+ //Overrides to show standard dialog
+// protected String changePressed() {
+// IJavaSearchScope scope = project != null ? getScope(project.getName()) : null;
+// FilteredTypesSelectionDialog d = new
FilteredTypesSelectionDialog(getChangeControl().getShell(), false, null, scope,
0/*IJavaSearchConstants.CLASS + IJavaSearchConstants.INTERFACE*/);
+// d.create();
+// int q = d.open();
+// Object result = d.getFirstResult();
+// if(result instanceof String) return result.toString();
+// return null;
+// }
+
+ private IJavaSearchScope getScope(String javaProjectName) {
+ IJavaElement[] elements = new IJavaElement[0];
+ if(javaProjectName != null) {
+ IPath path = new Path(javaProjectName);
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ IProject proj = res.getProject();
+ IJavaProject jproject = JavaCore.create(proj);
+ IPackageFragmentRoot fCurrRoot = jproject.getPackageFragmentRoot(res);
+ elements = new IJavaElement[] { fCurrRoot.getJavaProject() };
+ } else {
+ IProject[] ps = ModelPlugin.getWorkspace().getRoot().getProjects();
+ ArrayList<IJavaElement> l = new ArrayList<IJavaElement>();
+ for (int i = 0; i < ps.length; i++) {
+ if(EclipseResourceUtil.getJavaProject(ps[i]) != null) l.add(JavaCore.create(ps[i]));
+ }
+ elements = l.toArray(new IJavaElement[0]);
+ }
+ return SearchEngine.createJavaSearchScope(elements);
+ }
+
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2007-11-06
14:17:07 UTC (rev 4739)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2007-11-06
14:59:02 UTC (rev 4740)
@@ -243,6 +243,9 @@
TableItem item = (TableItem)element;
AttributeDescriptorValue attrDescr = (AttributeDescriptorValue)item.getData();
fWizardModel.setAttributeValue(attrDescr,value);
+ if(tableViewer != null) {
+ tableViewer.refresh();
+ }
}
}
);
Show replies by date