JBoss Tools SVN: r38428 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-03 21:16:52 -0500 (Fri, 03 Feb 2012)
New Revision: 38428
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
Log:
JBIDE-10794
https://issues.jboss.org/browse/JBIDE-10794
Improved the logic of mapping markers to XModel objects.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2012-02-04 02:04:15 UTC (rev 38427)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2012-02-04 02:16:52 UTC (rev 38428)
@@ -14,10 +14,12 @@
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XJob.XRunnable;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.impl.XModelObjectImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -33,65 +35,166 @@
return instance;
}
- private Map<IProject, Set<XModelObject>> errorObjects = new HashMap<IProject, Set<XModelObject>>();
- private Map<IProject, Set<XModelObject>> warningObjects = new HashMap<IProject, Set<XModelObject>>();
+ private Map<IFile, Set<XModelObject>> errorObjects = new HashMap<IFile, Set<XModelObject>>();
+ private Map<IFile, Set<XModelObject>> warningObjects = new HashMap<IFile, Set<XModelObject>>();
+ private Set<IFile> uptodate = new HashSet<IFile>();
private XMarkerManager() {
- reload(null);
ModelPlugin.getWorkspace().addResourceChangeListener(this);
}
public void resourceChanged(IResourceChangeEvent event) {
- IProject project = null;
- Object o = event.getSource();
if(event.getType() == IResourceChangeEvent.PRE_DELETE && event.getResource() instanceof IProject) {
- errorObjects.remove((IProject)event.getResource());
- warningObjects.remove((IProject)event.getResource());
+ IProject p = (IProject)event.getResource();
+ clear(p.getFullPath());
return;
}
- if(o instanceof IWorkspace) {
- IResourceDelta d = event.getDelta();
- if(d != null) {
- IResourceDelta[] cs = d.getAffectedChildren();
- for (int i = 0; i < cs.length && project == null; i++) {
- project = cs[i].getResource().getProject();
+ try {
+ event.getDelta().accept(visitor);
+ } catch (CoreException e) {
+ ModelPlugin.getDefault().logError(e);
+ }
+ }
+
+ private synchronized void clear(IFile f) {
+ uptodate.remove(f);
+ errorObjects.remove(f);
+ warningObjects.remove(f);
+ }
+
+ private synchronized void clear(IPath f) {
+ Iterator<IFile> it = uptodate.iterator();
+ while(it.hasNext()) {
+ if(f.isPrefixOf(it.next().getFullPath())) {
+ it.remove();
+ }
+ }
+ it = errorObjects.keySet().iterator();
+ while(it.hasNext()) {
+ if(f.isPrefixOf(it.next().getFullPath())) {
+ it.remove();
+ }
+ }
+ it = warningObjects.keySet().iterator();
+ while(it.hasNext()) {
+ if(f.isPrefixOf(it.next().getFullPath())) {
+ it.remove();
+ }
+ }
+ }
+
+
+ ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ @Override
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ IResource r = delta.getResource();
+ if(delta.getKind() == IResourceDelta.REMOVED) {
+ if(r instanceof IFile) {
+ clear((IFile)r);
+ } else {
+ clear(r.getFullPath());
}
+ return false;
+ } else if(delta.getKind() == IResourceDelta.ADDED) {
+ return false;
+ } else if(delta.getKind() == IResourceDelta.NO_CHANGE) {
+ return true;
+ } else {
+ if(r instanceof IFile) {
+ IFile f = (IFile)r;
+ if(uptodate.contains(f)) {
+ synchronized(this) {
+ uptodate.remove(f);
+ }
+ if(f.exists()) {
+ updateJob.add(f);
+ }
+ }
+ }
}
+ return true;
+ }
+ }
+
+
+ UpdateJob updateJob = new UpdateJob();
+
+ class UpdateJob implements XRunnable {
+ Set<IFile> fs = new HashSet<IFile>();
+ boolean running = false;
+
+ public String getId() {
+ return "XMarkerManager"; //$NON-NLS-1$
}
- final IProject p = project;
- if(ResourcesPlugin.getWorkspace().isTreeLocked()) {
- XJob.addRunnable(new XRunnable() {
- public String getId() {
- return "XMarkerManager"; //$NON-NLS-1$
+ public void run() {
+ synchronized (this) {
+ running = true;
+ }
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ return;
+ }
+ try {
+ IFile f = null;
+ while((f = next()) != null) {
+ reload(f);
}
- public void run() {
- reload(p);
+ } finally {
+ synchronized (this) {
+ running = false;
}
- });
- } else {
- reload(p);
+ }
}
+
+ synchronized IFile next() {
+ if(fs.isEmpty()) {
+ return null;
+ }
+ IFile f = fs.iterator().next();
+ fs.remove(f);
+ return f;
+ }
+
+ public synchronized void add(IFile f) {
+ if(fs.contains(f)) {
+ return;
+ }
+ fs.add(f);
+ if(!running) {
+ XJob.addRunnable(updateJob);
+ }
+ }
}
- public void reload(IProject project) {
+ public void reload(IFile file) {
+ synchronized (this) {
+ if(uptodate.contains(file)) {
+ return;
+ } else {
+ uptodate.add(file);
+ }
+ }
IMarker[] ms = new IMarker[0];
try {
- ms = (project == null || !project.isAccessible())
+ ms = (file == null || !file.isAccessible())
? ModelPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)
- : project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+ : file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
- Set<XModelObject> os = errorObjects.get(project);
+ Set<XModelObject> os = errorObjects.get(file);
if(os == null) {
os = new HashSet<XModelObject>();
- errorObjects.put(project, os);
+ errorObjects.put(file, os);
}
reload(ms, os, IMarker.SEVERITY_ERROR);
- os = warningObjects.get(project);
+ os = warningObjects.get(file);
if(os == null) {
os = new HashSet<XModelObject>();
- warningObjects.put(project, os);
+ warningObjects.put(file, os);
}
reload(ms, os, IMarker.SEVERITY_WARNING);
}
@@ -144,24 +247,38 @@
}
}
}
- }
+ }
+
+ void update(XModelObject object) {
+ XModelObject fo = FileSystemsHelper.getFile(object);
+ if(fo != null) {
+ IFile f = (IFile)fo.getAdapter(IFile.class);
+ if(f != null && f.exists()) {
+ reload(f);
+ }
+ }
+ }
public int getErrorState(XModelObject object) {
if(object == null) return 0;
+ update(object);
if(object.getErrorState() == IMarker.SEVERITY_ERROR || object.getErrorChildCount() > 0) return IMarker.SEVERITY_ERROR;
if(object.getErrorState() == IMarker.SEVERITY_WARNING || object.getWarningChildCount() > 0) return IMarker.SEVERITY_WARNING;
return 0;
}
public boolean hasErrors(XModelObject object) {
+ update(object);
return object != null && (object.getErrorState() == IMarker.SEVERITY_ERROR || object.getErrorChildCount() > 0);
}
public boolean hasWarnings(XModelObject object) {
+ update(object);
return object != null && (object.getErrorState() == IMarker.SEVERITY_WARNING || object.getWarningChildCount() > 0);
}
public boolean hasErrors(XModelObject object, String attribute) {
+ update(object);
if(attribute == null) return hasErrors(object);
if(object.getErrorState() == 0) return false;
return object.getAttributeErrorState(attribute);
13 years, 8 months
JBoss Tools SVN: r38427 - in trunk/seam/tests/org.jboss.tools.seam.xml.test: src/org/jboss/tools/seam/xml/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-03 21:04:15 -0500 (Fri, 03 Feb 2012)
New Revision: 38427
Modified:
trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
Log:
JBIDE-10678
https://issues.jboss.org/browse/JBIDE-10678
Tests.
Modified: trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml 2012-02-04 01:17:46 UTC (rev 38426)
+++ trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml 2012-02-04 02:04:15 UTC (rev 38427)
@@ -25,7 +25,8 @@
<navigation:pages http-port="3" https-port="4" login-view-id="2" no-conversation-view-id="1"/>
<remoting:remoting debug="false" poll-interval="1" poll-timeout="2"/>
<framework:entity-query ejbql="abc" name="entityQuery"/>
- <framework:hibernate-entity-query ejbql="abc" name="hibernateEntityQuery"/>
+ <framework:hibernate-entity-query cache-region="sss" ejbql="abc"
+ fetch-size="3" name="hibernateEntityQuery" session="x"/>
<framework:entity-home entity-class="org.MyEntityHome" name="entityHome"/>
<framework:hibernate-entity-home name="hibernateEntityHome"/>
<security:identity authenticate-method="#{m1}" remember-me="true"/>
Modified: trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2012-02-04 01:17:46 UTC (rev 38426)
+++ trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2012-02-04 02:04:15 UTC (rev 38427)
@@ -94,8 +94,8 @@
public void testDebugAttribute() { //JBIDE-7362
XModelObject fileObject = getComponents22Object();
JobUtils.waitForIdle();
- XMarkerManager.getInstance();
assertNotNull("Cannot create XModel object for file components22.xml.", fileObject);
+ XMarkerManager.getInstance().getErrorState(fileObject);
XModelObject coreInit0 = fileObject.getChildByPath("org.jboss.seam.core.init");
assertNotNull("Cannot find component org.jboss.seam.core.init.", coreInit0);
@@ -111,6 +111,7 @@
}
+ @SuppressWarnings("nls")
public void testXML23Model() {
IFile f = project.getFile(new Path("components23.xml"));
assertTrue("File components23.xml is not accessible in Test project.", f.isAccessible());
@@ -122,6 +123,255 @@
assertEquals("File components23.xml is incorrectly parsed by XModel.", SeamComponentConstants.ENT_SEAM_COMPONENTS_23, entity);
//TODO continue test
+
+ XModelObject c = fileObject.getChildByPath("myComponent");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myFactory");
+ assertNotNull(c);
+ assertEquals("myFactory", c.getAttributeValue("value"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.navigation.pages");
+ assertNotNull(c);
+ assertEquals("3", c.getAttributeValue("http-port"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.remoting.remoting");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("poll-interval"));
+ assertEquals("2", c.getAttributeValue("poll-timeout"));
+
+ c = fileObject.getChildByPath("entityQuery");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("ejbql"));
+
+ c = fileObject.getChildByPath("hibernateEntityQuery");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("ejbql"));
+ assertEquals("sss", c.getAttributeValue("cache-region"));
+ assertEquals("3", c.getAttributeValue("fetch-size"));
+ assertEquals("x", c.getAttributeValue("session"));
+
+ c = fileObject.getChildByPath("entityHome");
+ assertNotNull(c);
+ assertEquals("org.MyEntityHome", c.getAttributeValue("entity-class"));
+
+ c = fileObject.getChildByPath("hibernateEntityHome");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.identity");
+ assertNotNull(c);
+ assertEquals("#{m1}", c.getAttributeValue("authenticate-method"));
+ assertEquals("true", c.getAttributeValue("remember-me"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.identityManager");
+ assertNotNull(c);
+ assertEquals("#{xyz}", c.getAttributeValue("identity-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaIdentityStore");
+ assertNotNull(c);
+ assertEquals("myManager", c.getAttributeValue("entity-manager"));
+ assertEquals("org.MyStore", c.getAttributeValue("user-class"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaTokenStore");
+ assertNotNull(c);
+ assertEquals("myEntityManager", c.getAttributeValue("entity-manager"));
+ assertEquals("String", c.getAttributeValue("token-class"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.ldapIdentityStore");
+ assertNotNull(c);
+ assertEquals("777", c.getAttributeValue("server-address"));
+ assertEquals("555", c.getAttributeValue("server-port"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.permissionManager");
+ assertNotNull(c);
+ assertEquals("#{permissionStore}", c.getAttributeValue("permission-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaPermissionStore");
+ assertNotNull(c);
+ assertEquals("myEntityManager", c.getAttributeValue("entity-manager"));
+ assertEquals("org.MyPermissionClass", c.getAttributeValue("user-permission-class"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.ruleBasedPermissionResolver");
+ assertNotNull(c);
+ assertEquals("#{myRules}", c.getAttributeValue("security-rules"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.persistentPermissionResolver");
+ assertNotNull(c);
+ assertEquals("#{myPermissionStore}", c.getAttributeValue("permission-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.rememberMe");
+ assertNotNull(c);
+ assertEquals("101", c.getAttributeValue("cookie-max-age"));
+ assertEquals("disabled", c.getAttributeValue("mode"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.transaction.transaction");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.jpaEntityLoader");
+ assertNotNull(c);
+ assertEquals("myEntityManager", c.getAttributeValue("entity-manager"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.hibernateEntityLoader");
+ assertNotNull(c);
+ assertEquals("mySession", c.getAttributeValue("session"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.entityConverter");
+ assertNotNull(c);
+ assertEquals("myEntityLoader", c.getAttributeValue("entity-loader"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.contextFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.exceptionFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.multipartFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.ajax4jsfFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.authenticationFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.cacheControlFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.servlet.characterEncodingFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.hotDeployFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.identityFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.loggingFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.redirectFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.rewriteFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.session");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.wicketFilter");
+ assertNotNull(c);
+ assertEquals("myClass", c.getAttributeValue("application-class"));
+
+ c = fileObject.getChildByPath("myPersistentContext");
+ assertNotNull(c);
+ assertEquals("myname", c.getAttributeValue("persistence-unit-jndi-name"));
+
+ c = fileObject.getChildByPath("myManagerFactory");
+ assertNotNull(c);
+ assertEquals("myName", c.getAttributeValue("persistence-unit-name"));
+
+ c = fileObject.getChildByPath("myFilter");
+ assertNotNull(c);
+ assertEquals("myFilterName", c.getAttributeValue("filter name"));
+
+ c = fileObject.getChildByPath("mySession");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("mySessionFactory");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.async.dispatcher");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myManagedWorkingMemory");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myRuleBase");
+ assertNotNull(c);
+ assertEquals("fff", c.getAttributeValue("rule-files"));
+
+ c = fileObject.getChildByPath("myRuleAgent");
+ assertNotNull(c);
+ assertEquals("fff", c.getAttributeValue("configuration-file"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.international.localeSelector");
+ assertNotNull(c);
+ assertEquals("ss", c.getAttributeValue("locale-string"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.international.timeZoneSelector");
+ assertNotNull(c);
+ assertEquals("22", c.getAttributeValue("time-zone-id"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.international.localeConfig");
+ assertNotNull(c);
+ assertEquals("ru", c.getAttributeValue("default-locale"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.wicket.webApplication");
+ assertNotNull(c);
+ assertEquals("org.MyApplication", c.getAttributeValue("application-class"));
+
+ c = fileObject.getChildByPath("myKeyStore");
+ assertNotNull(c);
+ assertEquals("a", c.getAttributeValue("key-alias"));
+ assertEquals("p", c.getAttributeValue("key-password"));
+ assertEquals("keyStore", c.getAttributeValue("key-store"));
+ assertEquals("q", c.getAttributeValue("key-store-password"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.init");
+ assertNotNull(c);
+ assertEquals("pp", c.getAttributeValue("jndi-pattern"));
+ assertEquals("true", c.getAttributeValue("security-enabled"));
+ assertEquals("true", c.getAttributeValue("transaction-management-enabled"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.manager");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("conversation-timeout"));
+ assertEquals("1", c.getAttributeValue("concurrent-request-timeout"));
+ assertEquals("p", c.getAttributeValue("conversation-id-parameter"));
+ assertEquals("MANUAL", c.getAttributeValue("default-flush-mode"));
+ assertEquals("q", c.getAttributeValue("parent-conversation-id-parameter"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.pojoCache");
+ assertNotNull(c);
+ assertEquals("nnn", c.getAttributeValue("cfg-resource-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.resourceLoader");
+ assertNotNull(c);
+ assertEquals("n1,n2", c.getAttributeValue("bundle-names"));
+
+ c = fileObject.getChildByPath("mySelector");
+ assertNotNull(c);
+ assertEquals("x", c.getAttributeValue("theme"));
+ assertEquals("x,y", c.getAttributeValue("available-themes"));
+ assertEquals("true", c.getAttributeValue("cookie-enabled"));
+ assertEquals("100", c.getAttributeValue("cookie-max-age"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.jms.queueConnection");
+ assertNotNull(c);
+ assertEquals("myName", c.getAttributeValue("factory-jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.jms.topicConnection");
+ assertNotNull(c);
+ assertEquals("factory", c.getAttributeValue("factory-jndi-name"));
+
+ c = fileObject.getChildByPath("myTopicPublisher");
+ assertNotNull(c);
+ assertEquals("jjj", c.getAttributeValue("topic-jndi-name"));
+
+ c = fileObject.getChildByPath("mySender");
+ assertNotNull(c);
+ assertEquals("nn", c.getAttributeValue("queue-jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.bpm.actor");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("group-actor-ids"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.bpm.jbpm");
+ assertNotNull(c);
}
protected void assertAttribute(XModelObject object, String name, String value) {
13 years, 8 months
JBoss Tools SVN: r38426 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-03 20:17:46 -0500 (Fri, 03 Feb 2012)
New Revision: 38426
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
Minor fix for marker selection.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2012-02-04 01:08:31 UTC (rev 38425)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2012-02-04 01:17:46 UTC (rev 38426)
@@ -50,6 +50,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.options.Preference;
@@ -415,8 +416,24 @@
if(path != null) {
XModelObject o = getModelObject().getModel().getByPath(path);
if(o == null) return;
+
+ XModelObject f = FileSystemsHelper.getFile(o);
+ if(f != null && f != object && object.getFileType() == XModelObject.FILE && getFile() != null && getFile().equals(f.getAdapter(IFile.class))) {
+ if(f == o) {
+ o = object;
+ } else {
+ o = object.getChildByPath(o.getPath().substring(f.getPath().length() + 1));
+ if(o == null) {
+ return;
+ }
+ }
+ }
+
selectionProvider.setSelection(new StructuredSelection(o));
- switchToPage(getSourcePageIndex());
+ //tab=Tree is set to prevent switching to Source tab.
+ if(!"Tree".equals(marker.getAttribute("tab", null))) { //$NON-NLS-1$ //$NON-NLS-2$
+ switchToPage(getSourcePageIndex());
+ }
postponedTextSelection.clean();
if(marker.getAttribute(IMarker.LINE_NUMBER, -1) != -1) {
13 years, 8 months
JBoss Tools SVN: r38425 - in trunk/maven/plugins: org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-03 20:08:31 -0500 (Fri, 03 Feb 2012)
New Revision: 38425
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
trunk/maven/plugins/org.jboss.tools.maven.seam/lifecycle-mapping-metadata.xml
Log:
JBIDE-10790 : changed the lifecycle-mapping to map the seam configurator for ear projects to the generate-application-xml goal, due to upstream change in m2e-wtp 0.15.0
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-03 20:32:26 UTC (rev 38424)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-04 01:08:31 UTC (rev 38425)
@@ -292,6 +292,10 @@
public static void addClasspathAttribute(IJavaProject javaProject,
IClasspathAttribute attribute, IProgressMonitor monitor) throws JavaModelException {
+ if (javaProject == null || !javaProject.exists()) {
+ return;
+ }
+
IClasspathEntry[] cp = javaProject.getRawClasspath();
for (int i = 0; i < cp.length; i++) {
if (IClasspathEntry.CPE_CONTAINER == cp[i].getEntryKind()
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2012-02-03 20:32:26 UTC (rev 38424)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2012-02-04 01:08:31 UTC (rev 38425)
@@ -88,11 +88,9 @@
// build.setFinalName(artifactId);
if (fpwc.hasProjectFacet(JavaFacet.FACET)) {
- String outputDirectory = MavenCoreActivator
- .getOutputDirectory(javaProject);
+ String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
build.setOutputDirectory(outputDirectory);
- String sourceDirectory = MavenCoreActivator
- .getSourceDirectory(javaProject);
+ String sourceDirectory = MavenCoreActivator.getSourceDirectory(javaProject);
if (sourceDirectory != null) {
build.setSourceDirectory(sourceDirectory);
}
@@ -113,8 +111,7 @@
MavenCoreActivator.createMavenProject(project.getName(),
monitor, model, true);
}
- IProjectFacet seamFacet = ProjectFacetsManager
- .getProjectFacet(SEAM_FACET_ID);
+ IProjectFacet seamFacet = ProjectFacetsManager.getProjectFacet(SEAM_FACET_ID);
if (!fpwc.hasProjectFacet(seamFacet)) {
MavenCoreActivator.addCompilerPlugin(build, project);
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/lifecycle-mapping-metadata.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/lifecycle-mapping-metadata.xml 2012-02-03 20:32:26 UTC (rev 38424)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/lifecycle-mapping-metadata.xml 2012-02-04 01:08:31 UTC (rev 38425)
@@ -57,6 +57,7 @@
<artifactId>maven-ear-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
+ <goal>generate-application-xml</goal>
<goal>ear</goal>
</goals>
</pluginExecutionFilter>
13 years, 8 months
JBoss Tools SVN: r38424 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-03 15:32:26 -0500 (Fri, 03 Feb 2012)
New Revision: 38424
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/BuilderOrderResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-10765 Quick fix to change Builder order causes a deadlock
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/BuilderOrderResolutionGenerator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/BuilderOrderResolutionGenerator.java 2012-02-03 20:20:14 UTC (rev 38423)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/BuilderOrderResolutionGenerator.java 2012-02-03 20:32:26 UTC (rev 38424)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolution2;
import org.eclipse.ui.IMarkerResolutionGenerator2;
@@ -55,10 +56,19 @@
}
public void run(IMarker marker) {
- IProject project = marker.getResource().getProject();
+ final IProject project = marker.getResource().getProject();
try {
if(CommonValidationPlugin.makeBuilderLast(project, ValidationPlugin.VALIDATION_BUILDER_ID)) {
- project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ } catch (CoreException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ }
+ });
}
} catch (CoreException e) {
CommonPlugin.getDefault().logError(e);
13 years, 8 months
JBoss Tools SVN: r38423 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-03 15:20:14 -0500 (Fri, 03 Feb 2012)
New Revision: 38423
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
Minor fix for marker selection.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2012-02-03 19:41:38 UTC (rev 38422)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2012-02-03 20:20:14 UTC (rev 38423)
@@ -418,8 +418,8 @@
selectionProvider.setSelection(new StructuredSelection(o));
switchToPage(getSourcePageIndex());
+ postponedTextSelection.clean();
if(marker.getAttribute(IMarker.LINE_NUMBER, -1) != -1) {
- postponedTextSelection.clean();
if(textEditor != null) textEditor.gotoMarker(marker);
} else {
String attr = marker.getAttribute("attribute", ""); //$NON-NLS-1$ //$NON-NLS-2$
13 years, 8 months
JBoss Tools SVN: r38422 - in trunk/esb/plugins/org.jboss.tools.esb.project.ui: src/org/jboss/tools/esb/project/ui/messages and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2012-02-03 14:41:38 -0500 (Fri, 03 Feb 2012)
New Revision: 38422
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBDomParser.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBVisualizerView.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/WorkbenchFileSelectionDialog.java
Log:
[JBIDE-10783] Adding ability to double-click on a node to open in the ESB editor
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2012-02-03 19:41:38 UTC (rev 38422)
@@ -38,7 +38,8 @@
org.jboss.ide.eclipse.as.core;bundle-version="1.0.0",
org.jboss.tools.common.ui;bundle-version="3.1.0",
org.eclipse.zest.core,
- org.eclipse.zest.layouts
+ org.eclipse.zest.layouts,
+ org.jboss.tools.common.model
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
Eclipse-RegisterBuddy: org.eclipse.jst.ws.annotations.core
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2012-02-03 19:41:38 UTC (rev 38422)
@@ -51,6 +51,8 @@
JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar=The library must contain at least one jar.
+ESBDomParser_Actions_Node_Label=Actions
+ESBDomParser_Listeners_Node_Label=Listeners
ESBDomParser_Providers_Label=Providers
ESBDomParser_Services_Label=Services
ESBFacetInstallationPage_Button_Text_New=New
@@ -82,12 +84,15 @@
ESBExportWizard_Description=Export an ESB project to the local file system.
ESBExportWizard_ESBProject=ESB Project\:
ESBVisualizerView_Change_Layout_Action_Label=Change Layout
+ESBVisualizerView_DoubleClick_Toggle_Action_label=Freeze Node on Double-click
ESBVisualizerView_EmptyNodeLabel=Select an ESB Configuration file in the navigator\n or use the 'Open JBoss ESB Configuration' view menu\n to show a configuration graphically.
ESBVisualizerView_Open_ESB_Config_Action_Label=Open ESB Configuration
ESBVisualizerView_Open_ESB_Config_Dialog_Field_Text=Select ESB file:
ESBVisualizerView_Open_ESB_Config_Dialog_Title=Open ESB Configuration
+ESBVisualizerView_Open_ESB_Editor_Action_Label=Open ESB Editor
ESBVisualizerView_Refresh_Layout_Action_Label=Refresh Layout
ESBVisualizerView_Select_ESB_File_Warning=Please select an ESB configuration file.
ESBVisualizerView_Use_Horizontal_Tree_Layout_Action_Label=Use Horizontal Tree Layout
ESBVisualizerView_Use_Radial_Layout_Action_Label=Use Radial Layout
ESBVisualizerView_Use_Vertical_Tree_Layout_Action_Label=Use Vertical Tree Layout
+WorkbenchFileSelectionDialog_Title=Select a File
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2012-02-03 19:41:38 UTC (rev 38422)
@@ -55,6 +55,10 @@
public static String JBoss_ESBRuntime_Classpath_Container_5;
public static String JBoss_Runtime_List_Field_Editor_Configuration;
+ public static String ESBDomParser_Actions_Node_Label;
+
+ public static String ESBDomParser_Listeners_Node_Label;
+
public static String ESBDomParser_Providers_Label;
public static String ESBDomParser_Services_Label;
@@ -143,6 +147,8 @@
public static String ESBVisualizerView_Change_Layout_Action_Label;
+ public static String ESBVisualizerView_DoubleClick_Toggle_Action_label;
+
public static String ESBVisualizerView_EmptyNodeLabel;
public static String ESBVisualizerView_Open_ESB_Config_Action_Label;
@@ -151,6 +157,8 @@
public static String ESBVisualizerView_Open_ESB_Config_Dialog_Title;
+ public static String ESBVisualizerView_Open_ESB_Editor_Action_Label;
+
public static String ESBVisualizerView_Refresh_Layout_Action_Label;
public static String ESBVisualizerView_Select_ESB_File_Warning;
@@ -161,7 +169,9 @@
public static String ESBVisualizerView_Use_Vertical_Tree_Layout_Action_Label;
+ public static String WorkbenchFileSelectionDialog_Title;
+
static {
NLS.initializeMessages(BUNDLE_NAME, JBossESBUIMessages.class);
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBDomParser.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBDomParser.java 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBDomParser.java 2012-02-03 19:41:38 UTC (rev 38422)
@@ -65,11 +65,11 @@
return true;
}
}catch(ParserConfigurationException pce) {
- pce.printStackTrace();
+ // ignore
}catch(SAXException se) {
- se.printStackTrace();
+ // ignore
}catch(IOException ioe) {
- ioe.printStackTrace();
+ // ignore
}
return false;
@@ -109,8 +109,12 @@
//parse using builder to get DOM representation of the XML file
dom = db.parse(filepath);
dom.getDocumentElement().normalize();
- root.setName(dom.getDocumentElement().getTagName());
+ java.io.File tempFile = new java.io.File(filepath);
+ String filename = tempFile.getName();
+ root.setName(filename);
root.setEsbObjectType(ESBType.ESB);
+ File setupFile = new File(filepath);
+ root.setData(setupFile);
parseDocument();
@@ -188,7 +192,7 @@
parent.setEsbObjectType(ESBType.SERVICE);
} else if (tag.equalsIgnoreCase("listeners")) { //$NON-NLS-1$
parent.setEsbObjectType(ESBType.LISTENER);
- } else if (tag.equalsIgnoreCase("actions")) { //$NON-NLS-1$
+ } else if (tag.equalsIgnoreCase("Actions")) { //$NON-NLS-1$
parent.setEsbObjectType(ESBType.ACTION);
} else if (tag.equalsIgnoreCase("action")) { //$NON-NLS-1$
parent.setEsbObjectType(ESBType.ACTION);
@@ -211,6 +215,11 @@
if (name == null || name.trim().length() == 0) {
name = child.getTagName();
}
+ if (name.equalsIgnoreCase("actions")) { //$NON-NLS-1$
+ name = JBossESBUIMessages.ESBDomParser_Actions_Node_Label;
+ } else if (name.equalsIgnoreCase("listeners")) { //$NON-NLS-1$
+ name = JBossESBUIMessages.ESBDomParser_Listeners_Node_Label;
+ }
ESBNodeWithChildren childNode = new ESBNodeWithChildren(name);
String ref = child.getAttribute("busidref"); //$NON-NLS-1$
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBVisualizerView.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBVisualizerView.java 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/ESBVisualizerView.java 2012-02-03 19:41:38 UTC (rev 38422)
@@ -35,8 +35,11 @@
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.dialogs.ISelectionValidator;
+import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.IShowInTarget;
import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.part.ViewPart;
@@ -56,6 +59,9 @@
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
import org.eclipse.zest.layouts.constraints.BasicEntityConstraint;
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.visualizer.ESBNode.ESBType;
@@ -88,12 +94,18 @@
private GraphViewer gv;
+ private IFile currentFile;
+
// Some stashed colors
private Color defaultBorder;
// menu items
private Action openESBFileAction;
+ private Action openESBFileInEditorAction;
+ private Action doubleClickAction;
+ private boolean doubleClickFreezesNode = false;
+
// toolbar buttons for different layouts
private IAction horizontalLayoutAction;
private IAction verticalLayoutAction;
@@ -112,6 +124,7 @@
String path = selectedFile.getLocation().toOSString();
ESBDomParser parser = new ESBDomParser();
if (parser.isFileESBConfig(path)) {
+ currentFile = selectedFile;
if (!gv.getGraphControl().isDisposed()) {
visualizeESB(path);
refreshLayoutAction.run();
@@ -169,7 +182,6 @@
clearGraph();
new GraphNode (gv.getGraphControl(), ZestStyles.NODES_CACHE_LABEL,
JBossESBUIMessages.ESBVisualizerView_EmptyNodeLabel);
-// refreshLayoutAction.run();
}
/**
@@ -337,7 +349,7 @@
* @param manager
*/
private void fillContextMenu(IMenuManager manager) {
- manager.add(openESBFileAction);
+ manager.add(doubleClickAction);
}
/*
@@ -345,6 +357,10 @@
*/
private void makeActions() {
+ openESBFileInEditorAction = new OpenESBEditorAction();
+
+ doubleClickAction = new DoubleClickToggleAction();
+
refreshLayoutAction = new Action() {
@Override
public void run() {
@@ -391,6 +407,10 @@
if (rtn_code == WorkbenchFileSelectionDialog.OK) {
IPath resultPath = dialog.getFullPath();
IPath totalPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(resultPath);
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(dialog.getFullPath().toFile().toURI());
+ if (files != null && files.length > 0) {
+ currentFile = files[0];
+ }
String path = totalPath.toOSString();
visualizeESB(path);
}
@@ -410,6 +430,8 @@
this);
IActionBars bars = getViewSite().getActionBars();
bars.getMenuManager().add(openESBFileAction);
+ bars.getMenuManager().add(openESBFileInEditorAction);
+ bars.getMenuManager().add(doubleClickAction);
IToolBarManager toolbar = bars.getToolBarManager();
@@ -502,12 +524,114 @@
}
}
}
+
+ /*
+ * Opens the currently displayed file in the ESB editor with the path pre-selected
+ */
+ private void openESBAction ( ) {
+ if (currentFile != null) {
+ Graph graph = gv.getGraphControl();
+ String modelpath = ""; //$NON-NLS-1$
+ if (!graph.getSelection().isEmpty()) {
+ GraphNode node = (GraphNode) graph.getSelection().get(0);
+ if (node.getData() != null && node.getData() instanceof ESBNode) {
+ ESBNode esbnode = (ESBNode) node.getData();
+ while (esbnode != null && esbnode.getParent() != null) {
+ if (modelpath.trim().length() > 0)
+ modelpath = "/" + modelpath; //$NON-NLS-1$
+ modelpath = esbnode.getName() + modelpath;
+ esbnode = esbnode.getParent();
+ }
+// boolean useIdeMethod = false;
+// if (useIdeMethod) {
+// modelpath = "FileSystems/project/" + currentFile.getProjectRelativePath().toString() + "/" + modelpath;
+// // modelpath = "FileSystems/project/esbcontent/META-INF/jboss-esb.xml/Services/SimpleListener";
+//
+// IWorkbenchPage page = getSite().getPage();
+// HashMap<String, String> map = new HashMap<String, String>();
+// map.put("xpath", modelpath);// "action/path/whatever");
+// map.put(IDE.EDITOR_ID_ATTR,
+// "org.jboss.tools.common.model.ui.editor.EditorPartWrapper");
+// try {
+// IMarker marker = currentFile.createMarker(IMarker.TEXT);
+// marker.setAttributes(map);
+// IDE.openEditor(page, marker); //3.0 API
+// marker.delete();
+// } catch (CoreException e) {
+// e.printStackTrace();
+// }
+// } else {
+ // if we have an empty path, the user double-clicked on the root
+ // so just open the file
+ if (modelpath.trim().length() == 0) {
+ IWorkbenchPage page = getSite().getPage();
+ try {
+ IDE.openEditor(page, currentFile);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ } else {
+ // otherwise use the FindObjectHelper to find the actual node
+ // in the ESB editor
+ XModelObject fileObject =
+ EclipseResourceUtil.createObjectForResource(currentFile);
+ XModelObject actionObject =
+ fileObject.getChildByPath(modelpath); //"Services/SimpleListener/Actions/displayAction");
+ FindObjectHelper.findModelObject(actionObject, FindObjectHelper.IN_EDITOR_ONLY);
+ }
+ // }
+ }
+ }
+ }
+ }
+
/*
+ * Action to open the ESB editor
* @author bfitzpat
- * If the user double-clicks on a node, "fix" it in place. If they double-
- * click again, un-"fix" it.
+ *
*/
+ private class OpenESBEditorAction extends Action {
+
+ public OpenESBEditorAction() {
+ super(JBossESBUIMessages.ESBVisualizerView_Open_ESB_Editor_Action_Label);
+ }
+
+ public void run() {
+ openESBAction();
+ }
+
+ }
+
+ /*
+ * Action to toggle the double-click behavior from freezing a node to opening
+ * the ESB editor to the selected object.
+ * By default it opens the ESB editor.
+ * @author bfitzpat
+ *
+ */
+ private class DoubleClickToggleAction extends Action {
+
+ public DoubleClickToggleAction() {
+ super(JBossESBUIMessages.ESBVisualizerView_DoubleClick_Toggle_Action_label);
+ this.setChecked(doubleClickFreezesNode);
+ }
+
+ public void run() {
+ doubleClickFreezesNode = !doubleClickFreezesNode;
+ this.setChecked(doubleClickFreezesNode);
+ }
+
+ }
+
+ /*
+ * @author bfitzpat
+ * If the user double-clicks on a node, it does one of two things:
+ * * if the double-click toggle is set to freeze the node, it will "freeze" it in place.
+ * If they double-click again, un-"freeze" it. Frozen nodes don't move when the layout
+ * changes or is refreshed.
+ * * if not, the ESB editor is opened and the object double-clicked on is selected
+ */
private class FixNodeDoubleClickListener implements IDoubleClickListener {
public void doubleClick(DoubleClickEvent e) {
if (e.getSource() instanceof GraphViewer) {
@@ -515,15 +639,19 @@
if (!graph.getSelection().isEmpty()) {
GraphNode node = (GraphNode) graph.getSelection().get(0);
if (node.getData() != null && node.getData() instanceof ESBNode) {
- ESBNode to = (ESBNode)node.getData();
- to.setIsMovementLocked(!to.isMovementLocked());
- if (to.isMovementLocked()) {
- node.setBorderWidth(3);
- node.setBorderColor(gv.getGraphControl().getDisplay().getSystemColor(
- SWT.COLOR_BLUE));
+ if (doubleClickFreezesNode) {
+ ESBNode to = (ESBNode)node.getData();
+ to.setIsMovementLocked(!to.isMovementLocked());
+ if (to.isMovementLocked()) {
+ node.setBorderWidth(3);
+ node.setBorderColor(gv.getGraphControl().getDisplay().getSystemColor(
+ SWT.COLOR_BLUE));
+ } else {
+ node.setBorderWidth(1);
+ node.setBorderColor(defaultBorder);
+ }
} else {
- node.setBorderWidth(1);
- node.setBorderColor(defaultBorder);
+ openESBAction();
}
}
}
@@ -576,6 +704,7 @@
String path = ((IFile)first).getLocation().toOSString();
ESBDomParser parser = new ESBDomParser();
if (parser.isFileESBConfig(path)) {
+ this.currentFile = (IFile) first;
visualizeESB(path);
return true;
} else {
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/WorkbenchFileSelectionDialog.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/WorkbenchFileSelectionDialog.java 2012-02-03 18:44:27 UTC (rev 38421)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/visualizer/WorkbenchFileSelectionDialog.java 2012-02-03 19:41:38 UTC (rev 38422)
@@ -28,6 +28,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
public class WorkbenchFileSelectionDialog
@@ -106,7 +107,7 @@
e.printStackTrace();
}
- this.title = "Some fun title";
+ this.title = JBossESBUIMessages.WorkbenchFileSelectionDialog_Title;
this.message = message;
setShellStyle(getShellStyle() | SWT.RESIZE);
this.filterPatterns = filterPatterns;
13 years, 8 months
JBoss Tools SVN: r38421 - trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-02-03 13:44:27 -0500 (Fri, 03 Feb 2012)
New Revision: 38421
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
Log:
JBIDE=10260 Inconsistent output of Create Portlet Wizard when leaving default
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2012-02-03 17:38:10 UTC (rev 38420)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2012-02-03 18:44:27 UTC (rev 38421)
@@ -47,7 +47,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
import org.jboss.tools.portlet.ui.IPortletUIConstants;
@@ -69,11 +73,14 @@
private Text heightText;
private Combo initialWindowStateCombo;
private Button addPortlet;
+ private boolean isJBossPortal;
+ private boolean isGateIn;
public AddJBossPortletWizardPage(IDataModel model, String pageName) {
super(model, pageName);
setDescription(IPortletUIConstants.ADD_JBOSS_PORTLET_WIZARD_PAGE_DESC);
setTitle(IPortletUIConstants.ADD_JBOSS_PORTLET_WIZARD_PAGE_TITLE);
+ refreshProperties();
}
/*
@@ -115,14 +122,7 @@
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- boolean isJBossPortal = PortletUIActivator.isJBossPortalRuntime(model);
- model.setBooleanProperty(ADD_PORTLET, isJBossPortal);
- boolean isGateIn = PortletUIActivator.isGateIn(model);
- if (isGateIn) {
- model.setBooleanProperty(ADD_JBOSS_APP, false);
- model.setBooleanProperty(ADD_JBOSS_PORTLET, false);
- }
+ refreshProperties();
GridData gd;
if (isJBossPortal) {
addPortlet = new Button(composite,SWT.CHECK);
@@ -261,6 +261,17 @@
}
+
+ protected void refreshProperties() {
+ isJBossPortal = PortletUIActivator.isJBossPortalRuntime(model);
+ model.setBooleanProperty(ADD_PORTLET, isJBossPortal);
+ isGateIn = PortletUIActivator.isGateIn(model);
+ model.setBooleanProperty(CONFIGURE_GATEIN_PARAMETERS, isGateIn);
+ if (isGateIn) {
+ model.setBooleanProperty(ADD_JBOSS_APP, false);
+ model.setBooleanProperty(ADD_JBOSS_PORTLET, false);
+ }
+ }
public boolean canFlipToNextPage() {
if (model.getBooleanProperty(USE_EXISTING_CLASS))
@@ -292,4 +303,13 @@
initialWindowStateCombo.setEnabled(enable);
pageNameText.setEnabled(enable);
}
+
+ @Override
+ public void propertyChanged(DataModelEvent event) {
+ super.propertyChanged(event);
+ String propertyName = event.getPropertyName();
+ if (propertyName != null && propertyName.equals(IArtifactEditOperationDataModelProperties.PROJECT_NAME)) {
+ refreshProperties();
+ }
+ }
}
13 years, 8 months
JBoss Tools SVN: r38420 - trunk/common/plugins/org.jboss.tools.common.mylyn.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-03 12:38:10 -0500 (Fri, 03 Feb 2012)
New Revision: 38420
Modified:
trunk/common/plugins/org.jboss.tools.common.mylyn/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-10776 JBoss Jira should be called JBoss Community in mylyn jira setup
Modified: trunk/common/plugins/org.jboss.tools.common.mylyn/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.mylyn/plugin.xml 2012-02-03 17:32:06 UTC (rev 38419)
+++ trunk/common/plugins/org.jboss.tools.common.mylyn/plugin.xml 2012-02-03 17:38:10 UTC (rev 38420)
@@ -10,7 +10,7 @@
<repository
anonymous="false"
addAutomatically="true"
- label="JBoss JIRA"
+ label="JBoss Community"
repositoryKind="jira"
urlRepository="https://issues.jboss.org"
characterEncoding="UTF-8"/>
13 years, 8 months