JBoss Tools SVN: r13078 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-01-16 04:23:13 -0500 (Fri, 16 Jan 2009)
New Revision: 13078
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java
Log:
JBIDE-3046 - changed JMX credential dialog and added an ignore button so user can accept the server is started
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2009-01-16 06:23:00 UTC (rev 13077)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2009-01-16 09:23:13 UTC (rev 13078)
@@ -53,6 +53,7 @@
public static final String POLLER_ID = "org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller";
public static final int JMXPOLLER_CODE = IEventCodes.JMXPOLLER_CODE;
+ public static final Properties IGNORED_PROPERTIES = new Properties();
public static final String REQUIRED_USER = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_USER";
public static final String REQUIRED_PASS = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_PASS";
@@ -127,14 +128,20 @@
} else {
// we're waiting. are they back yet?
if( requiredPropertiesReturned != null ) {
- requiresInfoException = null;
- String user, pass;
- user = (String)requiredPropertiesReturned.get(REQUIRED_USER);
- pass = (String)requiredPropertiesReturned.get(REQUIRED_PASS);
- requiredPropertiesReturned = null;
- runner.setUser(user);
- runner.setPass(pass);
- waitingForCredentials = false;
+ if( requiredPropertiesReturned == IGNORED_PROPERTIES) {
+ requiresInfoException = null;
+ done = true;
+ started = STATE_STARTED;
+ } else {
+ requiresInfoException = null;
+ String user, pass;
+ user = (String)requiredPropertiesReturned.get(REQUIRED_USER);
+ pass = (String)requiredPropertiesReturned.get(REQUIRED_PASS);
+ requiredPropertiesReturned = null;
+ runner.setUser(user);
+ runner.setPass(pass);
+ waitingForCredentials = false;
+ }
}
}
}
@@ -216,8 +223,7 @@
public void failureHandled(Properties properties) {
if( properties == null ) {
- done = true;
- pollingException = new PollingException("Request for more information ignored");
+ requiredPropertiesReturned = IGNORED_PROPERTIES;
} else
requiredPropertiesReturned = properties;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-01-16 06:23:00 UTC (rev 13077)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-01-16 09:23:13 UTC (rev 13078)
@@ -32,7 +32,7 @@
sswf_Title=Create a new System Copy Server
sswf_BaseName=Local Deployer
-credentials_warning=Your server is throwing a security exception.\nPlease enter your username and password now, or\nenter them in the server editor by double-clicking on the server.
+credentials_warning=Your server is responding to JMX inquiries with a Security Exception.\nYou can try entering new credentials below, or you can double-click\non your server and verify that the host, JNDI port, username, and password are accurate.\nYou can also click "ignore" below to begin working with your server,\nbut deploying to and stopping the server may not function properly.
credentials_save=Save these credentials?
#Server View (server and categories, properties)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java 2009-01-16 06:23:00 UTC (rev 13077)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/RequiredCredentialsDialog.java 2009-01-16 09:23:13 UTC (rev 13078)
@@ -22,6 +22,7 @@
package org.jboss.ide.eclipse.as.ui.dialogs;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -45,7 +46,7 @@
*
*/
public class RequiredCredentialsDialog extends Dialog {
-
+ public static final int IGNORE_ID = IDialogConstants.CLIENT_ID | 3;
private String user, pass;
private boolean save;
private JBossServer jbs;
@@ -118,7 +119,15 @@
saveCredentials.setSelection(true);
return c;
}
+
+ protected void createButtonsForButtonBar(Composite parent) {
+ // create OK and Cancel buttons by default
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
+ true);
+ createButton(parent, IDialogConstants.CANCEL_ID, "Ignore", false);
+ }
+
private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
FormData data = new FormData();
16 years
JBoss Tools SVN: r13077 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-01-16 01:23:00 -0500 (Fri, 16 Jan 2009)
New Revision: 13077
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
Log:
JBIDE-3073 - changing runtime now affects launch config
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-01-16 04:52:20 UTC (rev 13076)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-01-16 06:23:00 UTC (rev 13077)
@@ -47,6 +47,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType {
@@ -71,13 +72,64 @@
// Upgrade old launch configs
JBossServer jbs = findJBossServer(server.getId());
+ if( jbs == null )
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Server " + server.getName() + " is not a proper JBoss Server"));
+
if( workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null) != null ) {
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null);
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
}
+
+ // Force the launch to get certain fields from the runtime
+ updateMandatedFields(workingCopy, jbs);
}
+ /*
+ * Ensures that the working directory and classpath are 100% accurate.
+ * Merges proper required params into args and vm args
+ */
+
+ protected static void updateMandatedFields(ILaunchConfigurationWorkingCopy wc, JBossServer jbs) throws CoreException{
+ String serverHome = getServerHome(jbs);
+ if( serverHome == null )
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Server " + jbs.getServer().getName() + " is corrupt and the server home is unable to be located."));
+
+ IRuntime rt = jbs.getServer().getRuntime();
+ IJBossServerRuntime jbrt = null;
+ if( rt != null )
+ jbrt = (IJBossServerRuntime)rt.getAdapter(IJBossServerRuntime.class);
+
+ if( jbrt == null )
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Runtime not found"));
+
+ String args = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
+ String vmArgs = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
+ String h = jbs.getServer().getHost();
+ String h2 = ArgsUtil.getValue(args, "-b", "--host");
+ if( !jbs.getServer().getHost().equals(ArgsUtil.getValue(args, "-b", "--host")))
+ args = ArgsUtil.setArg(args, "-b", "--host", jbs.getServer().getHost());
+
+ IJBossServerRuntime runtime = (IJBossServerRuntime)
+ jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
+ String config = runtime.getJBossConfiguration();
+ args = ArgsUtil.setArg(args, "-c", "--configuration", config);
+
+ vmArgs= ArgsUtil.setArg(vmArgs, null, "-Djava.endorsed.dirs",
+ "\"" + runtime.getRuntime().getLocation().append("lib").append("endorsed") + "\"");
+
+ if( runtime.getRuntime().getLocation().append("bin").append("native").toFile().exists() )
+ vmArgs = ArgsUtil.setArg(vmArgs, "", "-Djava.library.path",
+ "\"" + runtime.getRuntime().getLocation().append("bin").append("native") + "\"");
+
+
+
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
+ }
+
public static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
JBossServer jbs = findJBossServer(server.getId());
if( jbs == null )
16 years
JBoss Tools SVN: r13076 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-01-15 23:52:20 -0500 (Thu, 15 Jan 2009)
New Revision: 13076
Modified:
trunk/i18n/build.xml
trunk/i18n/pom.xml
Log:
Renamed target "reall" to "quick". Changed several targets to avoid deleting files when "clean" is not called. Upgraded ant-gettext to a snapshot which skips pot2po when possible.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2009-01-15 21:00:15 UTC (rev 13075)
+++ trunk/i18n/build.xml 2009-01-16 04:52:20 UTC (rev 13076)
@@ -182,7 +182,6 @@
</target>
<target name="po2prop" depends="-init" description="Generate Java properties files from translated PO files">
- <delete dir="${propdir}" />
<mkdir dir="${propdir}" />
<po2prop srcDir="po" dstDir="${propdir}" failonnull="true">
<unbundlemapper />
@@ -247,7 +246,6 @@
<property name="FEATURE_VERSION" value="${PLUGIN_VERSION}"/>
<!-- Processes the generated props directory, one plugin at a time,
generating manifests and jars -->
- <delete dir="${jardir}/plugins" />
<mkdir dir="${jardir}/plugins" />
<!-- for each plugin directory -->
<for param="pluginsrcdir">
@@ -281,9 +279,7 @@
</for>
<!-- Generate langpack feature manifests (one per locale) for each JBT feature -->
- <delete dir="${propdir}/features" />
<mkdir dir="${propdir}/features" />
- <delete dir="${jardir}/features" />
<mkdir dir="${jardir}/features" />
<tempfile
property="temp.file.site.contents"
@@ -398,15 +394,12 @@
<param name="pluginversion" expression="${PLUGIN_VERSION}" />
</xslt>
- <copy overwrite="true"
- todir="${propdir}/features/${feature}.nl-${locale}_${PLUGIN_VERSION}">
+ <copy
+ todir="${propdir}/features/${feature}.nl-${locale}_${FEATURE_VERSION}">
<fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
</copy>
- <jar destfile="${jardir}/features/${feature}.nl-${locale}_${PLUGIN_VERSION}.jar"
- basedir="${propdir}/features/${feature}.nl-${locale}_${PLUGIN_VERSION}" />
- <!-- might want to keep around for debugging:
- <delete dir="${propdir}/features/${feature}.nl-${locale}_${PLUGIN_VERSION}" />
- -->
+ <jar destfile="${jardir}/features/${feature}.nl-${locale}_${FEATURE_VERSION}.jar"
+ basedir="${propdir}/features/${feature}.nl-${locale}_${FEATURE_VERSION}" />
</target>
<!-- Create a <category-def> for ${locale} to go into site.xml -->
@@ -428,9 +421,6 @@
</copy>
<jar destfile="${jardir}/features/org.jboss.tools.nls-${locale}_${PLUGIN_VERSION}.jar"
basedir="${propdir}/features/org.jboss.tools.nls-${locale}_${PLUGIN_VERSION}" />
- <!-- might want to keep around for debugging:
- <delete dir="${propdir}/features/org.jboss.tools.nls-${locale}_${PLUGIN_VERSION}" />
- -->
</target>
<target name="deletep2" description="Remove p2 metadata (revert to site.xml)">
@@ -501,19 +491,21 @@
</target>
<target name="po" depends="en, qps, en_AA" description="Generates po files for all pseudolocales">
- <!-- Instead of hard-coding locale ids, get them from i18n.properties and iterate -->
+ <!-- TODO Instead of hard-coding locale ids, get them from i18n.properties and iterate -->
</target>
<target name="most" depends="clean, prop2pot, po, po2prop, metadata"
description="Generates langpacks and metadata" />
- <target name="all" depends="clean, prop2pot, po, po2prop, metadata, p2"
+ <target name="-all" depends="prop2pot, po, po2prop, metadata, p2" />
+
+ <target name="all" depends="clean, -all"
description="Runs all targets in an appropriate order"/>
- <target name="reall"
- description="Runs all targets in an appropriate order, reusing previous buildnum">
+ <target name="quick"
+ description="Runs all targets except clean in an appropriate order, reusing previous buildnum">
<loadproperties srcfile="build.number" />
- <antcall target="all" />
+ <antcall target="-all" />
</target>
Modified: trunk/i18n/pom.xml
===================================================================
--- trunk/i18n/pom.xml 2009-01-15 21:00:15 UTC (rev 13075)
+++ trunk/i18n/pom.xml 2009-01-16 04:52:20 UTC (rev 13076)
@@ -27,7 +27,7 @@
<dependency>
<groupId>org.fedorahosted.tennera</groupId>
<artifactId>ant-gettext</artifactId>
- <version>0.4</version>
+ <version>0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
16 years
JBoss Tools SVN: r13075 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-01-15 16:00:15 -0500 (Thu, 15 Jan 2009)
New Revision: 13075
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
GPD-287: Unknown nodes, text (and whitespace) and comments are preserved.
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-01-15 19:55:17 UTC (rev 13074)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-01-15 21:00:15 UTC (rev 13075)
@@ -11,7 +11,6 @@
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
@@ -63,22 +62,24 @@
class ProcessChildNodeHandler implements ChildNodeHandler {
public Wrapper processChildNode(Wrapper parent, Node node) {
- if (!(parent instanceof FlowWrapper)) return null;
+ Wrapper result = null;
+ if (!(parent instanceof FlowWrapper)) return result;
FlowWrapper flowWrapper = (FlowWrapper)parent;
if (node instanceof Element) {
- Wrapper childWrapper = createWrapper((Element)node);
- if (childWrapper != null && childWrapper instanceof NodeWrapper) {
- flowWrapper.addElement((NodeWrapper)childWrapper);
+ result = createWrapper((Element)node);
+ if (result != null && result instanceof NodeWrapper) {
+ flowWrapper.addElement((NodeWrapper)result);
}
}
- return null;
+ return result;
}
}
class NodeChildNodeHandler implements ChildNodeHandler {
@SuppressWarnings("unchecked")
public Wrapper processChildNode(Wrapper parent, Node node) {
- if (!(parent instanceof NodeWrapper)) return null;
+ Wrapper result = null;
+ if (!(parent instanceof NodeWrapper)) return result;
NodeWrapper nodeWrapper = (NodeWrapper)parent;
ArrayList<ConnectionWrapper> flows = (ArrayList<ConnectionWrapper>)nodeWrapper.getElement().getMetaData("flows");
if (flows == null) {
@@ -86,12 +87,12 @@
nodeWrapper.getElement().setMetaData("flows", flows);
}
if (node instanceof Element) {
- Wrapper childWrapper = createWrapper((Element)node);
- if (childWrapper != null && childWrapper instanceof ConnectionWrapper) {
- flows.add((ConnectionWrapper)childWrapper);
+ result = createWrapper((Element)node);
+ if (result != null && result instanceof ConnectionWrapper) {
+ flows.add((ConnectionWrapper)result);
}
}
- return null;
+ return result;
}
}
@@ -127,8 +128,6 @@
try {
Document document = documentBuilderFactory.newDocumentBuilder().parse(is);
result = createWrapper(document.getDocumentElement());
-// Element element = document.getDocumentElement();
-// result = createFlowWrapper(element);
} catch (Exception e) {
Logger.logError("An error occurred while creating the diagram", e);
}
@@ -213,56 +212,6 @@
else return null;
}
- private Wrapper createFlowWrapper(Element element) {
- FlowWrapper result = null;
- if ("process".equals(element.getNodeName())) {
- result = createProcessWrapper(element);
- }
- return result;
- }
-
- private FlowWrapper createProcessWrapper(Element element) {
- FlowWrapper result = (FlowWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.process");
- if (result != null) {
- result.getElement().setMetaData("flows", new ArrayList<ConnectionWrapper>());
- addName(result, element);
- addNodes(result, element);
- resolveSequenceFlowTargets(result);
- result.getElement().setMetaData("flows", null);
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private void resolveSequenceFlowTargets(FlowWrapper flowWrapper) {
- ArrayList<ConnectionWrapper> flows = (ArrayList<ConnectionWrapper>)flowWrapper.getElement().getMetaData("flows");
- for (ConnectionWrapper flow : flows) {
- resolveSequenceFlowTarget(flow);
- }
- }
-
- private void resolveSequenceFlowTarget(ConnectionWrapper connectionWrapper) {
- String to = (String)connectionWrapper.getElement().getMetaData("to");
- if (to == null) {
- Logger.logInfo("Ignoring sequenceflow without target");
- return;
- }
- connectionWrapper.getElement().setMetaData("to", null);
- NodeWrapper source = (NodeWrapper)connectionWrapper.getElement().getMetaData("from");
- if (source == null) {
- Logger.logInfo("Ignoring sequenceflow without source");
- return;
- }
- connectionWrapper.getElement().setMetaData("from", null);
- FlowWrapper flowWrapper = source.getParent().getFlowWrapper();
- NodeWrapper target = getNamedNode(to, flowWrapper);
- if (target != null) {
- connectionWrapper.connect(source, target);
- } else {
- Logger.logInfo("Ignoring unknown target " + to + " while resolving sequenceflow target.");
- }
- }
-
private NodeWrapper getNamedNode(String name, FlowWrapper flowWrapper) {
if (name == null) return null;
for (NodeWrapper nodeWrapper : flowWrapper.getElements()) {
@@ -271,89 +220,6 @@
return null;
}
- private void addName(Wrapper wrapper, Element element) {
- String name = element.getAttribute("name");
- if (name == null) return;
- if (wrapper instanceof FlowWrapper) {
- ((Flow)((FlowWrapper)wrapper).getElement()).setName(name);
- } else if (wrapper instanceof NodeWrapper){
- ((NodeWrapper)wrapper).setName(name);
- }
- }
-
- private void addNodes(FlowWrapper wrapper, Element element) {
- NodeList nodeList = element.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- NodeWrapper result = null;
- if ("start".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.startEvent");
- } else if ("end".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.terminateEndEvent");
- } else if ("end-error".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.errorEndEvent");
- } else if ("end-cancel".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.cancelEndEvent");
- } else if ("state".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.waitTask");
- } else if ("hql".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.hqlTask");
- } else if ("sql".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.sqlTask");
- } else if ("java".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.javaTask");
- } else if ("script".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.scriptTask");
- } else if ("esb".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.serviceTask");
- } else if ("task".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.humanTask");
- } else if ("exclusive".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.exclusiveGateway");
- } else if ("join".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.parallelJoinGateway");
- } else if ("fork".equals(child.getNodeName())) {
- result = (NodeWrapper)ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.parallelForkGateway");
- }
- if (result != null) {
- wrapper.addElement(result);
- addName(result, (Element)child);
- addGraphics(result, (Element)child);
- addSequenceFlow(result, (Element)child);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void addSequenceFlow(NodeWrapper wrapper, Element element) {
- NodeList nodeList = element.getElementsByTagName("flow");
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- ConnectionWrapper result =
- createConnectionWrapper((Element)child, "org.jboss.tools.flow.jpdl4.sequenceFlow");
- if (result != null) {
- result.getElement().setMetaData("from", wrapper);
- String to = ((Element)child).getAttribute("to");
- result.getElement().setMetaData("to", to);
- ContainerWrapper parent = wrapper.getParent();
- FlowWrapper flowWrapper = parent.getFlowWrapper();
- ArrayList<ConnectionWrapper> flows =
- (ArrayList<ConnectionWrapper>)flowWrapper.getElement().getMetaData("flows");
- flows.add(result);
- }
- }
- }
-
-
- private ConnectionWrapper createConnectionWrapper(Element element, String elementType) {
- ConnectionWrapper result = (ConnectionWrapper)ElementRegistry.createWrapper(elementType);
- if (result != null) {
- addName(result, element);
- addGraphics(result, element);
- }
- return result;
- }
-
private void addGraphics(ConnectionWrapper wrapper, Element element) {
String graphics = element.getAttribute("g");
if (graphics != null) {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-01-15 19:55:17 UTC (rev 13074)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-01-15 21:00:15 UTC (rev 13075)
@@ -3,9 +3,20 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+import java.io.StringWriter;
import java.io.Writer;
+import java.util.ArrayList;
import java.util.List;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.flow.common.model.Element;
@@ -13,6 +24,7 @@
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.Logger;
import org.jboss.tools.flow.jpdl4.model.CancelEndEvent;
import org.jboss.tools.flow.jpdl4.model.ErrorEndEvent;
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
@@ -30,9 +42,22 @@
import org.jboss.tools.flow.jpdl4.model.SuperState;
import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
import org.jboss.tools.flow.jpdl4.model.WaitTask;
+import org.w3c.dom.Node;
public class JpdlSerializer {
-
+
+ private static TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ private static Transformer transformer = null;
+
+ static {
+ try {
+ transformer = transformerFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ Logger.logError("Error while creating XML tranformer.", e);
+ }
+ }
+
public void serialize(Wrapper wrapper, OutputStream os) throws IOException {
StringBuffer buffer = new StringBuffer();
appendToBuffer(buffer, wrapper, 0);
@@ -56,12 +81,41 @@
}
}
- private void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+
+
+ private void appendNodeList(StringBuffer buffer, ArrayList<Node> nodeList) {
+ if (transformer == null) {
+ Logger.logInfo("Skipping append nodes as transformer is not initialized.");
+ return;
+ }
+ DOMSource domSource = new DOMSource();
+ for (Node node : nodeList) {
+ StringWriter writer = new StringWriter();
+ domSource.setNode(node);
+ Result result = new StreamResult(writer);
+ try {
+ transformer.transform(domSource, result);
+ } catch (TransformerException e) {
+ Logger.logError("Exception while transforming xml.", e);
+ }
+ buffer.append(writer.getBuffer());
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
+ ArrayList<Node> leadingNodeList = (ArrayList<Node>)element.getMetaData("leadingNodes");
+ boolean appendLeadingNodes = leadingNodeList != null && !leadingNodeList.isEmpty();
+ if (appendLeadingNodes) {
+ appendNodeList(buffer, leadingNodeList);
+ }
if (element instanceof SequenceFlow) {
SequenceFlow transition = (SequenceFlow)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<flow");
if (transition.getTo() != null) {
buffer.append(" ");
@@ -72,8 +126,10 @@
appendConnectionGraphics(buffer, (ConnectionWrapper)wrapper);
} else if (element instanceof TerminateEndEvent) {
TerminateEndEvent terminateEndEvent = (TerminateEndEvent)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<end");
if (!isEmpty(terminateEndEvent.getName())) {
buffer.append(" ");
@@ -83,8 +139,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ErrorEndEvent) {
ErrorEndEvent errorEndEvent = (ErrorEndEvent)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<end-error");
if (!isEmpty(errorEndEvent.getName())) {
buffer.append(" ");
@@ -94,8 +152,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof CancelEndEvent) {
CancelEndEvent cancelEndEvent = (CancelEndEvent)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<end-cancel");
if (!isEmpty(cancelEndEvent.getName())) {
buffer.append(" ");
@@ -105,8 +165,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof StartEvent) {
StartEvent startEvent = (StartEvent)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<start");
if (!isEmpty(startEvent.getName())) {
buffer.append(" ");
@@ -116,8 +178,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof SuperState) {
SuperState superState = (SuperState)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<super-state");
if (!isEmpty(superState.getName())) {
buffer.append(" ");
@@ -126,8 +190,10 @@
}
} else if (element instanceof WaitTask) {
WaitTask waitTask = (WaitTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<state");
if (!isEmpty(waitTask.getName())) {
buffer.append(" ");
@@ -137,8 +203,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof HqlTask) {
HqlTask hqlTask = (HqlTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<hql");
if (!isEmpty(hqlTask.getName())) {
buffer.append(" ");
@@ -148,8 +216,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof SqlTask) {
SqlTask sqlTask = (SqlTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<sql");
if (!isEmpty(sqlTask.getName())) {
buffer.append(" ");
@@ -159,8 +229,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof JavaTask) {
JavaTask javaTask = (JavaTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<java");
if (!isEmpty(javaTask.getName())) {
buffer.append(" ");
@@ -170,8 +242,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ScriptTask) {
ScriptTask scriptTask = (ScriptTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<script");
if (!isEmpty(scriptTask.getName())) {
buffer.append(" ");
@@ -181,8 +255,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ServiceTask) {
ServiceTask serviceTask = (ServiceTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<esb");
if (!isEmpty(serviceTask.getName())) {
buffer.append(" ");
@@ -192,8 +268,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof HumanTask) {
HumanTask humanTask = (HumanTask)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<task");
if (!isEmpty(humanTask.getName())) {
buffer.append(" ");
@@ -203,8 +281,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ExclusiveGateway) {
ExclusiveGateway exclusiveGateway = (ExclusiveGateway)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<exclusive");
if (!isEmpty(exclusiveGateway.getName())) {
buffer.append(" ");
@@ -214,8 +294,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ForkParallelGateway) {
ForkParallelGateway parallelForkGateway = (ForkParallelGateway)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<fork");
if (!isEmpty(parallelForkGateway.getName())) {
buffer.append(" ");
@@ -225,8 +307,10 @@
appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof JoinParallelGateway) {
JoinParallelGateway parallelJoinGateway = (JoinParallelGateway)element;
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendLeadingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("<join");
if (!isEmpty(parallelJoinGateway.getName())) {
buffer.append(" ");
@@ -264,75 +348,115 @@
}
}
- private void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
+ @SuppressWarnings("unchecked")
+ private void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
+ ArrayList<Node> trailingNodeList = (ArrayList<Node>)element.getMetaData("trailingNodes");
+ boolean appendTrailingNodes = trailingNodeList != null && !trailingNodeList.isEmpty();
+ if (appendTrailingNodes) {
+ appendNodeList(buffer, trailingNodeList);
+ }
if (element instanceof SequenceFlow) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</flow>");
} else if (element instanceof TerminateEndEvent) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</end>");
} else if (element instanceof ErrorEndEvent) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</end-error>");
} else if (element instanceof CancelEndEvent) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</end-cancel>");
} else if (element instanceof StartEvent) {
- buffer.append("\n");
- appendPadding(buffer, level);
- buffer.append("</start>");
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
+ buffer.append("</start>");
} else if (element instanceof SuperState) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</super-state>");
} else if (element instanceof WaitTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</state>");
} else if (element instanceof HqlTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</hql>");
} else if (element instanceof SqlTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</sql>");
} else if (element instanceof JavaTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</java>");
} else if (element instanceof ScriptTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</script>");
} else if (element instanceof ServiceTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</esb>");
} else if (element instanceof HumanTask) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</task>");
} else if (element instanceof ExclusiveGateway) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</exclusive>");
} else if (element instanceof ForkParallelGateway) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</fork>");
} else if (element instanceof JoinParallelGateway) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</join>");
} else if (element instanceof Process) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ if (!appendTrailingNodes) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
buffer.append("</process>");
}
}
16 years
JBoss Tools SVN: r13074 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-01-15 14:55:17 -0500 (Thu, 15 Jan 2009)
New Revision: 13074
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
Log:
JBIDE-3034 - do not show Hibernate/JPA menu item in the case of active XML editor
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-01-15 19:50:10 UTC (rev 13073)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-01-15 19:55:17 UTC (rev 13074)
@@ -71,15 +71,16 @@
</not>
</visibleWhen>
</command>
- </menuContribution>
- <menuContribution locationURI="menu:sourceMenuId?after=additions">
+ </menuContribution>
+ <!-- next section will show Hibernate/JPA menu item in case of active XML editor -->
+ <!--<menuContribution locationURI="menu:sourceMenuId?after=additions">
<command commandId="org.hibernate.eclipse.jdt.ui.run_jpaaction"
id="org.hibernate.eclipse.jdt.ui.run_jpaaction1" style="push">
<visibleWhen checkEnabled="false">
<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
</visibleWhen>
</command>
- </menuContribution>
+ </menuContribution>-->
</extension>
<extension point="org.eclipse.ui.popupMenus">
<!-- java editor context menu -->
16 years
JBoss Tools SVN: r13073 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui: src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-01-15 14:50:10 -0500 (Thu, 15 Jan 2009)
New Revision: 13073
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
Log:
JBIDE-3034
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-01-15 19:14:47 UTC (rev 13072)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-01-15 19:50:10 UTC (rev 13073)
@@ -38,27 +38,49 @@
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
</extension>
- <!--extension point="org.eclipse.ui.actionSets">
- <actionSet label="Java Coding" description="Action set containing coding related Java actions"
- visible="true" id="org.eclipse.jdt.ui.CodingActionSet3">
- <menu label="&Source" path="edit" id="org.eclipse.jdt.ui.source.menu">
- <separator name="commentGroup"/>
- <separator name="editGroup"/>
- <separator name="importGroup"/>
- <separator name="generateGroup"/>
- <separator name="codeGroup"/>
- <separator name="externalizeGroup"/>
- <separator name="convertGroup"/>
- </menu>
- <action
- class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionPulldownDelegate"
- id="org.hibernate.eclipse.jdt.ui.run_jpaaction"
- label="Generate &Hibernate/JPA annotations..."
- menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
- style="push">
- </action>
- </actionSet>
- </extension-->
+ <extension point="org.eclipse.ui.commands">
+ <category id="org.hibernate.eclipse.jdt.ui.run_jpaaction.category1"
+ name="Generate Hibernate/JPA annotations">
+ </category>
+ <command categoryId="org.hibernate.eclipse.jdt.ui.run_jpaaction.category1"
+ defaultHandler="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionDelegate"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction"
+ name="Generate &Hibernate/JPA annotations...">
+ </command>
+ </extension>
+ <extension point="org.eclipse.ui.menus">
+ <menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=edit">
+ <menu id="org.eclipse.jdt.ui.source.menu" label="&Source">
+ </menu>
+ </menuContribution>
+ <menuContribution locationURI="menu:org.eclipse.jdt.ui.source.menu">
+ <separator name="commentGroup" visible="true"/>
+ <separator name="editGroup" visible="true"/>
+ <separator name="importGroup" visible="true"/>
+ <separator name="generateGroup" visible="true"/>
+ <separator name="codeGroup" visible="true"/>
+ <separator name="externalizeGroup" visible="true"/>
+ <separator name="convertGroup" visible="true"/>
+ </menuContribution>
+ <menuContribution locationURI="menu:org.eclipse.jdt.ui.source.menu?after=generateGroup">
+ <command commandId="org.hibernate.eclipse.jdt.ui.run_jpaaction"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction" style="push">
+ <visibleWhen checkEnabled="false">
+ <not>
+ <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
+ </not>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution locationURI="menu:sourceMenuId?after=additions">
+ <command commandId="org.hibernate.eclipse.jdt.ui.run_jpaaction"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction1" style="push">
+ <visibleWhen checkEnabled="false">
+ <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
<extension point="org.eclipse.ui.popupMenus">
<!-- java editor context menu -->
<viewerContribution
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-01-15 19:14:47 UTC (rev 13072)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-01-15 19:50:10 UTC (rev 13073)
@@ -10,10 +10,10 @@
******************************************************************************/
package org.hibernate.eclipse.jdt.ui.internal.jpa.actions;
+import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorActionDelegate;
@@ -21,15 +21,18 @@
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
+import org.hibernate.eclipse.jdt.ui.Activator;
/**
* Main menu action delegate for "Generate Hibernate/JPA annotations..."
*
* @author Vitali
*/
-public class JPAMapToolActionDelegate implements IObjectActionDelegate,
- IEditorActionDelegate, IViewActionDelegate, IHandler {
+public class JPAMapToolActionDelegate extends AbstractHandler implements IObjectActionDelegate,
+ IEditorActionDelegate, IViewActionDelegate {
public JPAMapToolActor actor = JPAMapToolActor.getInstance();
@@ -54,30 +57,29 @@
}
}
- public void addHandlerListener(IHandlerListener handlerListener) {
- }
-
- public void dispose() {
- }
-
public Object execute(ExecutionEvent event) throws ExecutionException {
actor.updateSelected();
//actor.updateOpen();
return null;
}
- public boolean isEnabled() {
- return (actor.getSelectedSourceSize() > 0);
+ public void init(IViewPart view) {
+ view = null;
}
-
- public boolean isHandled() {
- return true;
+ public boolean isCUSelected() {
+ IWorkbench workbench = Activator.getDefault().getWorkbench();
+ IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editor = page.getActiveEditor();
+ if (editor instanceof CompilationUnitEditor) {
+ return true;
+ }
+ return false;
}
- public void removeHandlerListener(IHandlerListener handlerListener) {
+ public void setEnabled(Object evaluationContext) {
+ boolean enable = isCUSelected();
+ actor.setSelection(null);
+ actor.clearSelectionCU();
+ setBaseEnabled(enable);
}
-
- public void init(IViewPart view) {
- view = null;
- }
}
16 years
JBoss Tools SVN: r13072 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-01-15 14:14:47 -0500 (Thu, 15 Jan 2009)
New Revision: 13072
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
Log:
JBIDE-3559 Hibernate views labels are incorrect
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2009-01-15 16:40:08 UTC (rev 13071)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2009-01-15 19:14:47 UTC (rev 13072)
@@ -5,7 +5,8 @@
org.hibernate.eclipse.console.jar,\
doc/,\
META-INF/,\
- about.html
+ about.html,\
+ plugin.properties
src.includes = src/,\
icons/,\
doc/
16 years
JBoss Tools SVN: r13071 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-01-15 11:40:08 -0500 (Thu, 15 Jan 2009)
New Revision: 13071
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3542
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-01-15 16:17:52 UTC (rev 13070)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-01-15 16:40:08 UTC (rev 13071)
@@ -72,7 +72,9 @@
}
formatProcessorCSS = new FormatProcessorCSS();
IModelManager modelManager = StructuredModelManager.getModelManager();
- model = modelManager.getModelForEdit(styleFile);
+ model = modelManager.getExistingModelForEdit(styleFile);
+ if (model == null)
+ model = modelManager.getModelForEdit(styleFile);
if (model instanceof ICSSModel) {
ICSSModel cssModel = (ICSSModel) model;
ICSSDocument document = cssModel.getDocument();
@@ -291,6 +293,8 @@
* Release CSS model correctly from editing.
*/
public void releaseModel() {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ if(!modelManager.isShared(model.getId()))
model.releaseFromEdit();
}
16 years
JBoss Tools SVN: r13070 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-01-15 11:17:52 -0500 (Thu, 15 Jan 2009)
New Revision: 13070
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java
Log:
JBIDE-3566
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java 2009-01-15 16:15:38 UTC (rev 13069)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java 2009-01-15 16:17:52 UTC (rev 13070)
@@ -22,6 +22,7 @@
import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
import org.jboss.tools.common.model.XModelBuffer;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.ActionDeclinedException;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -50,7 +51,7 @@
DnDUtil.paste(targetObject, p);
} catch (ActionDeclinedException de) {
return null;
- } catch (Exception e) {
+ } catch (XModelException e) {
ProblemReportingHelper.reportProblem(ModelUIPlugin.PLUGIN_ID, e);
}
}
16 years
JBoss Tools SVN: r13069 - trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-01-15 11:15:38 -0500 (Thu, 15 Jan 2009)
New Revision: 13069
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java
Log:
JBIDE-3566
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java 2009-01-15 16:14:15 UTC (rev 13068)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java 2009-01-15 16:15:38 UTC (rev 13069)
@@ -30,6 +30,7 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.ActionDeclinedException;
import org.jboss.tools.common.model.project.IModelNature;
16 years