JBoss Tools SVN: r32292 - in branches/jbosstools-3.3.0.M2/ws/plugins: org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-06-22 17:41:13 -0400 (Wed, 22 Jun 2011)
New Revision: 32292
Modified:
branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/utils/JdtUtils.java
branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java
Log:
applied patches for JBIDE-9230 and JBIDE-9220 avoiding freezeson enablement of JAX-RS and NPE for codeassist
Modified: branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/utils/JdtUtils.java
===================================================================
--- branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/utils/JdtUtils.java 2011-06-22 20:57:04 UTC (rev 32291)
+++ branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/utils/JdtUtils.java 2011-06-22 21:41:13 UTC (rev 32292)
@@ -252,12 +252,15 @@
* the progress monitor
* @return compilationUnit the DOM CompilationUnit returned by the parse()
* method. This operation is expensive and should be performed only
- * once for each type.
+ * once for each type. Returns null if the given member was null.
* @throws JavaModelException
* in case of exception underneath...
*/
public static CompilationUnit parse(final IMember member, final IProgressMonitor progressMonitor)
throws JavaModelException {
+ if (member == null) {
+ return null;
+ }
IType type = null;
if (member.getElementType() == IMember.TYPE) {
type = (IType) member;
Modified: branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
===================================================================
--- branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2011-06-22 20:57:04 UTC (rev 32291)
+++ branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2011-06-22 21:41:13 UTC (rev 32292)
@@ -53,33 +53,11 @@
if (!uriPathTemplateCategories.containsKey(project)) {
Metamodel metamodel = Metamodel.get(project);
if (metamodel == null) {
- // trigger background build and immediately return a
- // temporary element to the UI
- Job[] jobs = Job.getJobManager().find(null);
- if (jobs != null) {
- for (Job job : jobs) {
- if (job.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD)
- || job.belongsTo(ResourcesPlugin.FAMILY_AUTO_REFRESH)
- || job.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD)
- || job.belongsTo(ResourcesPlugin.FAMILY_MANUAL_REFRESH)
- && job.getState() == Job.RUNNING) {
- // joining running job
- Logger.debug("Joining Running job: " + job.getName() + "(blocking="
- + job.isBlocking() + "/state=" + job.getState() + ")");
- job.join();
- Logger.debug("Job finished: " + job.getName());
- }
- }
- }
- // after running job is done, check if the metamodel
- // was
- // built, otherwise, force it.
- metamodel = Metamodel.get(project);
- if (metamodel == null) {
- Logger.debug("Metamodel is (still) null for project '" + project.getName() + "'");
- CoreUtility.startBuildInBackground(project);
- return new Object[] { new WaitWhileBuildingElement() };
- }
+ Logger.debug("Metamodel needs to be built for project '" + project.getName() + "'");
+ Job buildJob = CoreUtility.getBuildJob(project);
+ buildJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ buildJob.schedule();
+ return new Object[] { new WaitWhileBuildingElement() };
}
UriPathTemplateCategory uriPathTemplateCategory = new UriPathTemplateCategory(this, metamodel,
project);
@@ -88,10 +66,6 @@
return new Object[] { uriPathTemplateCategories.get(project) };
} catch (CoreException e) {
Logger.error("Failed to retrieve JAX-RS Metamodel in project '" + project.getName() + "'", e);
- } catch (InterruptedException e) {
- Logger.error(
- "Failed to join currently running job while building or retrieving metamodel for project '"
- + project.getName() + "'", e);
} finally {
long endTime = new Date().getTime();
Logger.debug("JAX-RS Metamodel UI for project '" + project.getName() + "' refreshed in "
Modified: branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java
===================================================================
--- branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java 2011-06-22 20:57:04 UTC (rev 32291)
+++ branches/jbosstools-3.3.0.M2/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/PathParamAnnotationValueCompletionProposalComputer.java 2011-06-22 21:41:13 UTC (rev 32292)
@@ -21,6 +21,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
@@ -40,6 +41,7 @@
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.ws.jaxrs.core.configuration.ProjectNatureUtils;
import org.jboss.tools.ws.jaxrs.core.utils.JdtUtils;
import org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin;
import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
@@ -78,7 +80,16 @@
final IProgressMonitor monitor) {
JavaContentAssistInvocationContext javaContext = (JavaContentAssistInvocationContext) context;
try {
+
+ IJavaProject project = javaContext.getProject();
+ // skip if the JAX-RS Nature is not configured for this project
+ if (!ProjectNatureUtils.isProjectNatureInstalled(project.getProject(), ProjectNatureUtils.JAXRS_NATURE_ID)) {
+ return Collections.emptyList();
+ }
CompilationUnit compilationUnit = resolveContextualCompilationUnit(monitor, javaContext);
+ if (compilationUnit == null) {
+ return Collections.emptyList();
+ }
IJavaElement invocationElement = javaContext.getCompilationUnit().getElementAt(
context.getInvocationOffset());
if (invocationElement.getElementType() == IJavaElement.METHOD) {
@@ -222,6 +233,11 @@
* in case of underlying exception
*/
private IType getEnclosingType(final IJavaElement element) throws JavaModelException {
+ if (element == null) {
+ // no enclosing parent. For example, an annotation is set before the
+ // method itself was written.
+ return null;
+ }
switch (element.getElementType()) {
case IJavaElement.TYPE:
return (IType) element;
14 years, 9 months
JBoss Tools SVN: r32291 - in branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer: src/org/eclipse/swt/browser and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-06-22 16:57:04 -0400 (Wed, 22 Jun 2011)
New Revision: 32291
Added:
branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/WebKitInitializer.java
Modified:
branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF
Log:
JBIDE-9144 VPE crashes with Eclipse 3.7 on some Linux distributions
Modified: branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF 2011-06-22 20:13:33 UTC (rev 32290)
+++ branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF 2011-06-22 20:57:04 UTC (rev 32291)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %BundleName
-Bundle-SymbolicName: org.jboss.tools.xulrunner.initializer
+Bundle-SymbolicName: org.jboss.tools.xulrunner.initializer;singleton:=true
Bundle-Version: 3.1.0.qualifier
Bundle-Vendor: %BundleVendor
Fragment-Host: org.eclipse.swt
Added: branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/WebKitInitializer.java
===================================================================
--- branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/WebKitInitializer.java (rev 0)
+++ branches/jbosstools-3.3.0.M2/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/WebKitInitializer.java 2011-06-22 20:57:04 UTC (rev 32291)
@@ -0,0 +1,15 @@
+package org.eclipse.swt.browser;
+
+
+public class WebKitInitializer {
+
+ private static final String USE_WEB_KIT_GTK = "org.eclipse.swt.browser.UseWebKitGTK"; //$NON-NLS-1$
+
+ static {
+ String useWebKitGTK = System.getProperty(USE_WEB_KIT_GTK);
+ if (useWebKitGTK == null) {
+ System.setProperty(USE_WEB_KIT_GTK, "false"); //$NON-NLS-1$
+ }
+ }
+
+}
14 years, 9 months
JBoss Tools SVN: r32290 - branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-22 16:13:33 -0400 (Wed, 22 Jun 2011)
New Revision: 32290
Modified:
branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/GraphicalViewer.java
Log:
JBIDE-9081
Modified: branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/GraphicalViewer.java
===================================================================
--- branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/GraphicalViewer.java 2011-06-22 13:37:30 UTC (rev 32289)
+++ branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/GraphicalViewer.java 2011-06-22 20:13:33 UTC (rev 32290)
@@ -29,11 +29,8 @@
import org.eclipse.gef.ui.actions.ToggleGridAction;
import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.jbpm.gd.jpdl.Constants;
@@ -82,7 +79,7 @@
protected void fireSelectionChanged() {
super.fireSelectionChanged();
- if (getSelection() != null) {
+ if (getSelection() != null && editor.getPropertySheetPage().getControl() != null) {
editor.getPropertySheetPage().selectionChanged(editor, getSelection());
}
}
14 years, 9 months
JBoss Tools SVN: r32289 - in trunk/as/plugins: org.jboss.ide.eclipse.as.management.as7/META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-22 09:37:30 -0400 (Wed, 22 Jun 2011)
New Revision: 32289
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
Log:
[JBIDE-9173] added new controller-client jars, fixed issue with new client that was now reporting server state in small letters (was: big letters)
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java 2011-06-22 13:37:30 UTC (rev 32289)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.osgi.util.NLS;
+
+public class CoreServerAS7Messages extends NLS {
+ public static String JBoss7ServerState_noEnumForString;
+
+ static {
+ NLS.initializeMessages("org.jboss.ide.eclipse.as.core.server.internal.v7.CoreServerAS7Messages", //$NON-NLS-1$
+ CoreServerAS7Messages.class);
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties 2011-06-22 13:37:30 UTC (rev 32289)
@@ -0,0 +1 @@
+JBoss7ServerState_noEnumForString="No JBoss7ServerState enum for string {0}"
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java 2011-06-22 13:35:37 UTC (rev 32288)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java 2011-06-22 13:37:30 UTC (rev 32289)
@@ -10,9 +10,30 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
+import java.text.MessageFormat;
+
/**
* @author André Dietisheim
*/
public enum JBoss7ServerState {
- STARTING, RUNNING, RESTART_REQUIRED;
+ STARTING, RUNNING, RESTART_REQUIRED;
+
+ public static JBoss7ServerState valueOfIgnoreCase(String stateString) {
+ JBoss7ServerState matchingState = null;
+ if (stateString != null && stateString.length() > 0) {
+ for (JBoss7ServerState availableState : values()) {
+ if (stateString.equalsIgnoreCase(availableState.name())) {
+ matchingState = availableState;
+ break;
+ }
+ }
+ }
+ if (matchingState == null) {
+ throw new IllegalArgumentException(MessageFormat.format(
+ CoreServerAS7Messages.JBoss7ServerState_noEnumForString,
+ stateString));
+ }
+
+ return matchingState;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-06-22 13:35:37 UTC (rev 32288)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-06-22 13:37:30 UTC (rev 32289)
@@ -8,13 +8,16 @@
org.jboss.ide.eclipse.as.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,
+Bundle-ClassPath: .,
+ jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,
jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar,
- jboss-dmr-1.0.0.Beta5.jar,
- jboss-logging-3.0.0.Beta3.jar,
+ jboss-dmr-1.0.0.Beta6.jar,
+ jboss-logging-3.0.0.Beta5.jar,
jboss-marshalling-1.3.0.CR8.jar,
+ jboss-remoting-3.2.0.Beta1.jar,
jboss-threads-2.0.0.CR8.jar,
- .
+ xnio-api-3.0.0.Beta2.jar,
+ xnio-nio-3.0.0.Beta2.jar
Service-Component: META-INF/jboss-management-service.xml
Export-Package: org.jboss.ide.eclipse.as.management.as7.deployment;x-friends:="org.jboss.ide.eclipse.as.management.as7.tests"
Bundle-Vendor: JBoss by Red Hat
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-06-22 13:35:37 UTC (rev 32288)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-06-22 13:37:30 UTC (rev 32289)
@@ -36,7 +36,7 @@
import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
-import org.jboss.as.protocol.StreamUtils;
+import org.jboss.as.protocol.old.StreamUtils;
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
14 years, 9 months
JBoss Tools SVN: r32288 - in branches/jbosstools-3.3.0.M2/as/plugins: org.jboss.ide.eclipse.as.management.as7 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-22 09:35:37 -0400 (Wed, 22 Jun 2011)
New Revision: 32288
Added:
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-dmr-1.0.0.Beta6.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-logging-3.0.0.Beta5.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-remoting-3.2.0.Beta1.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-api-3.0.0.Beta2.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-nio-3.0.0.Beta2.jar
Removed:
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-dmr-1.0.0.Beta5.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-logging-3.0.0.Beta3.jar
Modified:
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/.classpath
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/build.properties
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.properties
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
Log:
[JBIDE-9173] added new controller-client jars, fixed issue with new client that was now reporting server state in small letters (was: big letters)
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java (rev 0)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java 2011-06-22 13:35:37 UTC (rev 32288)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.osgi.util.NLS;
+
+public class CoreServerAS7Messages extends NLS {
+ public static String JBoss7ServerState_noEnumForString;
+
+ static {
+ NLS.initializeMessages("org.jboss.ide.eclipse.as.core.server.internal.v7.CoreServerAS7Messages", //$NON-NLS-1$
+ CoreServerAS7Messages.class);
+ }
+
+}
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties (rev 0)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties 2011-06-22 13:35:37 UTC (rev 32288)
@@ -0,0 +1 @@
+JBoss7ServerState_noEnumForString="No JBoss7ServerState enum for string {0}"
\ No newline at end of file
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/CoreServerAS7Messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerState.java 2011-06-22 13:35:37 UTC (rev 32288)
@@ -10,9 +10,30 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
+import java.text.MessageFormat;
+
/**
* @author André Dietisheim
*/
public enum JBoss7ServerState {
- STARTING, RUNNING, RESTART_REQUIRED;
+ STARTING, RUNNING, RESTART_REQUIRED;
+
+ public static JBoss7ServerState valueOfIgnoreCase(String stateString) {
+ JBoss7ServerState matchingState = null;
+ if (stateString != null && stateString.length() > 0) {
+ for (JBoss7ServerState availableState : values()) {
+ if (stateString.equalsIgnoreCase(availableState.name())) {
+ matchingState = availableState;
+ break;
+ }
+ }
+ }
+ if (matchingState == null) {
+ throw new IllegalArgumentException(MessageFormat.format(
+ CoreServerAS7Messages.JBoss7ServerState_noEnumForString,
+ stateString));
+ }
+
+ return matchingState;
+ }
}
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/.classpath
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/.classpath 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/.classpath 2011-06-22 13:35:37 UTC (rev 32288)
@@ -2,10 +2,13 @@
<classpath>
<classpathentry exported="true" kind="lib" path="jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta5.jar" sourcepath="/home/adietish/jboss-workspaces/jboss-tools/jbosstools-src/jboss-dmr-1.0.0.Beta5-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-logging-3.0.0.Beta3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta6.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-logging-3.0.0.Beta5.jar"/>
<classpathentry exported="true" kind="lib" path="jboss-marshalling-1.3.0.CR8.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-threads-2.0.0.CR8.jar" sourcepath="/home/adietish/jboss-workspaces/jboss-tools/jbosstools-src/jboss-threads-2.0.0.CR8-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-remoting-3.2.0.Beta1.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-threads-2.0.0.CR8.jar"/>
+ <classpathentry exported="true" kind="lib" path="xnio-api-3.0.0.Beta2.jar"/>
+ <classpathentry exported="true" kind="lib" path="xnio-nio-3.0.0.Beta2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-06-22 13:35:37 UTC (rev 32288)
@@ -8,13 +8,16 @@
org.jboss.ide.eclipse.as.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,
+Bundle-ClassPath: .,
+ jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,
jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar,
- jboss-dmr-1.0.0.Beta5.jar,
- jboss-logging-3.0.0.Beta3.jar,
+ jboss-dmr-1.0.0.Beta6.jar,
+ jboss-logging-3.0.0.Beta5.jar,
jboss-marshalling-1.3.0.CR8.jar,
+ jboss-remoting-3.2.0.Beta1.jar,
jboss-threads-2.0.0.CR8.jar,
- .
+ xnio-api-3.0.0.Beta2.jar,
+ xnio-nio-3.0.0.Beta2.jar
Service-Component: META-INF/jboss-management-service.xml
Export-Package: org.jboss.ide.eclipse.as.management.as7.deployment;x-friends:="org.jboss.ide.eclipse.as.management.as7.tests"
Bundle-Vendor: JBoss by Red Hat
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/build.properties
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/build.properties 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/build.properties 2011-06-22 13:35:37 UTC (rev 32288)
@@ -7,9 +7,12 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- jboss-dmr-1.0.0.Beta5.jar,\
- jboss-logging-3.0.0.Beta3.jar,\
+ jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,\
+ jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar,\
+ jboss-dmr-1.0.0.Beta6.jar,\
+ jboss-logging-3.0.0.Beta5.jar,\
jboss-marshalling-1.3.0.CR8.jar,\
+ jboss-remoting-3.2.0.Beta1.jar,\
jboss-threads-2.0.0.CR8.jar,\
- jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar,\
- jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar
+ xnio-api-3.0.0.Beta2.jar,\
+ xnio-nio-3.0.0.Beta2.jar
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-as-controller-client-7.0.0.Beta4-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-as-protocol-7.0.0.Beta4-SNAPSHOT.jar
===================================================================
(Binary files differ)
Deleted: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-dmr-1.0.0.Beta5.jar
===================================================================
(Binary files differ)
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-dmr-1.0.0.Beta6.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-dmr-1.0.0.Beta6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-logging-3.0.0.Beta3.jar
===================================================================
(Binary files differ)
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-logging-3.0.0.Beta5.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-logging-3.0.0.Beta5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-remoting-3.2.0.Beta1.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/jboss-remoting-3.2.0.Beta1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.java 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.java 2011-06-22 13:35:37 UTC (rev 32288)
@@ -21,6 +21,8 @@
public static String OperationOnUnitFailed;
public static String OperationOnUnitRolledBack;
public static String OperationNotExecConfigRequiresRestart;
+ public static String JBoss7ServerState_noEnumForString;
+
static {
NLS.initializeMessages("org.jboss.ide.eclipse.as.management.as7.AS7Messages", //$NON-NLS-1$
AS7Messages.class);
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.properties
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.properties 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/AS7Messages.properties 2011-06-22 13:35:37 UTC (rev 32288)
@@ -5,4 +5,5 @@
OperationOnUnitNotExecuted=The operation {0} was not executed on unit {1}
OperationOnUnitFailed=The operation {0} failed for unit {1}
OperationOnUnitRolledBack=The operation {0} for unit {1} was rolled back
-OperationNotExecConfigRequiresRestart=The operation {0} was not executed on unit {1}. The server configuration was changed though and the server needs to be restarted.
\ No newline at end of file
+OperationNotExecConfigRequiresRestart=The operation {0} was not executed on unit {1}. The server configuration was changed though and the server needs to be restarted.
+JBoss7ServerState_noEnumForString="No JBoss7ServerState enum for string {0}"
\ No newline at end of file
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-06-22 13:19:52 UTC (rev 32287)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-06-22 13:35:37 UTC (rev 32288)
@@ -36,7 +36,7 @@
import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
-import org.jboss.as.protocol.StreamUtils;
+import org.jboss.as.protocol.old.StreamUtils;
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
@@ -167,7 +167,7 @@
private JBoss7ServerState toJBoss7ServerState(ModelNode response) throws JBoss7ManangerException {
try {
- return JBoss7ServerState.valueOf(response.asString());
+ return JBoss7ServerState.valueOfIgnoreCase(response.asString());
} catch (IllegalArgumentException e) {
throw new JBoss7ManangerException(e);
}
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-api-3.0.0.Beta2.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-api-3.0.0.Beta2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-nio-3.0.0.Beta2.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/xnio-nio-3.0.0.Beta2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 9 months
JBoss Tools SVN: r32287 - in branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: graphical/editors/editparts/freemarker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2011-06-22 09:19:52 -0400 (Wed, 22 Jun 2011)
New Revision: 32287
Added:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java
Modified:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java
Log:
JBIDE-7309: Testing a direct-to-source mapping errors out
https://issues.jboss.org/browse/JBIDE-7309
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2011-06-22 12:59:49 UTC (rev 32286)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2011-06-22 13:19:52 UTC (rev 32287)
@@ -9,6 +9,7 @@
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TriggerConnection;
import org.jboss.tools.smooks.gef.tree.model.ValueBindingConnection;
+import org.jboss.tools.smooks.graphical.editors.editparts.freemarker.FreemarkerRemoveConnectionsExecutor;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateConnection;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerXMLNodeGraphicalModel;
@@ -21,6 +22,7 @@
*/
public class CreateConnectionCommand extends Command {
+ private FreemarkerRemoveConnectionsExecutor removeExecutor = new FreemarkerRemoveConnectionsExecutor();
private AbstractSmooksGraphicalModel source;
private AbstractSmooksGraphicalModel target;
@@ -55,23 +57,37 @@
}
connection.connect();
- tempConnectionHandle = connection;
+ if(connection instanceof FreemarkerTemplateConnection) {
+ removeExecutor.execute(connection, ((FreemarkerTemplateConnection)connection).getRemoveMappings());
+ }
}
}
@Override
public void redo() {
- if (tempConnectionHandle != null) {
- tempConnectionHandle.connect();
+ if(tempConnectionHandle instanceof FreemarkerTemplateConnection) {
+ for(TreeNodeConnection connection : removeExecutor.getRelatedConnections()) {
+ connection.connect();
+ }
} else {
- execute();
+ if (tempConnectionHandle != null) {
+ tempConnectionHandle.connect();
+ } else {
+ execute();
+ }
}
}
@Override
public void undo() {
- if (tempConnectionHandle != null) {
- tempConnectionHandle.disconnect();
+ if(tempConnectionHandle instanceof FreemarkerTemplateConnection) {
+ for(TreeNodeConnection connection : removeExecutor.getRelatedConnections()) {
+ connection.disconnect();
+ }
+ } else {
+ if (tempConnectionHandle != null) {
+ tempConnectionHandle.disconnect();
+ }
}
}
Copied: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java (from rev 32286, trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java)
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java (rev 0)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java 2011-06-22 13:19:52 UTC (rev 32287)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.editparts.freemarker;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateConnection;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateNodeGraphicalModel;
+import org.jboss.tools.smooks.templating.template.Mapping;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public class FreemarkerRemoveConnectionsExecutor {
+ private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+
+ public List<TreeNodeConnection> removeMappingConnections(
+ List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
+ if (removeMappings == null || removeMappings.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ // Remove from all the children first...
+ for (AbstractSmooksGraphicalModel child : node.getChildren()) {
+ if (child instanceof TreeNodeModel) {
+ relatedConnections.addAll(removeMappingConnections(
+ removeMappings, (TreeNodeModel) child));
+ }
+ }
+
+ // Now remove from this node...
+ if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
+ List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
+ for (TreeNodeConnection connection : node
+ .getTargetConnections()) {
+ Object connectionData = connection.getData();
+ if (connectionData instanceof Mapping) {
+ for (Mapping mapping : removeMappings) {
+ if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
+ mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
+ connectionsToRemove.add(connection);
+ }
+ }
+ }
+ }
+ return connectionsToRemove;
+ }
+ return Collections.emptyList();
+ }
+
+ public void execute(TreeNodeConnection connectionHandle, List<Mapping> removeMappings) {
+ Object target = connectionHandle.getTargetNode();
+ if (target instanceof FreemarkerTemplateNodeGraphicalModel) {
+ if(removeMappings!=null){
+ relatedConnections.clear();
+ relatedConnections.addAll(removeMappingConnections(removeMappings, (FreemarkerTemplateNodeGraphicalModel)target));
+ for (TreeNodeConnection con : relatedConnections) {
+ con.disconnect();
+ }
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ public List<TreeNodeConnection> getRelatedConnections() {
+ return relatedConnections;
+ }
+}
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java 2011-06-22 12:59:49 UTC (rev 32286)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java 2011-06-22 13:19:52 UTC (rev 32287)
@@ -10,10 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.editparts.freemarker;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.commands.Command;
@@ -25,10 +21,8 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.command.DeleteConnectionCommand;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeConnectionEditPart;
-import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeConnectionEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeEndpointEditPolicy;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
-import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerModelAnalyzer;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateNodeGraphicalModel;
import org.jboss.tools.smooks.templating.template.Mapping;
@@ -100,7 +94,7 @@
public class DeleteFreeMarkerConnectionCommand extends
DeleteConnectionCommand {
- private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+ private FreemarkerRemoveConnectionsExecutor removeConnectionExecutor = new FreemarkerRemoveConnectionsExecutor();
public DeleteFreeMarkerConnectionCommand(TreeNodeConnection connection) {
super(connection);
@@ -118,13 +112,10 @@
if (builder == null || mapping == null)
return;
if (mapping instanceof Mapping) {
- relatedConnections.clear();
removeResult = builder.removeMapping((Mapping) mapping);
- relatedConnections.addAll(removeMappingConnections(
- removeResult.getRemoveMappings(),
- (FreemarkerTemplateNodeGraphicalModel) target));
+ removeConnectionExecutor.execute(connection, removeResult.getRemoveMappings());
}
- for (TreeNodeConnection con : relatedConnections) {
+ for (TreeNodeConnection con : removeConnectionExecutor.getRelatedConnections()) {
con.disconnect();
}
} catch (Exception e) {
@@ -142,43 +133,9 @@
@Override
public void undo() {
super.undo();
- for (TreeNodeConnection c : relatedConnections) {
+ for (TreeNodeConnection c : removeConnectionExecutor.getRelatedConnections()) {
c.connect();
}
}
-
- public List<TreeNodeConnection> removeMappingConnections(
- List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
- if (removeMappings == null || removeMappings.isEmpty()) {
- return Collections.emptyList();
- }
-
- // Remove from all the children first...
- for (AbstractSmooksGraphicalModel child : node.getChildren()) {
- if (child instanceof TreeNodeModel) {
- relatedConnections.addAll(removeMappingConnections(
- removeMappings, (TreeNodeModel) child));
- }
- }
-
- // Now remove from this node...
- if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
- List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
- for (TreeNodeConnection connection : node
- .getTargetConnections()) {
- Object connectionData = connection.getData();
- if (connectionData instanceof Mapping) {
- for (Mapping mapping : removeMappings) {
- if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
- mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
- connectionsToRemove.add(connection);
- }
- }
- }
- }
- return connectionsToRemove;
- }
- return Collections.emptyList();
- }
}
}
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java 2011-06-22 12:59:49 UTC (rev 32286)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java 2011-06-22 13:19:52 UTC (rev 32287)
@@ -173,64 +173,20 @@
}
}
- public class CreateFreemarkerXMLConnectionCommand extends CreateConnectionCommand{
- private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+ public class CreateFreemarkerXMLConnectionCommand extends CreateConnectionCommand {
+ private FreemarkerRemoveConnectionsExecutor removeExecutor = new FreemarkerRemoveConnectionsExecutor();
- public List<TreeNodeConnection> removeMappingConnections(
- List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
- if (removeMappings == null || removeMappings.isEmpty()) {
- return Collections.emptyList();
- }
-
- // Remove from all the children first...
- for (AbstractSmooksGraphicalModel child : node.getChildren()) {
- if (child instanceof TreeNodeModel) {
- relatedConnections.addAll(removeMappingConnections(
- removeMappings, (TreeNodeModel) child));
- }
- }
-
- // Now remove from this node...
- if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
- List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
- for (TreeNodeConnection connection : node
- .getTargetConnections()) {
- Object connectionData = connection.getData();
- if (connectionData instanceof Mapping) {
- for (Mapping mapping : removeMappings) {
- if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
- mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
- connectionsToRemove.add(connection);
- }
- }
- }
- }
- return connectionsToRemove;
- }
- return Collections.emptyList();
- }
-
@Override
public void execute() {
super.execute();
- Object target = getTempConnectionHandle().getTargetNode();
- if (target instanceof FreemarkerTemplateNodeGraphicalModel) {
- FreemarkerTemplateConnection connection = (FreemarkerTemplateConnection)this.getTempConnectionHandle();
- List<Mapping> removeMappings = connection.getRemoveMappings();
- if(removeMappings!=null){
- relatedConnections.clear();
- relatedConnections.addAll(removeMappingConnections(removeMappings, (FreemarkerTemplateNodeGraphicalModel)target));
- for (TreeNodeConnection con : relatedConnections) {
- con.disconnect();
- }
- }
- }
+ TreeNodeConnection tempConnectionHandle = getTempConnectionHandle();
+ removeExecutor.execute(tempConnectionHandle, ((FreemarkerTemplateConnection)tempConnectionHandle).getRemoveMappings());
}
@Override
public void undo() {
super.undo();
- for (TreeNodeConnection c : relatedConnections) {
+ for (TreeNodeConnection c : removeExecutor.getRelatedConnections()) {
c.connect();
}
}
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java 2011-06-22 12:59:49 UTC (rev 32286)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java 2011-06-22 13:19:52 UTC (rev 32287)
@@ -26,6 +26,7 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.editparts.freemarker.FreemarkerRemoveConnectionsExecutor;
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigChildNodeGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaBeanGraphModel;
@@ -184,7 +185,6 @@
if(connection instanceof FreemarkerTemplateConnection){
((FreemarkerTemplateConnection)connection).setRemoveMappingConnections(mappingResult.getRemoveMappings());
}
-// ((TreeNodeModel)getModelRootNode()).removeMappingConnections(mappingResult.getRemoveMappings());
} else if (isMappingValueConnection(connection)) {
String mappingString = null;
@@ -361,9 +361,9 @@
if (builder == null || mapping == null)
return;
if (mapping instanceof Mapping) {
- removeResult = builder.removeMapping((Mapping) mapping);
-
- connection.setData(removeResult);
+ removeResult = builder.removeMapping((Mapping) mapping);
+ FreemarkerRemoveConnectionsExecutor removeConnectionExecutor = new FreemarkerRemoveConnectionsExecutor();
+ removeConnectionExecutor.execute(connection, removeResult.getRemoveMappings());
}
changeFreemarkerContents();
super.removeTargetConnection(connection);
14 years, 9 months
JBoss Tools SVN: r32286 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: graphical/editors/editparts/freemarker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2011-06-22 08:59:49 -0400 (Wed, 22 Jun 2011)
New Revision: 32286
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java
Log:
JBIDE-7309: Testing a direct-to-source mapping errors out
https://issues.jboss.org/browse/JBIDE-7309
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2011-06-22 12:06:20 UTC (rev 32285)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2011-06-22 12:59:49 UTC (rev 32286)
@@ -9,6 +9,7 @@
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TriggerConnection;
import org.jboss.tools.smooks.gef.tree.model.ValueBindingConnection;
+import org.jboss.tools.smooks.graphical.editors.editparts.freemarker.FreemarkerRemoveConnectionsExecutor;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateConnection;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerXMLNodeGraphicalModel;
@@ -21,6 +22,7 @@
*/
public class CreateConnectionCommand extends Command {
+ private FreemarkerRemoveConnectionsExecutor removeExecutor = new FreemarkerRemoveConnectionsExecutor();
private AbstractSmooksGraphicalModel source;
private AbstractSmooksGraphicalModel target;
@@ -55,23 +57,37 @@
}
connection.connect();
- tempConnectionHandle = connection;
+ if(connection instanceof FreemarkerTemplateConnection) {
+ removeExecutor.execute(connection, ((FreemarkerTemplateConnection)connection).getRemoveMappings());
+ }
}
}
@Override
public void redo() {
- if (tempConnectionHandle != null) {
- tempConnectionHandle.connect();
+ if(tempConnectionHandle instanceof FreemarkerTemplateConnection) {
+ for(TreeNodeConnection connection : removeExecutor.getRelatedConnections()) {
+ connection.connect();
+ }
} else {
- execute();
+ if (tempConnectionHandle != null) {
+ tempConnectionHandle.connect();
+ } else {
+ execute();
+ }
}
}
@Override
public void undo() {
- if (tempConnectionHandle != null) {
- tempConnectionHandle.disconnect();
+ if(tempConnectionHandle instanceof FreemarkerTemplateConnection) {
+ for(TreeNodeConnection connection : removeExecutor.getRelatedConnections()) {
+ connection.disconnect();
+ }
+ } else {
+ if (tempConnectionHandle != null) {
+ tempConnectionHandle.disconnect();
+ }
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java 2011-06-22 12:59:49 UTC (rev 32286)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.editparts.freemarker;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateConnection;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateNodeGraphicalModel;
+import org.jboss.tools.smooks.templating.template.Mapping;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
+ */
+public class FreemarkerRemoveConnectionsExecutor {
+ private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+
+ public List<TreeNodeConnection> removeMappingConnections(
+ List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
+ if (removeMappings == null || removeMappings.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ // Remove from all the children first...
+ for (AbstractSmooksGraphicalModel child : node.getChildren()) {
+ if (child instanceof TreeNodeModel) {
+ relatedConnections.addAll(removeMappingConnections(
+ removeMappings, (TreeNodeModel) child));
+ }
+ }
+
+ // Now remove from this node...
+ if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
+ List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
+ for (TreeNodeConnection connection : node
+ .getTargetConnections()) {
+ Object connectionData = connection.getData();
+ if (connectionData instanceof Mapping) {
+ for (Mapping mapping : removeMappings) {
+ if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
+ mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
+ connectionsToRemove.add(connection);
+ }
+ }
+ }
+ }
+ return connectionsToRemove;
+ }
+ return Collections.emptyList();
+ }
+
+ public void execute(TreeNodeConnection connectionHandle, List<Mapping> removeMappings) {
+ Object target = connectionHandle.getTargetNode();
+ if (target instanceof FreemarkerTemplateNodeGraphicalModel) {
+ if(removeMappings!=null){
+ relatedConnections.clear();
+ relatedConnections.addAll(removeMappingConnections(removeMappings, (FreemarkerTemplateNodeGraphicalModel)target));
+ for (TreeNodeConnection con : relatedConnections) {
+ con.disconnect();
+ }
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ public List<TreeNodeConnection> getRelatedConnections() {
+ return relatedConnections;
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerRemoveConnectionsExecutor.java
___________________________________________________________________
Added: svn:keywords
+ Id Revision
Added: svn:eol-style
+ LF
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java 2011-06-22 12:06:20 UTC (rev 32285)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerTemplateConnectionEditPart.java 2011-06-22 12:59:49 UTC (rev 32286)
@@ -10,10 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.editparts.freemarker;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.commands.Command;
@@ -25,10 +21,8 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.command.DeleteConnectionCommand;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeConnectionEditPart;
-import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeConnectionEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeEndpointEditPolicy;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
-import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerModelAnalyzer;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateNodeGraphicalModel;
import org.jboss.tools.smooks.templating.template.Mapping;
@@ -100,7 +94,7 @@
public class DeleteFreeMarkerConnectionCommand extends
DeleteConnectionCommand {
- private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+ private FreemarkerRemoveConnectionsExecutor removeConnectionExecutor = new FreemarkerRemoveConnectionsExecutor();
public DeleteFreeMarkerConnectionCommand(TreeNodeConnection connection) {
super(connection);
@@ -118,13 +112,10 @@
if (builder == null || mapping == null)
return;
if (mapping instanceof Mapping) {
- relatedConnections.clear();
removeResult = builder.removeMapping((Mapping) mapping);
- relatedConnections.addAll(removeMappingConnections(
- removeResult.getRemoveMappings(),
- (FreemarkerTemplateNodeGraphicalModel) target));
+ removeConnectionExecutor.execute(connection, removeResult.getRemoveMappings());
}
- for (TreeNodeConnection con : relatedConnections) {
+ for (TreeNodeConnection con : removeConnectionExecutor.getRelatedConnections()) {
con.disconnect();
}
} catch (Exception e) {
@@ -142,43 +133,9 @@
@Override
public void undo() {
super.undo();
- for (TreeNodeConnection c : relatedConnections) {
+ for (TreeNodeConnection c : removeConnectionExecutor.getRelatedConnections()) {
c.connect();
}
}
-
- public List<TreeNodeConnection> removeMappingConnections(
- List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
- if (removeMappings == null || removeMappings.isEmpty()) {
- return Collections.emptyList();
- }
-
- // Remove from all the children first...
- for (AbstractSmooksGraphicalModel child : node.getChildren()) {
- if (child instanceof TreeNodeModel) {
- relatedConnections.addAll(removeMappingConnections(
- removeMappings, (TreeNodeModel) child));
- }
- }
-
- // Now remove from this node...
- if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
- List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
- for (TreeNodeConnection connection : node
- .getTargetConnections()) {
- Object connectionData = connection.getData();
- if (connectionData instanceof Mapping) {
- for (Mapping mapping : removeMappings) {
- if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
- mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
- connectionsToRemove.add(connection);
- }
- }
- }
- }
- return connectionsToRemove;
- }
- return Collections.emptyList();
- }
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java 2011-06-22 12:06:20 UTC (rev 32285)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerXMLNodeEditPart.java 2011-06-22 12:59:49 UTC (rev 32286)
@@ -173,64 +173,20 @@
}
}
- public class CreateFreemarkerXMLConnectionCommand extends CreateConnectionCommand{
- private List<TreeNodeConnection> relatedConnections = new ArrayList<TreeNodeConnection>();
+ public class CreateFreemarkerXMLConnectionCommand extends CreateConnectionCommand {
+ private FreemarkerRemoveConnectionsExecutor removeExecutor = new FreemarkerRemoveConnectionsExecutor();
- public List<TreeNodeConnection> removeMappingConnections(
- List<Mapping> removeMappings, AbstractSmooksGraphicalModel node) {
- if (removeMappings == null || removeMappings.isEmpty()) {
- return Collections.emptyList();
- }
-
- // Remove from all the children first...
- for (AbstractSmooksGraphicalModel child : node.getChildren()) {
- if (child instanceof TreeNodeModel) {
- relatedConnections.addAll(removeMappingConnections(
- removeMappings, (TreeNodeModel) child));
- }
- }
-
- // Now remove from this node...
- if (node.getTargetConnections() != null && !node.getTargetConnections().isEmpty()) {
- List<TreeNodeConnection> connectionsToRemove = new ArrayList<TreeNodeConnection>();
- for (TreeNodeConnection connection : node
- .getTargetConnections()) {
- Object connectionData = connection.getData();
- if (connectionData instanceof Mapping) {
- for (Mapping mapping : removeMappings) {
- if(mapping.getMappingNode() == ((Mapping)connectionData).getMappingNode() &&
- mapping.getSrcPath().equals(((Mapping)connectionData).getSrcPath())){
- connectionsToRemove.add(connection);
- }
- }
- }
- }
- return connectionsToRemove;
- }
- return Collections.emptyList();
- }
-
@Override
public void execute() {
super.execute();
- Object target = getTempConnectionHandle().getTargetNode();
- if (target instanceof FreemarkerTemplateNodeGraphicalModel) {
- FreemarkerTemplateConnection connection = (FreemarkerTemplateConnection)this.getTempConnectionHandle();
- List<Mapping> removeMappings = connection.getRemoveMappings();
- if(removeMappings!=null){
- relatedConnections.clear();
- relatedConnections.addAll(removeMappingConnections(removeMappings, (FreemarkerTemplateNodeGraphicalModel)target));
- for (TreeNodeConnection con : relatedConnections) {
- con.disconnect();
- }
- }
- }
+ TreeNodeConnection tempConnectionHandle = getTempConnectionHandle();
+ removeExecutor.execute(tempConnectionHandle, ((FreemarkerTemplateConnection)tempConnectionHandle).getRemoveMappings());
}
@Override
public void undo() {
super.undo();
- for (TreeNodeConnection c : relatedConnections) {
+ for (TreeNodeConnection c : removeExecutor.getRelatedConnections()) {
c.connect();
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java 2011-06-22 12:06:20 UTC (rev 32285)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateNodeGraphicalModel.java 2011-06-22 12:59:49 UTC (rev 32286)
@@ -26,6 +26,7 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.editparts.freemarker.FreemarkerRemoveConnectionsExecutor;
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigChildNodeGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaBeanGraphModel;
@@ -184,7 +185,6 @@
if(connection instanceof FreemarkerTemplateConnection){
((FreemarkerTemplateConnection)connection).setRemoveMappingConnections(mappingResult.getRemoveMappings());
}
-// ((TreeNodeModel)getModelRootNode()).removeMappingConnections(mappingResult.getRemoveMappings());
} else if (isMappingValueConnection(connection)) {
String mappingString = null;
@@ -361,9 +361,9 @@
if (builder == null || mapping == null)
return;
if (mapping instanceof Mapping) {
- removeResult = builder.removeMapping((Mapping) mapping);
-
- connection.setData(removeResult);
+ removeResult = builder.removeMapping((Mapping) mapping);
+ FreemarkerRemoveConnectionsExecutor removeConnectionExecutor = new FreemarkerRemoveConnectionsExecutor();
+ removeConnectionExecutor.execute(connection, removeResult.getRemoveMappings());
}
changeFreemarkerContents();
super.removeTargetConnection(connection);
14 years, 9 months
JBoss Tools SVN: r32285 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context: java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:06:20 -0400 (Wed, 22 Jun 2011)
New Revision: 32285
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-9201
Eclipse frozen when starting workspace with JPA projects
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-06-22 12:06:09 UTC (rev 32284)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-06-22 12:06:20 UTC (rev 32285)
@@ -11,6 +11,7 @@
package org.jboss.tools.hibernate.jpt.core.internal.context;
import java.io.File;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -26,7 +27,12 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
+import org.eclipse.jpt.jpa.core.context.Generator;
+import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
+import org.eclipse.jpt.jpa.core.context.Query;
+import org.eclipse.jpt.jpa.core.context.QueryContainer;
import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
@@ -37,6 +43,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaQueryContainer;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeDef;
import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
@@ -138,6 +145,28 @@
}
}
}
+
+ @Override
+ protected void addQueriesTo(QueryContainer queryContainer,
+ ArrayList<Query> queryList) {
+ super.addQueriesTo(queryContainer, queryList);
+ if (queryContainer instanceof HibernateJavaQueryContainer) {
+ CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedQueries());
+ CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedNativeQueries());
+ }
+
+ }
+
+ @Override
+ protected void addGeneratorsTo(GeneratorContainer generatorContainer,
+ ArrayList<Generator> generatorList) {
+ super.addGeneratorsTo(generatorContainer, generatorList);
+ //it could be orm generators container
+ //which is not implemented for hibernate platform
+ if (generatorContainer instanceof HibernateGeneratorContainer) {
+ CollectionTools.addAll(generatorList, ((HibernateGeneratorContainer)generatorContainer).genericGenerators());
+ }
+ }
// ********** Validation ***********************************************
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-06-22 12:06:09 UTC (rev 32284)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-06-22 12:06:20 UTC (rev 32285)
@@ -57,7 +57,7 @@
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.initializeGenericGenerators();
+ this.syncGenericGenerators();
}
@Override
@@ -196,24 +196,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.eclipse.jdt.core.dom.CompilationUnit)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter,
- CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateGenericGenerators(messages, reporter, astRoot);
- }
-
-
- protected void validateGenericGenerators(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- ListIterator<JavaGenericGenerator> genericGenerators = genericGenerators();
- while (genericGenerators.hasNext()) {
- genericGenerators.next().validate(messages, reporter, astRoot);
- }
- }
-
- /* (non-Javadoc)
* @see org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer#javaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter, org.eclipse.jdt.core.dom.CompilationUnit)
*/
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-06-22 12:06:09 UTC (rev 32284)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-06-22 12:06:20 UTC (rev 32285)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import java.util.Vector;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -23,6 +24,8 @@
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
import org.eclipse.jpt.jpa.core.context.Generator;
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
@@ -46,7 +49,7 @@
private String strategy;
- protected final List<JavaParameter> parameters;
+ protected final Vector<JavaParameter> parameters = new Vector<JavaParameter>();
public static List<String> generatorClasses = new ArrayList<String>();
@@ -73,23 +76,22 @@
*/
public JavaGenericGeneratorImpl(JavaJpaContextNode parent, GenericGeneratorAnnotation generatorAnnotation) {
super(parent, generatorAnnotation);
- this.parameters = new ArrayList<JavaParameter>();
+ this.initializeParameters();
}
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.name = this.generatorAnnotation.getName();
- this.strategy = this.generatorAnnotation.getStrategy();
- this.initializeParameters();
+ this.setStrategy_(this.generatorAnnotation.getStrategy());
+ this.updateParameters();
}
@Override
public void update() {
+ super.update();
this.setName_(this.generatorAnnotation.getName());
- this.setSpecifiedStrategy_(this.generatorAnnotation.getStrategy());
- this.updateParameters();
- this.getPersistenceUnit().addGenerator(this);
+ this.setStrategy_(this.generatorAnnotation.getStrategy());
+ this.updateNodes(this.getParameters());
}
@Override
@@ -110,13 +112,11 @@
}
public void setStrategy(String strategy) {
- String oldStrategy = this.strategy;
- this.strategy = strategy;
getGeneratorAnnotation().setStrategy(strategy);
- firePropertyChanged(GENERIC_STRATEGY_PROPERTY, oldStrategy, strategy);
+ setStrategy_(strategy);
}
- protected void setSpecifiedStrategy_(String strategy) {
+ protected void setStrategy_(String strategy) {
String oldStrategy = this.strategy;
this.strategy = strategy;
firePropertyChanged(GENERIC_STRATEGY_PROPERTY, oldStrategy, strategy);
@@ -192,7 +192,8 @@
public JavaParameter addParameter(int index) {
JavaParameter parameter = getJpaFactory().buildJavaParameter(this);
this.parameters.add(index, parameter);
- this.getGeneratorAnnotation().addParameter(index);
+ ParameterAnnotation parameterAnnotation = this.getGeneratorAnnotation().addParameter(index);
+ parameter.initialize(parameterAnnotation);
this.fireItemAdded(GenericGenerator.PARAMETERS_LIST, index, parameter);
return parameter;
}
@@ -224,6 +225,10 @@
this.getGeneratorAnnotation().moveParameter(targetIndex, sourceIndex);
fireItemMoved(GenericGenerator.PARAMETERS_LIST, targetIndex, sourceIndex);
}
+
+ public ListIterable<JavaParameter> getParameters() {
+ return new LiveCloneListIterable<JavaParameter>(this.parameters);
+ }
public ListIterator<JavaParameter> parameters() {
return new CloneListIterator<JavaParameter>(this.parameters);
14 years, 9 months
JBoss Tools SVN: r32284 - in branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context: java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:06:09 -0400 (Wed, 22 Jun 2011)
New Revision: 32284
Modified:
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-9201
Eclipse frozen when starting workspace with JPA projects
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-06-22 12:05:45 UTC (rev 32283)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-06-22 12:06:09 UTC (rev 32284)
@@ -11,6 +11,7 @@
package org.jboss.tools.hibernate.jpt.core.internal.context;
import java.io.File;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -26,7 +27,12 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
+import org.eclipse.jpt.jpa.core.context.Generator;
+import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
+import org.eclipse.jpt.jpa.core.context.Query;
+import org.eclipse.jpt.jpa.core.context.QueryContainer;
import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
@@ -37,6 +43,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaQueryContainer;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeDef;
import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
@@ -138,6 +145,28 @@
}
}
}
+
+ @Override
+ protected void addQueriesTo(QueryContainer queryContainer,
+ ArrayList<Query> queryList) {
+ super.addQueriesTo(queryContainer, queryList);
+ if (queryContainer instanceof HibernateJavaQueryContainer) {
+ CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedQueries());
+ CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedNativeQueries());
+ }
+
+ }
+
+ @Override
+ protected void addGeneratorsTo(GeneratorContainer generatorContainer,
+ ArrayList<Generator> generatorList) {
+ super.addGeneratorsTo(generatorContainer, generatorList);
+ //it could be orm generators container
+ //which is not implemented for hibernate platform
+ if (generatorContainer instanceof HibernateGeneratorContainer) {
+ CollectionTools.addAll(generatorList, ((HibernateGeneratorContainer)generatorContainer).genericGenerators());
+ }
+ }
// ********** Validation ***********************************************
@Override
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-06-22 12:05:45 UTC (rev 32283)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-06-22 12:06:09 UTC (rev 32284)
@@ -57,7 +57,7 @@
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.initializeGenericGenerators();
+ this.syncGenericGenerators();
}
@Override
@@ -196,24 +196,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.eclipse.jdt.core.dom.CompilationUnit)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter,
- CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateGenericGenerators(messages, reporter, astRoot);
- }
-
-
- protected void validateGenericGenerators(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- ListIterator<JavaGenericGenerator> genericGenerators = genericGenerators();
- while (genericGenerators.hasNext()) {
- genericGenerators.next().validate(messages, reporter, astRoot);
- }
- }
-
- /* (non-Javadoc)
* @see org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer#javaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter, org.eclipse.jdt.core.dom.CompilationUnit)
*/
@Override
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-06-22 12:05:45 UTC (rev 32283)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2011-06-22 12:06:09 UTC (rev 32284)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import java.util.Vector;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -23,6 +24,8 @@
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
import org.eclipse.jpt.jpa.core.context.Generator;
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
@@ -46,7 +49,7 @@
private String strategy;
- protected final List<JavaParameter> parameters;
+ protected final Vector<JavaParameter> parameters = new Vector<JavaParameter>();
public static List<String> generatorClasses = new ArrayList<String>();
@@ -73,23 +76,22 @@
*/
public JavaGenericGeneratorImpl(JavaJpaContextNode parent, GenericGeneratorAnnotation generatorAnnotation) {
super(parent, generatorAnnotation);
- this.parameters = new ArrayList<JavaParameter>();
+ this.initializeParameters();
}
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.name = this.generatorAnnotation.getName();
- this.strategy = this.generatorAnnotation.getStrategy();
- this.initializeParameters();
+ this.setStrategy_(this.generatorAnnotation.getStrategy());
+ this.updateParameters();
}
@Override
public void update() {
+ super.update();
this.setName_(this.generatorAnnotation.getName());
- this.setSpecifiedStrategy_(this.generatorAnnotation.getStrategy());
- this.updateParameters();
- this.getPersistenceUnit().addGenerator(this);
+ this.setStrategy_(this.generatorAnnotation.getStrategy());
+ this.updateNodes(this.getParameters());
}
@Override
@@ -110,13 +112,11 @@
}
public void setStrategy(String strategy) {
- String oldStrategy = this.strategy;
- this.strategy = strategy;
getGeneratorAnnotation().setStrategy(strategy);
- firePropertyChanged(GENERIC_STRATEGY_PROPERTY, oldStrategy, strategy);
+ setStrategy_(strategy);
}
- protected void setSpecifiedStrategy_(String strategy) {
+ protected void setStrategy_(String strategy) {
String oldStrategy = this.strategy;
this.strategy = strategy;
firePropertyChanged(GENERIC_STRATEGY_PROPERTY, oldStrategy, strategy);
@@ -192,7 +192,8 @@
public JavaParameter addParameter(int index) {
JavaParameter parameter = getJpaFactory().buildJavaParameter(this);
this.parameters.add(index, parameter);
- this.getGeneratorAnnotation().addParameter(index);
+ ParameterAnnotation parameterAnnotation = this.getGeneratorAnnotation().addParameter(index);
+ parameter.initialize(parameterAnnotation);
this.fireItemAdded(GenericGenerator.PARAMETERS_LIST, index, parameter);
return parameter;
}
@@ -224,6 +225,10 @@
this.getGeneratorAnnotation().moveParameter(targetIndex, sourceIndex);
fireItemMoved(GenericGenerator.PARAMETERS_LIST, targetIndex, sourceIndex);
}
+
+ public ListIterable<JavaParameter> getParameters() {
+ return new LiveCloneListIterable<JavaParameter>(this.parameters);
+ }
public ListIterator<JavaParameter> parameters() {
return new CloneListIterator<JavaParameter>(this.parameters);
14 years, 9 months
JBoss Tools SVN: r32283 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:05:45 -0400 (Wed, 22 Jun 2011)
New Revision: 32283
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-9216
JPA: Null text range in GenericGenerator validation process
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-06-22 12:05:27 UTC (rev 32282)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-06-22 12:05:45 UTC (rev 32283)
@@ -55,10 +55,12 @@
private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private DeclarationAnnotationElementAdapter<String> strategyDeclarationAdapter;
private AnnotationElementAdapter<String> strategyAdapter;
private String strategy;
+ private TextRange strategyTextRange;
final Vector<NestableParameterAnnotation> parameters = new Vector<NestableParameterAnnotation>();
final ParametersAnnotationContainer parametersContainer = new ParametersAnnotationContainer();
@@ -78,13 +80,17 @@
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.strategy = this.buildStrategy(astRoot);
+ this.strategyTextRange = this.buildStrategyTextRange(astRoot);
AnnotationContainerTools.initialize(this.parametersContainer, astRoot);
}
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncStrategy(this.buildStrategy(astRoot));
+ this.strategyTextRange = this.buildStrategyTextRange(astRoot);
AnnotationContainerTools.synchronize(this.parametersContainer, astRoot);
}
@@ -127,10 +133,18 @@
}
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
public TextRange getStrategyTextRange(CompilationUnit astRoot) {
+ return this.strategyTextRange;
+ }
+
+ private TextRange buildStrategyTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.strategyDeclarationAdapter, astRoot);
}
14 years, 9 months