JBoss Tools SVN: r25831 - workspace/snjeza/seam-examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-10-14 11:10:58 -0400 (Thu, 14 Oct 2010)
New Revision: 25831
Modified:
workspace/snjeza/seam-examples/dvdstore22.zip
Log:
JBDS-1366 DVDStore22 Example Bound to Specific JRE and could not be deployed to bundled EAP
Modified: workspace/snjeza/seam-examples/dvdstore22.zip
===================================================================
(Binary files differ)
14 years, 3 months
JBoss Tools SVN: r25830 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 10:56:59 -0400 (Thu, 14 Oct 2010)
New Revision: 25830
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14 13:04:44 UTC (rev 25829)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14 14:56:59 UTC (rev 25830)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.refactoring;
+import java.io.InputStream;
import java.util.List;
import java.util.StringTokenizer;
@@ -192,18 +193,35 @@
}
protected void searchInCach(IFile file){
+ if(file == null) return;
+ ELResolver[] resolvers = ELResolverFactoryManager.getInstance().getResolvers(file);
+ IRelevanceCheck[] checks = getRelevanceChecks(resolvers);
+ String text = null;
+ try {
+ InputStream is = file.getContents();
+ if(is != null) text = FileUtil.readStream(is);
+ } catch (CoreException e) {
+ //ignore
+ }
+ if(text != null) {
+ boolean found = false;
+ for (IRelevanceCheck check: checks) {
+ if(check.isRelevant(text)) {
+ found = true;
+ break;
+ }
+ }
+ if(!found) return;
+ }
+
ELContext context = PageContextFactory.createPageContext(file);
if(context == null)
return;
ELReference[] references = context.getELReferences();
- ELResolver[] resolvers = context.getElResolvers();
-
- IRelevanceCheck[] checks = new IRelevanceCheck[resolvers.length];
- for (int i = 0; i < checks.length; i++) {
- checks[i] = resolvers[i].createRelevanceCheck(javaElement);
- }
+ resolvers = context.getElResolvers();
+ checks = getRelevanceChecks(resolvers);
if(javaElement != null){
for(ELReference reference : references){
@@ -248,6 +266,15 @@
}
}
+
+ private IRelevanceCheck[] getRelevanceChecks(ELResolver[] resolvers) {
+ if(resolvers == null) return new IRelevanceCheck[0];
+ IRelevanceCheck[] checks = new IRelevanceCheck[resolvers.length];
+ for (int i = 0; i < checks.length; i++) {
+ checks[i] = resolvers[i].createRelevanceCheck(javaElement);
+ }
+ return checks;
+ }
// looking for component references in EL
14 years, 3 months
JBoss Tools SVN: r25829 - in trunk/common/tests/org.jboss.tools.common.el.core.test: projects/JavaProject and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 09:04:44 -0400 (Thu, 14 Oct 2010)
New Revision: 25829
Added:
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.classpath
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.project
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/org.eclipse.jdt.core.prefs
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/bin/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/bin/test/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/bin/test/Bean.class
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/Bean.java
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/RelevanceCheckTest.java
Modified:
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.classpath (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.classpath 2010-10-14 13:04:44 UTC (rev 25829)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.project (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.project 2010-10-14 13:04:44 UTC (rev 25829)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JavaProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/org.eclipse.jdt.core.prefs 2010-10-14 13:04:44 UTC (rev 25829)
@@ -0,0 +1,12 @@
+#Thu Oct 14 16:33:59 MSD 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/bin/test/Bean.class
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/bin/test/Bean.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/Bean.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/Bean.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/Bean.java 2010-10-14 13:04:44 UTC (rev 25829)
@@ -0,0 +1,18 @@
+package test;
+
+public class Bean {
+ protected int myField = 0;
+
+ public int getProp1() {
+ return 0;
+ }
+
+ public boolean isProp2() {
+ return false;
+ }
+
+ public void setProp3(String s) {
+
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/JavaProject/src/test/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java 2010-10-14 12:57:51 UTC (rev 25828)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java 2010-10-14 13:04:44 UTC (rev 25829)
@@ -26,6 +26,7 @@
suite.setName("All tests for " + PLUGIN_ID);
suite.addTestSuite(ELParserTest.class);
suite.addTestSuite(ELModelTest.class);
+ suite.addTestSuite(RelevanceCheckTest.class);
return suite;
}
}
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/RelevanceCheckTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/RelevanceCheckTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/RelevanceCheckTest.java 2010-10-14 13:04:44 UTC (rev 25829)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.common.el.core.ca.DefaultJavaRelevanceCheck;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+import junit.framework.TestCase;
+
+public class RelevanceCheckTest extends TestCase {
+ public static final String TEST_PROJECT_NAME = "JavaProject";
+
+ public static final String TEST_PROJECT_PATH = "/projects/" + TEST_PROJECT_NAME;
+
+ TestProjectProvider prjProvider = null;
+ IProject project = null;
+
+ protected void setUp() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ project = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(TEST_PROJECT_NAME);
+ if(project==null) {
+ prjProvider = new TestProjectProvider("org.jboss.tools.common.el.core.test", TEST_PROJECT_PATH, TEST_PROJECT_NAME, true);
+ project = prjProvider.getProject();
+ }
+
+ project.build(IncrementalProjectBuilder.FULL_BUILD, null);
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+
+ public void testRelevanceCheck() throws CoreException {
+ IJavaProject jp = JavaCore.create(project);
+ IType bean = jp.findType("test.Bean");
+
+ IField f = bean.getField("myField");
+ assertTrue("Field myField is not found", f != null && f.exists());
+ DefaultJavaRelevanceCheck check = new DefaultJavaRelevanceCheck(f);
+
+ assertTrue("'myField' should be relevant", check.isRelevant("myField"));
+ assertTrue("'myField2' should be relevant", check.isRelevant("myField2"));
+ assertFalse("'myFiel' should not be relevant", check.isRelevant("myFiel"));
+
+ IMethod m = bean.getMethod("getProp1", new String[0]);
+ assertTrue("Method getProp1 is not found", m != null && m.exists());
+ check = new DefaultJavaRelevanceCheck(m);
+
+ assertTrue("'prop1' should be relevant", check.isRelevant("prop1"));
+ assertTrue("'getProp1' should be relevant", check.isRelevant("getProp1"));
+ assertFalse("'getProp2' should not be relevant", check.isRelevant("getProp2"));
+
+ m = bean.getMethod("isProp2", new String[0]);
+ assertTrue("Method isProp2 is not found", m != null && m.exists());
+ check = new DefaultJavaRelevanceCheck(m);
+
+ assertTrue("'prop1' should be relevant", check.isRelevant("prop2"));
+ assertTrue("'isProp2' should be relevant", check.isRelevant("isProp2"));
+ assertFalse("'getProp3' should not be relevant", check.isRelevant("isProp3"));
+
+ m = bean.getMethod("setProp3", new String[]{"QString;"});
+ assertTrue("Method setProp3 is not found", m != null && m.exists());
+ check = new DefaultJavaRelevanceCheck(m);
+
+ assertTrue("'prop1' should be relevant", check.isRelevant("prop3"));
+ assertTrue("'setProp3' should be relevant", check.isRelevant("setProp3"));
+ assertFalse("'setProp4' should not be relevant", check.isRelevant("setProp4"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if(prjProvider!=null) {
+ prjProvider.dispose();
+ }
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/RelevanceCheckTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 3 months
JBoss Tools SVN: r25828 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-14 08:57:51 -0400 (Thu, 14 Oct 2010)
New Revision: 25828
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7329] added commands to the view menu
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-14 12:24:18 UTC (rev 25827)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-14 12:57:51 UTC (rev 25828)
@@ -102,7 +102,7 @@
name="%Preferences.name">
</page>
</extension>
- <!-- connection command handlers -->
+ <!-- connection command handlers -->
<extension
point="org.eclipse.ui.handlers">
<handler
@@ -137,7 +137,7 @@
</with>
</activeWhen>
</handler>
- <!-- instance command handlers -->
+ <!-- instance command handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.StartInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.startinstance">
@@ -212,9 +212,11 @@
</extension>
<extension
point="org.eclipse.ui.menus">
+ <!-- DeltaCloudView context menu -->
<menuContribution
- allPopups="false"
- locationURI="popup:org.jboss.tools.deltacloud.menus.cloudviewer">
+ allPopups="true"
+ locationURI="popup:org.jboss.tools.deltacloud.ui.views.DeltaCloudView">
+ <!-- connection commands -->
<command
commandId="org.eclipse.ui.edit.delete"
label="Disconnect Cloud"
@@ -312,9 +314,9 @@
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.destroyinstance"
- hoverIcon="Destroy"
label="Destroy"
- style="push">
+ style="push"
+ tooltip="Destroy">
<visibleWhen
checkEnabled="true">
<with
@@ -328,8 +330,126 @@
</visibleWhen>
</command>
</menuContribution>
- </extension>
- <extension
+ <!-- DeltaCloudView local menu -->
+ <menuContribution
+ allPopups="true"
+ locationURI="menu:org.jboss.tools.deltacloud.ui.views.DeltaCloudView">
+ <!-- connection commands -->
+ <command
+ commandId="org.eclipse.ui.edit.delete"
+ label="Disconnect Cloud"
+ style="push"
+ tooltip="Disconnect Cloud">
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.newconnection"
+ label="New Connection"
+ style="push"
+ tooltip="New Connection">
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.editconnection"
+ label="Edit Connection"
+ style="push"
+ tooltip="Edit Conncetion">
+ </command>
+ <!-- image commands -->
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.createinstance"
+ icon="icons/instance.gif"
+ label="Launch Instance"
+ style="push"
+ tooltip="Launch Instance">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.CVImageElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <!-- instance commands -->
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.startinstance"
+ disabledIcon="icons/runningd.gif"
+ icon="icons/running.gif"
+ label="Start"
+ style="push"
+ tooltip="Start">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.CVInstanceElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.stopinstance"
+ disabledIcon="icons/stoppedd.gif"
+ icon="icons/stopped.gif"
+ label="Stop"
+ style="push"
+ tooltip="Stop">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.CVInstanceElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.rebootinstance"
+ disabledIcon="icons/rebootd.gif"
+ icon="icons/reboot.gif"
+ label="Reboot"
+ style="push"
+ tooltip="Reboot">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.CVInstanceElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.destroyinstance"
+ label="Destroy"
+ style="push"
+ tooltip="Destroy">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.CVInstanceElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
point="org.eclipse.ui.commands">
<command
description="Creates a new cloud connection"
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-14 12:24:18 UTC (rev 25827)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-14 12:57:51 UTC (rev 25828)
@@ -10,15 +10,9 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
@@ -40,32 +34,30 @@
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudImage;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.core.ICloudManagerListener;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
-import org.jboss.tools.internal.deltacloud.ui.wizards.NewInstance;
public class DeltaCloudView extends ViewPart implements ICloudManagerListener,
ITabbedPropertySheetPageContributor {
- private static final String CONTEXT_MENU_ID = "popup:org.jboss.tools.deltacloud.menus.cloudviewer";
-
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "org.jboss.tools.deltacloud.ui.views.DeltaCloudView";
+ private static final String CONTEXT_MENU_ID = "popup:" + ID;
+ private static final String VIEW_MENU_ID = "menu:" + ID;
+
private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
private static final String CREATE_INSTANCE = "CreateInstance.label"; //$NON-NLS-1$
-// private final static String START_LABEL = "Start.label"; //$NON-NLS-1$
-// private final static String STOP_LABEL = "Stop.label"; //$NON-NLS-1$
-// private final static String REBOOT_LABEL = "Reboot.label"; //$NON-NLS-1$
-// private final static String DESTROY_LABEL = "Destroy.label"; //$NON-NLS-1$
+ // private final static String START_LABEL = "Start.label"; //$NON-NLS-1$
+ // private final static String STOP_LABEL = "Stop.label"; //$NON-NLS-1$
+ // private final static String REBOOT_LABEL = "Reboot.label"; //$NON-NLS-1$
+ // private final static String DESTROY_LABEL = "Destroy.label"; //$NON-NLS-1$
private final static String IMAGE_FILTER = "ImageFilter.label"; //$NON-NLS-1$
private final static String INSTANCE_FILTER = "InstanceFilter.label"; //$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
@@ -131,15 +123,19 @@
}
private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- IMenuManager menuMgr = bars.getMenuManager();
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- DeltaCloudView.this.fillLocalPullDown(manager);
- }
- });
- fillLocalPullDown(menuMgr);
- fillLocalToolBar(bars.getToolBarManager());
+ // IActionBars bars = getViewSite().getActionBars();
+ // IMenuManager menuMgr = bars.getMenuManager();
+ IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+ IActionBars actionBars = getViewSite().getActionBars();
+ IMenuManager menuManager = actionBars.getMenuManager();
+ UIUtils.registerContributionManager(VIEW_MENU_ID, menuManager, viewer.getControl());
+ // menuMgr.addMenuListener(new IMenuListener() {
+ // public void menuAboutToShow(IMenuManager manager) {
+ // DeltaCloudView.this.fillLocalPullDown(manager);
+ // }
+ // });
+ // fillLocalPullDown(menuMgr);
+ // fillLocalToolBar(bars.getToolBarManager());
}
private void handleSelection() {
@@ -170,10 +166,10 @@
private void makeActions() {
refreshAction = createRefreshAction();
-// startAction = createStartAction();
-// stopAction = createStopAction();
-// rebootAction = createRebootAction();
-// destroyAction = createDestroyAction();
+ // startAction = createStartAction();
+ // stopAction = createStopAction();
+ // rebootAction = createRebootAction();
+ // destroyAction = createDestroyAction();
imageFilterAction = createImageFilterAction();
instanceFilterAction = createInstanceFilterAction();
@@ -267,127 +263,141 @@
return imageFilterAction;
}
-// private Action createDestroyAction() {
-// Action destroyAction = new Action() {
-// public void run() {
-// ISelection selection = viewer.getSelection();
-// Object obj = ((IStructuredSelection) selection).getFirstElement();
-// if (obj instanceof CVInstanceElement) {
-// CVInstanceElement cvinstance = (CVInstanceElement) obj;
-// DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
-// CloudViewElement element = (CloudViewElement) obj;
-// while (!(element instanceof CVCloudElement))
-// element = (CloudViewElement) element.getParent();
-// CVCloudElement cvcloud = (CVCloudElement) element;
-// DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
-// PerformDestroyInstanceActionThread t = new PerformDestroyInstanceActionThread(cloud, instance,
-// CVMessages.getString(DESTROYING_INSTANCE_TITLE),
-// CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[] { instance.getName() }));
-// t.setUser(true);
-// t.schedule();
-// }
-// }
-// };
-// destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
-// destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
-// ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
-// ImageDescriptor delete = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
-// ImageDescriptor delete_disabled = ImageDescriptor.createFromImage(sharedImages
-// .getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
-// destroyAction.setImageDescriptor(delete);
-// destroyAction.setDisabledImageDescriptor(delete_disabled);
-// return destroyAction;
-// }
+ // private Action createDestroyAction() {
+ // Action destroyAction = new Action() {
+ // public void run() {
+ // ISelection selection = viewer.getSelection();
+ // Object obj = ((IStructuredSelection) selection).getFirstElement();
+ // if (obj instanceof CVInstanceElement) {
+ // CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ // DeltaCloudInstance instance = (DeltaCloudInstance)
+ // cvinstance.getElement();
+ // CloudViewElement element = (CloudViewElement) obj;
+ // while (!(element instanceof CVCloudElement))
+ // element = (CloudViewElement) element.getParent();
+ // CVCloudElement cvcloud = (CVCloudElement) element;
+ // DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ // PerformDestroyInstanceActionThread t = new
+ // PerformDestroyInstanceActionThread(cloud, instance,
+ // CVMessages.getString(DESTROYING_INSTANCE_TITLE),
+ // CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[] {
+ // instance.getName() }));
+ // t.setUser(true);
+ // t.schedule();
+ // }
+ // }
+ // };
+ // destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
+ // destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
+ // ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ // ImageDescriptor delete =
+ // ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
+ // ImageDescriptor delete_disabled =
+ // ImageDescriptor.createFromImage(sharedImages
+ // .getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
+ // destroyAction.setImageDescriptor(delete);
+ // destroyAction.setDisabledImageDescriptor(delete_disabled);
+ // return destroyAction;
+ // }
-// private Action createRebootAction() {
-// Action rebootAction = new Action() {
-// public void run() {
-// ISelection selection = viewer.getSelection();
-// Object obj = ((IStructuredSelection) selection).getFirstElement();
-// if (obj instanceof CVInstanceElement) {
-// CVInstanceElement cvinstance = (CVInstanceElement) obj;
-// DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
-// CloudViewElement element = (CloudViewElement) obj;
-// while (!(element instanceof CVCloudElement))
-// element = (CloudViewElement) element.getParent();
-// CVCloudElement cvcloud = (CVCloudElement) element;
-// DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
-// PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
-// DeltaCloudInstance.REBOOT,
-// CVMessages.getString(REBOOTING_INSTANCE_TITLE),
-// CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[] { instance.getName() }),
-// DeltaCloudInstance.RUNNING);
-// t.setUser(true);
-// t.schedule();
-// }
-// }
-// };
-// rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
-// rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
-// rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
-// rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
-// return rebootAction;
-// }
+ // private Action createRebootAction() {
+ // Action rebootAction = new Action() {
+ // public void run() {
+ // ISelection selection = viewer.getSelection();
+ // Object obj = ((IStructuredSelection) selection).getFirstElement();
+ // if (obj instanceof CVInstanceElement) {
+ // CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ // DeltaCloudInstance instance = (DeltaCloudInstance)
+ // cvinstance.getElement();
+ // CloudViewElement element = (CloudViewElement) obj;
+ // while (!(element instanceof CVCloudElement))
+ // element = (CloudViewElement) element.getParent();
+ // CVCloudElement cvcloud = (CVCloudElement) element;
+ // DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ // PerformInstanceActionThread t = new PerformInstanceActionThread(cloud,
+ // instance,
+ // DeltaCloudInstance.REBOOT,
+ // CVMessages.getString(REBOOTING_INSTANCE_TITLE),
+ // CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[] {
+ // instance.getName() }),
+ // DeltaCloudInstance.RUNNING);
+ // t.setUser(true);
+ // t.schedule();
+ // }
+ // }
+ // };
+ // rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
+ // rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
+ // rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
+ // rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
+ // return rebootAction;
+ // }
-// private Action createStopAction() {
-// Action stopAction = new Action() {
-// public void run() {
-// ISelection selection = viewer.getSelection();
-// Object obj = ((IStructuredSelection) selection).getFirstElement();
-// if (obj instanceof CVInstanceElement) {
-// CVInstanceElement cvinstance = (CVInstanceElement) obj;
-// DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
-// CloudViewElement element = (CloudViewElement) obj;
-// while (!(element instanceof CVCloudElement))
-// element = (CloudViewElement) element.getParent();
-// CVCloudElement cvcloud = (CVCloudElement) element;
-// DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
-// PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
-// DeltaCloudInstance.STOP,
-// CVMessages.getString(STOPPING_INSTANCE_TITLE),
-// CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[] { instance.getName() }),
-// DeltaCloudInstance.STOPPED);
-// t.setUser(true);
-// t.schedule();
-// }
-// }
-// };
-// stopAction.setText(CVMessages.getString(STOP_LABEL));
-// stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
-// stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
-// stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
-// return stopAction;
-// }
+ // private Action createStopAction() {
+ // Action stopAction = new Action() {
+ // public void run() {
+ // ISelection selection = viewer.getSelection();
+ // Object obj = ((IStructuredSelection) selection).getFirstElement();
+ // if (obj instanceof CVInstanceElement) {
+ // CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ // DeltaCloudInstance instance = (DeltaCloudInstance)
+ // cvinstance.getElement();
+ // CloudViewElement element = (CloudViewElement) obj;
+ // while (!(element instanceof CVCloudElement))
+ // element = (CloudViewElement) element.getParent();
+ // CVCloudElement cvcloud = (CVCloudElement) element;
+ // DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ // PerformInstanceActionThread t = new PerformInstanceActionThread(cloud,
+ // instance,
+ // DeltaCloudInstance.STOP,
+ // CVMessages.getString(STOPPING_INSTANCE_TITLE),
+ // CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[] {
+ // instance.getName() }),
+ // DeltaCloudInstance.STOPPED);
+ // t.setUser(true);
+ // t.schedule();
+ // }
+ // }
+ // };
+ // stopAction.setText(CVMessages.getString(STOP_LABEL));
+ // stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
+ // stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
+ // stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
+ // return stopAction;
+ // }
-// private Action createStartAction() {
-// Action startAction = new Action() {
-// public void run() {
-// ISelection selection = viewer.getSelection();
-// Object obj = ((IStructuredSelection) selection).getFirstElement();
-// if (obj instanceof CVInstanceElement) {
-// CVInstanceElement cvinstance = (CVInstanceElement) obj;
-// DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
-// CloudViewElement element = (CloudViewElement) obj;
-// while (!(element instanceof CVCloudElement))
-// element = (CloudViewElement) element.getParent();
-// CVCloudElement cvcloud = (CVCloudElement) element;
-// DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
-// PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
-// DeltaCloudInstance.START,
-// CVMessages.getString(STARTING_INSTANCE_TITLE),
-// CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] { instance.getName() }),
-// DeltaCloudInstance.RUNNING);
-// t.setUser(true);
-// t.schedule();
-// }
-// }
-// };
-// startAction.setText(CVMessages.getString(START_LABEL));
-// startAction.setToolTipText(CVMessages.getString(START_LABEL));
-// startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
-// startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
-// return startAction;
-// }
+ // private Action createStartAction() {
+ // Action startAction = new Action() {
+ // public void run() {
+ // ISelection selection = viewer.getSelection();
+ // Object obj = ((IStructuredSelection) selection).getFirstElement();
+ // if (obj instanceof CVInstanceElement) {
+ // CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ // DeltaCloudInstance instance = (DeltaCloudInstance)
+ // cvinstance.getElement();
+ // CloudViewElement element = (CloudViewElement) obj;
+ // while (!(element instanceof CVCloudElement))
+ // element = (CloudViewElement) element.getParent();
+ // CVCloudElement cvcloud = (CVCloudElement) element;
+ // DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ // PerformInstanceActionThread t = new PerformInstanceActionThread(cloud,
+ // instance,
+ // DeltaCloudInstance.START,
+ // CVMessages.getString(STARTING_INSTANCE_TITLE),
+ // CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] {
+ // instance.getName() }),
+ // DeltaCloudInstance.RUNNING);
+ // t.setUser(true);
+ // t.schedule();
+ // }
+ // }
+ // };
+ // startAction.setText(CVMessages.getString(START_LABEL));
+ // startAction.setToolTipText(CVMessages.getString(START_LABEL));
+ // startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
+ // startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
+ // return startAction;
+ // }
private Action createRefreshAction() {
Action refreshAction = new Action() {
@@ -467,7 +477,6 @@
// return removeCloud;
// }
-
private void hookDoubleClickAction() {
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
14 years, 3 months
JBoss Tools SVN: r25827 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 08:24:18 -0400 (Thu, 14 Oct 2010)
New Revision: 25827
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14 12:22:38 UTC (rev 25826)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14 12:24:18 UTC (rev 25827)
@@ -42,6 +42,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -198,14 +199,22 @@
ELReference[] references = context.getELReferences();
ELResolver[] resolvers = context.getElResolvers();
+
+ IRelevanceCheck[] checks = new IRelevanceCheck[resolvers.length];
+ for (int i = 0; i < checks.length; i++) {
+ checks[i] = resolvers[i].createRelevanceCheck(javaElement);
+ }
if(javaElement != null){
for(ELReference reference : references){
int offset = reference.getStartPosition();
for(ELExpression operand : reference.getEl()){
- for (ELResolver resolver : resolvers) {
+ for (int i = 0; i < resolvers.length; i++) {
+ ELResolver resolver = resolvers[i];
if (!(resolver instanceof ELCompletionEngine))
continue;
+ if(!checks[i].isRelevant(operand.getText()))
+ continue;
ELResolution resolution = resolver.resolve(context, operand, offset);
14 years, 3 months
JBoss Tools SVN: r25826 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist: computers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 08:22:38 -0400 (Thu, 14 Oct 2010)
New Revision: 25826
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2010-10-14 12:20:30 UTC (rev 25825)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2010-10-14 12:22:38 UTC (rev 25826)
@@ -15,6 +15,7 @@
import java.util.Map;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -35,6 +36,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -250,6 +252,10 @@
public List<TextProposal> getProposals(ELContext context, int offset) {
return Collections.emptyList();
}
+
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return null;
+ }
};
ElVarSearcher varSearcher = new ElVarSearcher(file, fakeEngine);
List<Var> vars = varSearcher.findAllVars(file, getOffset());
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2010-10-14 12:20:30 UTC (rev 25825)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2010-10-14 12:22:38 UTC (rev 25826)
@@ -15,6 +15,7 @@
import java.util.Map;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Region;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
@@ -28,6 +29,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -120,6 +122,10 @@
public List<TextProposal> getProposals(ELContext context, int offset) {
return Collections.emptyList();
}
+
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return null;
+ }
};
ElVarSearcher varSearcher = new ElVarSearcher(file, fakeEngine);
List<Var> vars = varSearcher.findAllVars(file, getOffset());
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java 2010-10-14 12:20:30 UTC (rev 25825)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java 2010-10-14 12:22:38 UTC (rev 25826)
@@ -15,6 +15,7 @@
import java.util.Map;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Region;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
@@ -28,6 +29,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -144,6 +146,10 @@
public List<TextProposal> getProposals(ELContext context, int offset) {
return Collections.emptyList();
}
+
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return null;
+ }
};
ElVarSearcher varSearcher = new ElVarSearcher(file, fakeEngine);
List<Var> vars = varSearcher.findAllVars(file, getOffset());
14 years, 3 months
JBoss Tools SVN: r25825 - trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-14 08:20:30 -0400 (Thu, 14 Oct 2010)
New Revision: 25825
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7147 Limited the number of problem markers per file.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14 12:20:06 UTC (rev 25824)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14 12:20:30 UTC (rev 25825)
@@ -5,7 +5,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -16,7 +15,6 @@
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
import org.jboss.tools.jsf.web.validation.JSFValidationMessages;
-import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
public class ELValidatorTest extends AbstractResourceMarkerTest{
14 years, 3 months
JBoss Tools SVN: r25824 - trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-14 08:20:06 -0400 (Thu, 14 Oct 2010)
New Revision: 25824
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7147 Limited the number of problem markers per file.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14 12:20:00 UTC (rev 25823)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14 12:20:06 UTC (rev 25824)
@@ -23,14 +23,12 @@
public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
protected void setUp() throws Exception {
- JobUtils.waitForIdle();
- IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
- this.project = project.getProject();
-
- this.project.build(IncrementalProjectBuilder.CLEAN_BUILD,
- new NullProgressMonitor());
-
- JobUtils.waitForIdle();
+// JobUtils.waitForIdle();
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("JSFKickStartOldFormat");
+// this.project.build(IncrementalProjectBuilder.CLEAN_BUILD,
+// new NullProgressMonitor());
+//
+// JobUtils.waitForIdle();
}
public void testUnknownELVariable() throws CoreException, ValidationException {
14 years, 3 months
JBoss Tools SVN: r25823 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 08:20:00 -0400 (Thu, 14 Oct 2010)
New Revision: 25823
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2010-10-14 12:16:59 UTC (rev 25822)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2010-10-14 12:20:00 UTC (rev 25823)
@@ -35,6 +35,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.model.XModelObject;
@@ -531,4 +532,13 @@
return false;
}
+
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return new IRelevanceCheck() {
+ public boolean isRelevant(String content) {
+ return false;
+ }
+ };
+ }
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-10-14 12:16:59 UTC (rev 25822)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-10-14 12:20:00 UTC (rev 25823)
@@ -21,6 +21,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Image;
@@ -39,6 +40,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolutionImpl;
import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
@@ -593,4 +595,13 @@
protected boolean isStaticMethodsCollectingEnabled() {
return false;
}
+
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return new IRelevanceCheck() {
+ public boolean isRelevant(String content) {
+ return false;
+ }
+ };
+ }
+
}
\ No newline at end of file
14 years, 3 months
JBoss Tools SVN: r25822 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core: resolver and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-14 08:16:59 -0400 (Thu, 14 Oct 2010)
New Revision: 25822
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IRelevanceCheck.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-14 11:51:09 UTC (rev 25821)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-14 12:16:59 UTC (rev 25822)
@@ -48,6 +48,7 @@
import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
@@ -115,6 +116,10 @@
return completions;
}
+ public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
+ return new DefaultJavaRelevanceCheck(element);
+ }
+
/*
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver#resolve(org.jboss.tools.common.el.core.resolver.ELContext, org.jboss.tools.common.el.core.model.ELExpression)
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java 2010-10-14 12:16:59 UTC (rev 25822)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.ca;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
+
+public class DefaultJavaRelevanceCheck implements IRelevanceCheck {
+ String test1 = null;
+ String test2 = null;
+ String test3 = null;
+
+ public DefaultJavaRelevanceCheck(IJavaElement element) {
+ if(element == null) return;
+ test1 = element.getElementName();
+ if(element instanceof IMethod) {
+ if((test1.startsWith("get") || test1.startsWith("set")) && test1.length() > 3) { //$NON-NLS-1$ //$NON-NLS-2$
+ test2 = test1.substring(3, 4).toLowerCase() + test1.substring(4);
+ test3 = test1.substring(3);
+ } else if(test1.startsWith("is") && test1.length() > 2) { //$NON-NLS-1$
+ test2 = test1.substring(2, 3).toLowerCase() + test1.substring(3);
+ test3 = test1.substring(2);
+ }
+ if(test3 != null && test3.equals(test2)) test3 = null;
+ }
+ }
+
+ public boolean isRelevant(String content) {
+ if(test1 != null && content.contains(test1)) return true;
+ if(test2 != null && content.contains(test2)) return true;
+ return false;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java 2010-10-14 11:51:09 UTC (rev 25821)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver.java 2010-10-14 12:16:59 UTC (rev 25822)
@@ -12,6 +12,7 @@
import java.util.List;
+import org.eclipse.jdt.core.IJavaElement;
import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.text.TextProposal;
@@ -47,4 +48,13 @@
* @return EL parser factory
*/
ELParserFactory getParserFactory();
+
+ /**
+ * Creates object that will do fast check if resolution obtained from resolve method
+ * may include segments with this element
+ *
+ * @param element
+ * @return
+ */
+ IRelevanceCheck createRelevanceCheck(IJavaElement element);
}
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IRelevanceCheck.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IRelevanceCheck.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IRelevanceCheck.java 2010-10-14 12:16:59 UTC (rev 25822)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.resolver;
+
+public interface IRelevanceCheck {
+
+ public boolean isRelevant(String content);
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/IRelevanceCheck.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 3 months