JBoss Tools SVN: r36035 - in trunk/build/aggregate: soa-site and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-26 22:37:13 -0400 (Wed, 26 Oct 2011)
New Revision: 36035
Modified:
trunk/build/aggregate/site/site.xml
trunk/build/aggregate/soa-site/site.xml
Log:
JBIDE-6178 add 'JBoss' to category labels for core and soa sites
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2011-10-27 00:58:11 UTC (rev 36034)
+++ trunk/build/aggregate/site/site.xml 2011-10-27 02:37:13 UTC (rev 36035)
@@ -176,14 +176,6 @@
<category name="AbridgedTools" />
</feature>
- <!-- categories - see also ../../../common/aggregateRepos.*.properties -->
- <category-def name="SDKTools" label="JBoss Tools SDK">
- <description>JBoss Tools SDK contains plugins where an SDK package
- exists. These contain both source and runtimes. Use these if you want
- to debug and/or provide patches to JBoss Tools plugins.
- </description>
- </category-def>
-
<category-def name="AbridgedTools" label="Abridged JBoss Tools 3.3">
<description>Contains most of the JBoss Tools features.
Excluded are those related to integration with 3rd party
@@ -192,32 +184,32 @@
</description>
</category-def>
- <category-def name="WebTools" label="Web and Java EE Development">
+ <category-def name="WebTools" label="JBoss Web and Java EE Development">
<description>Tools to help create web and enterprise applications,
using JSF, Facelets,
Seam, Hibernate/JPA, CSS, Webservices and more.
</description>
</category-def>
- <category-def name="GeneralTools" label="Application Development">
+ <category-def name="GeneralTools" label="JBoss Application Development">
<description>Tools for general application development.</description>
</category-def>
- <category-def name="DataTools" label="Data Services">
+ <category-def name="DataTools" label="JBoss Data Services">
<description>Tools related to data services such as persistence and transformation.</description>
</category-def>
<!-- Only in JBT -->
- <category-def name="MavenTools" label="Maven Support">
+ <category-def name="MavenTools" label="JBoss Maven Support">
<description>Plugins related to Maven and m2eclipse support. Use these
to enable use of Maven.</description>
</category-def>
- <category-def name="ReportTools" label="Business Intelligence, Reporting and Charting">
+ <category-def name="ReportTools" label="JBoss Business Intelligence, Reporting and Charting">
<description>Business Intelligence, Reporting and Charting. Use these
if you plan to integrate Hibernate or Seam with Eclipse BIRT.
</description>
</category-def>
- <category-def name="CloudTools" label="Cloud">
+ <category-def name="CloudTools" label="JBoss Cloud Development Tools">
<description>Tools for Cloud Development.
</description>
</category-def>
Modified: trunk/build/aggregate/soa-site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site.xml 2011-10-27 00:58:11 UTC (rev 36034)
+++ trunk/build/aggregate/soa-site/site.xml 2011-10-27 02:37:13 UTC (rev 36035)
@@ -70,7 +70,7 @@
</description>
</category-def>
- <category-def name="SOATools" label="SOA Development">
+ <category-def name="SOATools" label="JBoss SOA Development">
<description>
Tools to help create SOA applications. Use these if you
work with jBPM,
@@ -78,11 +78,11 @@
</description>
</category-def>
- <category-def name="GeneralTools" label="Application Development">
+ <category-def name="GeneralTools" label="JBoss Application Development">
<description>Tools for general application development.</description>
</category-def>
- <category-def name="DataTools" label="Data Services">
+ <category-def name="DataTools" label="JBoss Data Services">
<description>Tools related to data services such as persistence and
transformation.</description>
</category-def>
11 years, 5 months
JBoss Tools SVN: r36034 - in trunk/esb/plugins/org.jboss.tools.esb.core: resources/meta and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-26 20:58:11 -0400 (Wed, 26 Oct 2011)
New Revision: 36034
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDHandler.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDParticipant.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDProcessor.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDHandler.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDParticipant.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDProcessor.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/ESBCoreMessages.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/messages.properties
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java
Log:
JBIDE-8571
https://issues.jboss.org/browse/JBIDE-8571
Refactor/Rename in ESB editor for channel id and for schedule id is implemented.
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2011-10-27 00:58:11 UTC (rev 36034)
@@ -64,8 +64,10 @@
<xclass id="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"
class="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"/>
- <xclass id="org.jboss.tools.esb.core.model.handlers.ESBDefaultVersionResolver"
- class="org.jboss.tools.esb.core.model.handlers.ESBDefaultVersionResolver"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.RenameChannelIDHandler"
+ class="org.jboss.tools.esb.core.model.handlers.RenameChannelIDHandler"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDHandler"
+ class="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDHandler"/>
<xclass id="org.jboss.tools.esb.core.model.ESBResourceTree"
class="org.jboss.tools.esb.core.model.ESBResourceTree"/>
@@ -112,4 +114,45 @@
</catalogContribution>
</extension>
+ <extension
+ point="org.eclipse.ltk.core.refactoring.renameParticipants">
+ <renameParticipant
+ class="org.jboss.tools.esb.core.model.handlers.RenameChannelIDParticipant"
+ id="org.jboss.tools.esb.core.model.handlers.RenameChannelIDParticipant"
+ name="esb-RenameChannelIDParticipant">
+ <enablement>
+ <with variable="affectedNatures">
+ <iterate operator="or">
+ <equals value="org.eclipse.wst.common.project.facet.core.nature"/>
+ </iterate>
+ </with>
+ <with variable="element">
+ <or>
+ <instanceof value="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+
+ <renameParticipant
+ class="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDParticipant"
+ id="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDParticipant"
+ name="esb-RenameScheduleIDParticipant">
+ <enablement>
+ <with variable="affectedNatures">
+ <iterate operator="or">
+ <equals value="org.eclipse.wst.common.project.facet.core.nature"/>
+ </iterate>
+ </with>
+ <with variable="element">
+ <or>
+ <instanceof value="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+
+ </extension>
+
+
</plugin>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2011-10-27 00:58:11 UTC (rev 36034)
@@ -301,7 +301,11 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.RenameChannelIDHandler"
+ ICON="action.empty" displayName="Rename..." kind="action" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -398,7 +402,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBSimpleSchedule101" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -432,7 +438,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -637,7 +645,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -867,7 +877,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -992,7 +1004,9 @@
</EntityData>
</XActionItem>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -1160,7 +1174,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -1397,7 +1413,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -2145,7 +2163,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -2702,7 +2722,11 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDHandler"
+ ICON="action.empty" displayName="Rename..." kind="action" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2011-10-27 00:58:11 UTC (rev 36034)
@@ -493,7 +493,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
@@ -619,7 +621,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta 2011-10-27 00:58:11 UTC (rev 36034)
@@ -120,7 +120,9 @@
</EntityData>
</XActionItem>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions">
+ <XActionItemReference entity="ESBBus" name="Rename"/>
+ </XActionItem>
<XActionItemReference entity="ESBProperty" name="CopyActions"/>
<XActionItemReference entity="ESBProperty" name="DeleteActions"/>
<XActionItemReference entity="ESBProperty" name="Properties"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/ESBCoreMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/ESBCoreMessages.java 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/ESBCoreMessages.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -16,6 +16,14 @@
private static final String BUNDLE_NAME = "org.jboss.tools.esb.core.messages"; //$NON-NLS-1$
public static String ESB_CORE_PLUGIN_NO_MESSAGE;
+
+ public static String REFERENCES;
+ public static String CHANNEL_ID_REFACTORING;
+ public static String CHANNEL_ID;
+ public static String CHANNEL_ID_REF;
+ public static String SCHEDULE_ID;
+ public static String SCHEDULE_ID_REF;
+
static {
NLS.initializeMessages(BUNDLE_NAME, ESBCoreMessages.class);
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/messages.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/messages.properties 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/messages.properties 2011-10-27 00:58:11 UTC (rev 36034)
@@ -1 +1,9 @@
ESB_CORE_PLUGIN_NO_MESSAGE=No message
+
+REFERENCES = References
+CHANNEL_ID_REFACTORING=Channel ID Refactoring
+CHANNEL_ID=Channel ID
+CHANNEL_ID_REF=Channel ID Ref
+
+SCHEDULE_ID=Schedule ID
+SCHEDULE_ID_REF=Schedule ID Ref
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java 2011-10-27 00:56:17 UTC (rev 36033)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -178,6 +178,8 @@
public String ATTR_PROPERTY_VALUE_PRESENTATION = "value presentation"; //$NON-NLS-1$
public String ATTR_BUS_ID = "id"; //$NON-NLS-1$
public String ATTR_BUS_ID_REF = "channel id ref"; //$NON-NLS-1$
+ public String ATTR_SCHEDULE_ID = "schedule id"; //$NON-NLS-1$
+ public String ATTR_SCHEDULE_ID_REF = "schedule id ref"; //$NON-NLS-1$
public String XML_ATTR_PROTECTED_METHODS = "protected-methods"; //$NON-NLS-1$
}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDHandler.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDHandler.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDHandler.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import java.util.*;
+
+import org.jboss.tools.common.meta.action.impl.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.refactoring.RenameProcessorRunner;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameChannelIDHandler extends AbstractHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ return (object != null && object.isObjectEditable());
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ RenameChannelIDProcessor processor = new RenameChannelIDProcessor();
+ processor.setModelObject(object);
+ String name = object.getAttributeValue(ESBConstants.ATTR_BUS_ID);
+ RenameProcessorRunner.run(processor, name);
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDParticipant.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDParticipant.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDParticipant.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.ltk.core.refactoring.*;
+import org.eclipse.ltk.core.refactoring.participants.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.refactoring.RenameModelObjectChange;
+import org.jboss.tools.common.model.refactoring.RenameProcessorRunner;
+import org.jboss.tools.esb.core.ESBCoreMessages;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameChannelIDParticipant extends RenameParticipant implements ISharableParticipant {
+ public static final String PARTICIPANT_NAME="esb-RenameChannelIDParticipant"; //$NON-NLS-1$
+ private XModelObject object;
+
+ public RenameChannelIDParticipant() {}
+
+ protected boolean initialize(Object element) {
+ if(element instanceof XModelObject) {
+ object = (XModelObject)element;
+ if(object.getModelEntity().getAttribute(ESBConstants.ATTR_BUS_ID) == null) {
+ object = null;
+ }
+ }
+ return object != null;
+ }
+
+ public void addElement(Object element, RefactoringArguments arguments) {
+ }
+
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ public RefactoringStatus checkConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws OperationCanceledException {
+ return null;
+ }
+
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ if (!pm.isCanceled()) {
+ if(!updateReferences() && object == null) {
+ return null;
+ }
+ String newName = getArguments().getNewName();
+ XModelObject f = FileSystemsHelper.getFile(object);
+ if(f != null) {
+ RenameModelObjectChange c1 = RenameModelObjectChange.createChange(f, newName);
+ if(c1 != null) {
+ c1.addEdits(new XModelObject[]{object}, ESBConstants.ATTR_BUS_ID, ESBCoreMessages.CHANNEL_ID);
+
+ if(updateReferences()) {
+ String oldName = object.getAttributeValue(ESBConstants.ATTR_BUS_ID);
+ XModelObject[] rs = getRefs(oldName);
+ if(rs.length > 0) {
+ c1.addEdits(rs, ESBConstants.ATTR_BUS_ID_REF, ESBCoreMessages.CHANNEL_ID_REF);
+ }
+ }
+ }
+
+ return c1;
+ }
+ }
+ return null;
+ }
+
+ protected boolean updateReferences() {
+ return RenameProcessorRunner.updateReferences(getProcessor());
+ }
+
+ private XModelObject[] getRefs(String oldName) {
+ List<XModelObject> list = new ArrayList<XModelObject>();
+ collectRefs(list, FileSystemsHelper.getFile(object), oldName);
+ return list.toArray(new XModelObject[list.size()]);
+ }
+
+ private void collectRefs(List<XModelObject> list, XModelObject o, String oldName) {
+ if(oldName.equals(o.getAttributeValue(ESBConstants.ATTR_BUS_ID_REF))) {
+ list.add(o);
+ }
+ XModelObject[] cs = o.getChildren();
+ for (XModelObject c: cs) {
+ collectRefs(list, c, oldName);
+ }
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDParticipant.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDProcessor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDProcessor.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDProcessor.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.model.refactoring.ModelRenameProcessor;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameChannelIDProcessor extends ModelRenameProcessor {
+ public static final String IDENTIFIER = "org.jboss.tools.esb.core.renameChannelIDProcessor"; //$NON-NLS-1$
+
+ public String[] getAffectedProjectNatures() throws CoreException {
+ return new String[]{"org.eclipse.wst.common.project.facet.core.nature"};
+ }
+
+ @Override
+ protected String getPropertyName() {
+ return ESBConstants.ATTR_BUS_ID;
+ }
+
+ @Override
+ public String getIdentifier() {
+ return IDENTIFIER;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameChannelIDProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDHandler.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDHandler.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDHandler.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import java.util.*;
+
+import org.jboss.tools.common.meta.action.impl.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.refactoring.RenameProcessorRunner;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameScheduleIDHandler extends AbstractHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ return (object != null && object.isObjectEditable());
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ RenameScheduleIDProcessor processor = new RenameScheduleIDProcessor();
+ processor.setModelObject(object);
+ String name = object.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID);
+ RenameProcessorRunner.run(processor, name);
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDParticipant.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDParticipant.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDParticipant.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.ltk.core.refactoring.*;
+import org.eclipse.ltk.core.refactoring.participants.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.refactoring.RenameModelObjectChange;
+import org.jboss.tools.common.model.refactoring.RenameProcessorRunner;
+import org.jboss.tools.esb.core.ESBCoreMessages;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameScheduleIDParticipant extends RenameParticipant implements ISharableParticipant {
+ public static final String PARTICIPANT_NAME="esb-RenameScheduleIDParticipant"; //$NON-NLS-1$
+ private XModelObject object;
+
+ public RenameScheduleIDParticipant() {}
+
+ protected boolean initialize(Object element) {
+ if(element instanceof XModelObject) {
+ object = (XModelObject)element;
+ if(object.getModelEntity().getAttribute(ESBConstants.ATTR_SCHEDULE_ID) == null) {
+ object = null;
+ }
+ }
+ return object != null;
+ }
+
+ public void addElement(Object element, RefactoringArguments arguments) {
+ }
+
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ public RefactoringStatus checkConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws OperationCanceledException {
+ return null;
+ }
+
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ if (!pm.isCanceled()) {
+ if(!updateReferences() && object == null) {
+ return null;
+ }
+ String newName = getArguments().getNewName();
+ XModelObject f = FileSystemsHelper.getFile(object);
+ if(f != null) {
+ RenameModelObjectChange c1 = RenameModelObjectChange.createChange(f, newName);
+ if(c1 != null) {
+ c1.addEdits(new XModelObject[]{object}, ESBConstants.ATTR_SCHEDULE_ID, ESBCoreMessages.SCHEDULE_ID);
+
+ if(updateReferences()) {
+ String oldName = object.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID);
+ XModelObject[] rs = getRefs(oldName);
+ if(rs.length > 0) {
+ c1.addEdits(rs, ESBConstants.ATTR_SCHEDULE_ID_REF, ESBCoreMessages.SCHEDULE_ID_REF);
+ }
+ }
+ }
+
+ return c1;
+ }
+ }
+ return null;
+ }
+
+ protected boolean updateReferences() {
+ return RenameProcessorRunner.updateReferences(getProcessor());
+ }
+
+ private XModelObject[] getRefs(String oldName) {
+ List<XModelObject> list = new ArrayList<XModelObject>();
+ collectRefs(list, FileSystemsHelper.getFile(object), oldName);
+ return list.toArray(new XModelObject[list.size()]);
+ }
+
+ private void collectRefs(List<XModelObject> list, XModelObject o, String oldName) {
+ if(oldName.equals(o.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID_REF))) {
+ list.add(o);
+ }
+ XModelObject[] cs = o.getChildren();
+ for (XModelObject c: cs) {
+ collectRefs(list, c, oldName);
+ }
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDParticipant.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDProcessor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDProcessor.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDProcessor.java 2011-10-27 00:58:11 UTC (rev 36034)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.tools.esb.core.model.handlers;
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.model.refactoring.ModelRenameProcessor;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class RenameScheduleIDProcessor extends ModelRenameProcessor {
+ public static final String IDENTIFIER = "org.jboss.tools.esb.core.renameScheduleIDProcessor"; //$NON-NLS-1$
+
+ public String[] getAffectedProjectNatures() throws CoreException {
+ return new String[]{"org.eclipse.wst.common.project.facet.core.nature"};
+ }
+
+ @Override
+ protected String getPropertyName() {
+ return ESBConstants.ATTR_SCHEDULE_ID;
+ }
+
+ @Override
+ public String getIdentifier() {
+ return IDENTIFIER;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/RenameScheduleIDProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
11 years, 5 months
JBoss Tools SVN: r36033 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-26 20:56:17 -0400 (Wed, 26 Oct 2011)
New Revision: 36033
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldProcessor.java
Log:
JBIDE-8571
https://issues.jboss.org/browse/JBIDE-8571
Refactor/Rename in ESB editor for channel id and for schedule id is implemented.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldProcessor.java 2011-10-27 00:55:50 UTC (rev 36032)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldProcessor.java 2011-10-27 00:56:17 UTC (rev 36033)
@@ -14,7 +14,6 @@
public class JSFRenameFieldProcessor extends JSFRenameProcessor {
public static final String IDENTIFIER = "org.jboss.tools.jsf.renameFieldProcesso"; //$NON-NLS-1$
- private boolean updateReferences = true;
public JSFRenameFieldProcessor() {}
@@ -30,12 +29,4 @@
return true;
}
- public void setUpdateReferences(boolean update) {
- updateReferences = update;
- }
-
- public boolean getUpdateReferences() {
- return updateReferences;
- }
-
}
11 years, 5 months
JBoss Tools SVN: r36032 - in trunk/common/plugins/org.jboss.tools.common.model: src/org/jboss/tools/common/model/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-26 20:55:50 -0400 (Wed, 26 Oct 2011)
New Revision: 36032
Modified:
trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java
Log:
JBIDE-8571
https://issues.jboss.org/browse/JBIDE-8571
Refactor/Rename in ESB editor for channel id and for schedule id is implemented.
Modified: trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2011-10-27 00:54:11 UTC (rev 36031)
+++ trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2011-10-27 00:55:50 UTC (rev 36032)
@@ -69,14 +69,14 @@
org.eclipse.jdt.core;visibility:=reexport;bundle-version="3.7.0",
org.eclipse.swt;visibility:=reexport;bundle-version="3.7.0",
org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.ui;visibility:=reexport;bundle-version="3.7.0",
org.eclipse.debug.core;bundle-version="3.7.0",
org.eclipse.debug.ui;bundle-version="3.7.0",
org.eclipse.help;bundle-version="3.5.0",
org.eclipse.ant.ui;bundle-version="3.5.100",
org.eclipse.ant.core;bundle-version="3.2.200",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
- org.eclipse.ltk.ui.refactoring;bundle-version="3.5.100",
+ org.eclipse.ltk.core.refactoring;visibility:=reexport;bundle-version="3.5.200",
+ org.eclipse.ltk.ui.refactoring;visibility:=reexport;bundle-version="3.5.100",
org.eclipse.wst.common.uriresolver;bundle-version="1.1.401",
org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
org.eclipse.jem.util;bundle-version="2.1.2",
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java 2011-10-27 00:54:11 UTC (rev 36031)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java 2011-10-27 00:55:50 UTC (rev 36032)
@@ -21,6 +21,7 @@
public abstract class ModelRenameProcessor extends RenameProcessor implements INameUpdating, IReferenceUpdating {
protected XModelObject object;
protected String fNewElementName;
+ private boolean updateReferences = true;
public ModelRenameProcessor() {}
@@ -72,10 +73,6 @@
return object;
}
- public boolean getUpdateReferences() {
- return true;
- }
-
public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants shared) throws CoreException {
Object[] elements= getElements();
String[] natures= getAffectedProjectNatures();
@@ -117,4 +114,12 @@
return null;
}
+ public void setUpdateReferences(boolean update) {
+ updateReferences = update;
+ }
+
+ public boolean getUpdateReferences() {
+ return updateReferences;
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java 2011-10-27 00:54:11 UTC (rev 36031)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java 2011-10-27 00:55:50 UTC (rev 36032)
@@ -11,6 +11,9 @@
package org.jboss.tools.common.model.refactoring;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -21,7 +24,6 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.impl.XModelObjectImpl;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.PositionSearcher;
@@ -35,16 +37,22 @@
*
* Use restrictions:
* 1. All objects must belong to the same file object.
- * 2. You should not create to independent changes that
- * process the same file object. For instance, if you need
- * process two sets of objects from one file with different
- * attributes affected, this implementation may not be used.
+ * 2. If you need process two sets of objects from one file with different
+ * attributes affected, use method addEdits(XModelObject[], String, String)
+ * repeatedly.
*/
public class RenameModelObjectChange extends TextFileChange {
- private XModelObject[] objects;
+ boolean ok = false;
private String newName;
- private boolean ok = false;
- private String attributeName;
+ class ObjectSet {
+ XModelObject[] objects;
+ String attributeName;
+ ObjectSet(XModelObject[] objects, String attributeName) {
+ this.objects = objects;
+ this.attributeName = attributeName;
+ }
+ }
+ List<ObjectSet> list = new ArrayList<ObjectSet>();
public static RenameModelObjectChange createChange(XModelObject[] objects, String newName, String attributeName) {
if(objects == null || objects.length == 0) return null;
@@ -53,16 +61,35 @@
if(f == null) return null;
return new RenameModelObjectChange(name, f, objects, newName, attributeName);
}
-
- private RenameModelObjectChange(String name, IFile file, XModelObject[] objects, String newName, String attributeName) {
+
+ /**
+ * Creates empty change, for which one has to add edits
+ * by calling addEdits(XModelObject[], String, String)
+ *
+ * @param fileObject
+ * @param newName
+ * @return
+ */
+ public static RenameModelObjectChange createChange(XModelObject fileObject, String newName) {
+ String name = fileObject.getPresentationString();
+ IFile f = getFile(fileObject);
+ if(f == null) return null;
+ return new RenameModelObjectChange(name, f, newName);
+ }
+
+ private RenameModelObjectChange(String name, IFile file, String newName) {
super(name, file);
- this.objects = objects;
this.newName = newName;
- this.attributeName = attributeName;
- addEdits();
}
+
+ private RenameModelObjectChange(String name, IFile file, XModelObject[] objects, String newName, String attributeName) {
+ this(name, file, newName);
+ addEdits(objects, attributeName, "Update field reference");
+ }
- private void addEdits() {
+ public void addEdits(XModelObject[] objects, String attributeName, String textEditName) {
+ list.add(new ObjectSet(objects, attributeName));
+
PositionSearcher searcher = new PositionSearcher();
XModelObject o = ((XModelObjectImpl)objects[0]).getResourceAncestor();
String text = ((FileAnyImpl)o).getAsText();
@@ -74,7 +101,7 @@
ok = false;
if(bp >= 0 && ep >= ep) {
ReplaceEdit edit = new ReplaceEdit(bp, ep - bp, newName);
- TextChangeCompatibility.addTextEdit(this, "Update field reference", edit);
+ TextChangeCompatibility.addTextEdit(this, textEditName, edit);
ok = true;
}
}
@@ -90,8 +117,10 @@
if(ok) {
result = super.perform(pm);
} else {
- for (int i = 0; i < objects.length; i++) {
- objects[i].getModel().changeObjectAttribute(objects[i], attributeName, newName);
+ for (ObjectSet set: list) {
+ for (int i = 0; i < set.objects.length; i++) {
+ set.objects[i].getModel().changeObjectAttribute(set.objects[i], set.attributeName, newName);
+ }
}
}
return result;
@@ -102,7 +131,7 @@
}
public String getName() {
- return MessageFormat.format("Edit {0}", attributeName);
+ return MessageFormat.format("Edit {0}", list.get(0).attributeName);
}
}
11 years, 5 months
JBoss Tools SVN: r36031 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test: projects/SeamCoreRootTest and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-26 20:54:11 -0400 (Wed, 26 Oct 2011)
New Revision: 36031
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/bin/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/src/
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java
Log:
https://issues.jboss.org/browse/JBIDE-9952 CDI validator should validate resource in the context of its project
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.classpath (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.classpath 2011-10-27 00:54:11 UTC (rev 36031)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/SeamCoreTest"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.project (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.project 2011-10-27 00:54:11 UTC (rev 36031)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SeamCoreRootTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.cdi.core.cdibuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.jboss.tools.cdi.core.cdinature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreRootTest/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTest.java 2011-10-26 23:48:26 UTC (rev 36030)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTest.java 2011-10-27 00:54:11 UTC (rev 36031)
@@ -14,24 +14,13 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.jboss.tools.common.base.test.validation.TestUtil;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
* @author Alexey Kazakov
*/
public class SeamCoreTest extends TestCase {
- protected IProject project;
-
protected IProject getTestProject() throws Exception {
- if(project==null) {
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamCoreTestSetup.PROJECT_NAME);
- if(!project.exists()) {
- project = ResourcesUtils.importProject(SeamCoreTestSetup.PLUGIN_ID, SeamCoreTestSetup.PROJECT_PATH);
- TestUtil.waitForValidation();
- }
- }
- return project;
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(SeamCoreTestSetup.PROJECT_NAME);
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java 2011-10-26 23:48:26 UTC (rev 36030)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java 2011-10-27 00:54:11 UTC (rev 36031)
@@ -27,8 +27,11 @@
public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.core.test";
public static final String PROJECT_NAME = "SeamCoreTest";
public static final String PROJECT_PATH = "/projects/SeamCoreTest";
+ public static final String ROOT_PROJECT_NAME = "SeamCoreRootTest";
+ public static final String ROOT_PROJECT_PATH = "/projects/SeamCoreRootTest";
protected IProject project;
+ protected IProject rootProject;
public SeamCoreTestSetup(Test test) {
super(test);
@@ -40,6 +43,10 @@
if(!project.exists()) {
project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
TestUtil._waitForValidation(project);
+ rootProject = ResourcesUtils.importProject(PLUGIN_ID, ROOT_PROJECT_PATH);
+ TestUtil._waitForValidation(rootProject);
+ } else {
+ assertTrue(ResourcesPlugin.getWorkspace().getRoot().getProject(ROOT_PROJECT_NAME).exists());
}
}
@@ -47,6 +54,7 @@
protected void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
project.delete(true, true, null);
+ rootProject.delete(true, true, null);
JobUtils.waitForIdle();
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
11 years, 5 months
JBoss Tools SVN: r36030 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-26 19:48:26 -0400 (Wed, 26 Oct 2011)
New Revision: 36030
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-9952 CDI validator should validate resource in the context of its project
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-26 23:20:19 UTC (rev 36029)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-26 23:48:26 UTC (rev 36030)
@@ -117,8 +117,6 @@
IValidatingProjectSet projectSet;
Set<IFolder> sourceFolders;
- private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
-
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
@@ -129,6 +127,7 @@
private IProject project;
private Dependencies dependencies;
private Set<IValidatorFeature> extensions;
+ private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
public CDIValidationContext(IProject project) {
this.project = project;
@@ -141,6 +140,7 @@
for (CDICoreNature n: ns) {
extensions.addAll(n.getExtensionManager().getValidatorFeatures());
}
+ injectionValidationFeatures = nature.getExtensionManager().getFeatures(IInjectionPointValidatorFeature.class);
}
/**
@@ -170,6 +170,13 @@
public Set<IValidatorFeature> getExtensions() {
return extensions;
}
+
+ /**
+ * @return the injection validation features
+ */
+ public Set<IInjectionPointValidatorFeature> getInjectionValidationFeatures() {
+ return injectionValidationFeatures;
+ }
}
CDIValidationContext getCDIContext(IResource resource) {
@@ -269,7 +276,6 @@
if(rootCdiProject==null) {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but CDI Tools model for the project is not built.");
}
- injectionValidationFeatures = nature.getExtensionManager().getFeatures(IInjectionPointValidatorFeature.class);
} else {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but there is no CDI Nature in the project.");
}
@@ -1517,7 +1523,8 @@
* @param injection
* @return
*/
- private boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
+ private boolean shouldIgnoreInjection(CDIValidationContext context, IType typeOfInjectionPoint, IInjectionPoint injection) {
+ Set<IInjectionPointValidatorFeature> injectionValidationFeatures = context.getInjectionValidationFeatures();
for (IInjectionPointValidatorFeature feature : injectionValidationFeatures) {
if(feature.shouldIgnoreInjection(typeOfInjectionPoint, injection)) {
return true;
@@ -1604,7 +1611,7 @@
* - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
*/
IType type = getTypeOfInjection(injection);
- if(!shouldIgnoreInjection(type, injection)) {
+ if(!shouldIgnoreInjection(context, type, injection)) {
boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
Set<IBean> allBeans = cdiProject.getBeans(false, injection);
for (IBean bean : allBeans) {
11 years, 5 months
JBoss Tools SVN: r36029 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-26 19:20:19 -0400 (Wed, 26 Oct 2011)
New Revision: 36029
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-9952 CDI validator should validate resource in the context of its project
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2011-10-26 22:35:38 UTC (rev 36028)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2011-10-26 23:20:19 UTC (rev 36029)
@@ -96,7 +96,7 @@
return interceptorTypeValidator;
}
- public void validateBeansXml(IFile beansXml) {
+ public void validateBeansXml(CDICoreValidator.CDIValidationContext context, IFile beansXml) {
IModelManager manager = StructuredModelManager.getModelManager();
if(manager == null) {
// this may happen if plug-in org.eclipse.wst.sse.core
@@ -120,10 +120,7 @@
* - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
* treats it as a deployment problem.
*/
- validateTypeBeanForBeansXml(
- getAlternativeClassValidator(),
- document,
- beansXml);
+ validateTypeBeanForBeansXml(context, getAlternativeClassValidator(), document, beansXml);
/*
* 5.1.1. Declaring selected alternatives for a bean archive
@@ -133,10 +130,7 @@
* - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
* treats it as a deployment problem.
*/
- validateTypeBeanForBeansXml(
- getAlternativeStereotypeValidator(),
- document,
- beansXml);
+ validateTypeBeanForBeansXml(context, getAlternativeStereotypeValidator(), document, beansXml);
/*
* 8.2. Decorator enablement and ordering
@@ -146,10 +140,7 @@
* - If the same class is listed twice under the <decorators> element, the container automatically detects the problem and
* treats it as a deployment problem.
*/
- validateTypeBeanForBeansXml(
- getDecoratorTypeValidator(),
- document,
- beansXml);
+ validateTypeBeanForBeansXml(context, getDecoratorTypeValidator(), document, beansXml);
/*
* 9.4. Interceptor enablement and ordering
@@ -159,10 +150,7 @@
* - If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as
* a deployment problem.
*/
- validateTypeBeanForBeansXml(
- getInterceptorTypeValidator(),
- document,
- beansXml);
+ validateTypeBeanForBeansXml(context, getInterceptorTypeValidator(), document, beansXml);
}
} catch (CoreException e) {
CDICorePlugin.getDefault().logError(e);
@@ -175,7 +163,7 @@
}
}
- private void validateTypeBeanForBeansXml(TypeValidator typeValidator, IDOMDocument document, IFile beansXml) {
+ private void validateTypeBeanForBeansXml(CDICoreValidator.CDIValidationContext context, TypeValidator typeValidator, IDOMDocument document, IFile beansXml) {
try {
NodeList parentNodeList = document.getElementsByTagName(typeValidator.getParrentElementname());
for (int i = 0; i < parentNodeList.getLength(); i++) {
@@ -207,7 +195,7 @@
}
continue;
} else {
- if(!typeValidator.validateSourceType(type)) {
+ if(!typeValidator.validateSourceType(context, type)) {
validator.addError(typeValidator.getIllegalTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
new String[]{}, typeNode.getLength(), typeNode.getStartOffset(), beansXml, typeValidator.getIllegalTypeErrorMessageId());
}
@@ -372,7 +360,7 @@
private static interface TypeValidator {
- boolean validateSourceType(IType type);
+ boolean validateSourceType(CDICoreValidator.CDIValidationContext context, IType type);
boolean validateBinaryType(IType type) throws JavaModelException;
@@ -424,8 +412,8 @@
private class AlternativeClassValidator extends AbstractTypeValidator {
- public boolean validateSourceType(IType type) {
- IClassBean classBean = validator.cdiProject.getBeanClass(type);
+ public boolean validateSourceType(CDICoreValidator.CDIValidationContext context, IType type) {
+ IClassBean classBean = context.getCdiProject().getBeanClass(type);
return classBean!=null && classBean.isAlternative();
}
@@ -461,8 +449,8 @@
private class AlternativeStereotypeValidator extends AbstractTypeValidator {
- public boolean validateSourceType(IType type) {
- IStereotype stereotype = validator.cdiProject.getStereotype(type);
+ public boolean validateSourceType(CDICoreValidator.CDIValidationContext context, IType type) {
+ IStereotype stereotype = context.getCdiProject().getStereotype(type);
return stereotype!=null && stereotype.isAlternative();
}
@@ -508,8 +496,8 @@
private class DecoratorTypeValidator extends AbstractTypeValidator {
- public boolean validateSourceType(IType type) {
- IClassBean classBean = validator.cdiProject.getBeanClass(type);
+ public boolean validateSourceType(CDICoreValidator.CDIValidationContext context, IType type) {
+ IClassBean classBean = context.getCdiProject().getBeanClass(type);
return classBean instanceof IDecorator;
}
@@ -545,8 +533,8 @@
private class InterceptorTypeValidator extends AbstractTypeValidator {
- public boolean validateSourceType(IType type) {
- IClassBean classBean = validator.cdiProject.getBeanClass(type);
+ public boolean validateSourceType(CDICoreValidator.CDIValidationContext context, IType type) {
+ IClassBean classBean = context.getCdiProject().getBeanClass(type);
return classBean instanceof IInterceptor;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-26 22:35:38 UTC (rev 36028)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-26 23:20:19 UTC (rev 36029)
@@ -110,12 +110,12 @@
public static final String ID = "org.jboss.tools.cdi.core.CoreValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.cdi.core.cdiproblem"; //$NON-NLS-1$
- ICDIProject cdiProject;
- String projectName;
+ ICDIProject rootCdiProject;
+ Map<IProject, CDIValidationContext> cdiContexts = new HashMap<IProject, CDIValidationContext>();
+ String rootProjectName;
IValidatingProjectTree projectTree;
IValidatingProjectSet projectSet;
Set<IFolder> sourceFolders;
- Dependencies dependencies;
private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
@@ -124,6 +124,64 @@
public static final String SHORT_ID = "jboss.cdi.core"; //$NON-NLS-1$
+ public static class CDIValidationContext {
+ private ICDIProject cdiProject;
+ private IProject project;
+ private Dependencies dependencies;
+ private Set<IValidatorFeature> extensions;
+
+ public CDIValidationContext(IProject project) {
+ this.project = project;
+ CDICoreNature nature = CDICorePlugin.getCDI(project, true);
+ cdiProject = nature.getDelegate();
+ dependencies = nature.getDefinitions().getAllDependencies();
+
+ extensions = nature.getExtensionManager().getValidatorFeatures();
+ Set<CDICoreNature> ns = nature.getCDIProjects();
+ for (CDICoreNature n: ns) {
+ extensions.addAll(n.getExtensionManager().getValidatorFeatures());
+ }
+ }
+
+ /**
+ * @return the cdiProject
+ */
+ public ICDIProject getCdiProject() {
+ return cdiProject;
+ }
+
+ /**
+ * @return the project
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * @return the dependencies
+ */
+ public Dependencies getDependencies() {
+ return dependencies;
+ }
+
+ /**
+ * @return the extensions
+ */
+ public Set<IValidatorFeature> getExtensions() {
+ return extensions;
+ }
+ }
+
+ CDIValidationContext getCDIContext(IResource resource) {
+ IProject project = resource.getProject();
+ CDIValidationContext context = cdiContexts.get(project);
+ if(context==null) {
+ context = new CDIValidationContext(project);
+ cdiContexts.put(project, context);
+ }
+ return context;
+ }
+
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMarkerType()
@@ -204,20 +262,19 @@
setMessageIdQuickFixAttributeName(MESSAGE_ID_ATTRIBUTE_NAME);
projectTree = validationHelper.getValidationContextManager().getValidatingProjectTree(this);
projectSet = projectTree.getBrunches().get(rootProject);
- cdiProject = null;
+ rootCdiProject = null;
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), true);
if(nature!=null) {
- cdiProject = nature.getDelegate();
- if(cdiProject==null) {
+ rootCdiProject = nature.getDelegate();
+ if(rootCdiProject==null) {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but CDI Tools model for the project is not built.");
}
- dependencies = nature.getDefinitions().getAllDependencies();
injectionValidationFeatures = nature.getExtensionManager().getFeatures(IInjectionPointValidatorFeature.class);
} else {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but there is no CDI Nature in the project.");
}
- projectName = projectSet.getRootProject().getName();
- sourceFolders = null;
+ rootProjectName = projectSet.getRootProject().getName();
+ cdiContexts.clear();
}
/*
@@ -228,7 +285,7 @@
throws ValidationException {
init(project, validationHelper, context, manager, reporter);
displaySubtask(CDIValidationMessages.SEARCHING_RESOURCES, new String[]{project.getName()});
- if (cdiProject == null) {
+ if (rootCdiProject == null) {
return OK_STATUS;
}
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -237,7 +294,7 @@
Set<IPath> resourcesToClean = new HashSet<IPath>(); // Resource which we should remove from validation context
for(IFile file: changedFiles) {
resourcesToClean.add(file.getFullPath());
- Set<IPath> dd = dependencies.getDirectDependencies(file.getFullPath());
+ Set<IPath> dd = getCDIContext(file).getDependencies().getDirectDependencies(file.getFullPath());
if(dd != null) {
for (IPath p: dd) {
IFile f = root.getFile(p);
@@ -256,7 +313,7 @@
if (ValidationUtil.checkFileExtensionForJavaAndXml(currentFile)) {
resources.add(currentFile.getFullPath());
- Set<String> newElNamesOfChangedFile = getELNamesByResource(currentFile.getFullPath());
+ Set<String> newElNamesOfChangedFile = getELNamesByResource(getCDIContext(currentFile), currentFile.getFullPath());
for (String newElName : newElNamesOfChangedFile) {
// Collect resources that had EL names (in previous validation session) declared in this changed resource.
Set<IPath> linkedResources = validationContext.getCoreResourcesByVariableName(SHORT_ID, newElName, true);
@@ -331,15 +388,15 @@
throws ValidationException {
init(project, validationHelper, context, manager, reporter);
- if (cdiProject == null) {
+ if (rootCdiProject == null) {
return OK_STATUS;
}
- displaySubtask(CDIValidationMessages.VALIDATING_PROJECT, new String[] { projectName });
+ displaySubtask(CDIValidationMessages.VALIDATING_PROJECT, new String[] {rootProjectName});
Set<IFile> filesToValidate = new HashSet<IFile>();
- IBean[] beans = cdiProject.getBeans();
+ IBean[] beans = rootCdiProject.getBeans();
for (IBean bean : beans) {
IResource resource = bean.getResource();
if(resource!=null && shouldValidateType(bean.getBeanClass()) && notValidatedYet(resource)) {
@@ -347,7 +404,7 @@
}
}
- IStereotype[] stereotypes = cdiProject.getStereotypes();
+ IStereotype[] stereotypes = rootCdiProject.getStereotypes();
for (IStereotype stereotype : stereotypes) {
IResource resource = stereotype.getResource();
if(shouldValidateResourceOfElement(resource) && notValidatedYet(resource)) {
@@ -355,7 +412,7 @@
}
}
- IQualifier[] qualifiers = cdiProject.getQualifiers();
+ IQualifier[] qualifiers = rootCdiProject.getQualifiers();
for (IQualifier qualifier : qualifiers) {
IResource resource = qualifier.getResource();
if(shouldValidateResourceOfElement(resource) && notValidatedYet(resource)) {
@@ -363,7 +420,7 @@
}
}
- IInterceptorBinding[] bindings = cdiProject.getInterceptorBindings();
+ IInterceptorBinding[] bindings = rootCdiProject.getInterceptorBindings();
for (IInterceptorBinding binding : bindings) {
IResource resource = binding.getResource();
if(shouldValidateResourceOfElement(resource) && notValidatedYet(resource)) {
@@ -371,9 +428,9 @@
}
}
- Set<String> scopes = cdiProject.getScopeNames();
+ Set<String> scopes = rootCdiProject.getScopeNames();
for (String scopeName: scopes) {
- IScope scope = cdiProject.getScope(scopeName);
+ IScope scope = rootCdiProject.getScope(scopeName);
IResource resource = scope.getResource();
if(shouldValidateResourceOfElement(resource) && notValidatedYet(resource)) {
filesToValidate.add((IFile)resource);
@@ -406,7 +463,7 @@
public static void cleanProject(IProject project) {
WorkbenchReporter.removeAllMessages(project, new String[]{CDICoreValidator.class.getName()}, null);
}
-
+
/**
* Validates a resource.
*
@@ -419,11 +476,11 @@
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
coreHelper.getValidationContextManager().addValidatedProject(this, file.getProject());
- Set<IPath> dd = dependencies.getDirectDependencies(file.getFullPath());
+ Set<IPath> dd = getCDIContext(file).getDependencies().getDirectDependencies(file.getFullPath());
if(dd != null && !dd.isEmpty()) {
Set<IPath> resources = new HashSet<IPath>();
for (IPath p: dd) {
- IFile f = cdiProject.getNature().getProject().getParent().getFile(p);
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(p);
if(f.exists()) {
resources.add(p);
collectAllRelatedInjections(f, resources);
@@ -434,13 +491,15 @@
}
}
+ CDIValidationContext context = getCDIContext(file);
+ ICDIProject cdiProject = context.getCdiProject();
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
// TODO should we check the path of the beans.xml? Or it's better to check the every beans.xml even if it is not in META-INF or WEB-INF.
- beansXmlValidator.validateBeansXml(file);
+ beansXmlValidator.validateBeansXml(context, file);
} else {
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean : beans) {
- validateBean(bean);
+ validateBean(context, bean);
}
IStereotype stereotype = cdiProject.getStereotype(file.getFullPath());
validateStereotype(stereotype);
@@ -454,11 +513,7 @@
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
}
- Set<IValidatorFeature> extensions = cdiProject.getNature().getExtensionManager().getValidatorFeatures();
- Set<CDICoreNature> ns = cdiProject.getNature().getCDIProjects();
- for (CDICoreNature n: ns) {
- extensions.addAll(n.getExtensionManager().getValidatorFeatures());
- }
+ Set<IValidatorFeature> extensions = context.getExtensions();
for (IValidatorFeature v: extensions) {
setSeverityPreferences(v.getSeverityPreferences());
v.validateResource(file, this);
@@ -511,7 +566,7 @@
*
* @param bean
*/
- private void validateBean(IBean bean) {
+ private void validateBean(CDIValidationContext context, IBean bean) {
if (reporter.isCancelled()) {
return;
}
@@ -540,7 +595,7 @@
validateBeanScope(bean);
if (bean instanceof IProducer) {
- validateProducer((IProducer) bean);
+ validateProducer(context, (IProducer) bean);
}
Set<IInjectionPoint> points = bean.getInjectionPoints();
@@ -550,7 +605,7 @@
getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, type.getPath(), false);
}
if(point.exists()) {
- validateInjectionPoint(point);
+ validateInjectionPoint(context, point);
}
}
@@ -559,7 +614,7 @@
}
if (bean instanceof IDecorator) {
- validateDecorator((IDecorator) bean);
+ validateDecorator(context, (IDecorator) bean);
}
if (bean instanceof IClassBean) {
@@ -575,7 +630,7 @@
validateSpecializingBean(bean);
- validateBeanName(bean);
+ validateBeanName(context, bean);
}
/**
@@ -583,7 +638,7 @@
*
* @param bean
*/
- private void validateBeanName(IBean bean) {
+ private void validateBeanName(CDIValidationContext context, IBean bean) {
String name = bean.getName();
if(name!=null && !name.startsWith("/")) {
// Collect all relations between the bean and other CDI elements.
@@ -595,7 +650,7 @@
* Suppose two beans are both available for injection in a certain war, and either:
* • the two beans have the same EL name and the name is not resolvable, or
*/
- Set<IBean> beans = cdiProject.getBeans(name, true);
+ Set<IBean> beans = context.getCdiProject().getBeans(name, true);
if(beans.size()>1 && beans.contains(bean)) {
ITextSourceReference reference = bean.getNameLocation(true);
Set<String> names = new HashSet<String>();
@@ -625,7 +680,7 @@
xName.append(st.nextToken());
if(st.hasMoreTokens()) {
String xNameAsString = xName.toString();
- Set<IBean> xBeans = cdiProject.getBeans(xNameAsString, true);
+ Set<IBean> xBeans = context.getCdiProject().getBeans(xNameAsString, true);
if(!xBeans.isEmpty()) {
String yName = name.substring(xNameAsString.length()+1);
IStatus status = JavaConventions.validateJavaTypeName(yName, CompilerOptions.VERSION_1_6, CompilerOptions.VERSION_1_6);
@@ -657,12 +712,12 @@
/*
* Returns set of EL names which are declared in the resource
*/
- private Set<String> getELNamesByResource(IPath resourcePath) {
- Set<IBean> beans = cdiProject.getBeans(resourcePath);
+ private Set<String> getELNamesByResource(CDIValidationContext context, IPath resourcePath) {
+ Set<IBean> beans = context.getCdiProject().getBeans(resourcePath);
if(beans.isEmpty()) {
return Collections.emptySet();
}
- Set<IBeanKeyProvider> ps = cdiProject.getNature().getExtensionManager().getFeatures(IBeanKeyProvider.class);
+ Set<IBeanKeyProvider> ps = context.getCdiProject().getNature().getExtensionManager().getFeatures(IBeanKeyProvider.class);
Set<String> result = new HashSet<String>();
for (IBean bean : beans) {
String name = bean.getName();
@@ -1155,7 +1210,7 @@
private static final String[] RESOURCE_ANNOTATIONS = { CDIConstants.RESOURCE_ANNOTATION_TYPE_NAME, CDIConstants.WEB_SERVICE_REF_ANNOTATION_TYPE_NAME, CDIConstants.EJB_ANNOTATION_TYPE_NAME, CDIConstants.PERSISTENCE_CONTEXT_ANNOTATION_TYPE_NAME, CDIConstants.PERSISTENCE_UNIT_ANNOTATION_TYPE_NAME };
- private void validateProducer(IProducer producer) {
+ private void validateProducer(CDIValidationContext context, IProducer producer) {
try {
Set<ITypeDeclaration> typeDeclarations = producer.getAllTypeDeclarations();
String[] typeVariables = producer.getBeanClass().getTypeParameterSignatures();
@@ -1351,7 +1406,7 @@
}
}
} else {
- Set<IBean> beans = cdiProject.getBeans(superType.getResource().getFullPath());
+ Set<IBean> beans = context.getCdiProject().getBeans(superType.getResource().getFullPath());
for (IBean iBean : beans) {
if(iBean instanceof IProducerMethod) {
IProducerMethod prMethod = (IProducerMethod)iBean;
@@ -1406,6 +1461,8 @@
}
private void collectAllRelatedInjections(IFile validatingResource, Set<IPath> relatedResources) {
+ CDIValidationContext context = getCDIContext(validatingResource);
+ ICDIProject cdiProject = context.getCdiProject();
collectAllRelatedInjectionsForBean(validatingResource, relatedResources);
if("beans.xml".equals(validatingResource.getName().toLowerCase())) {
List<INodeReference> nodes = cdiProject.getAlternativeClasses();
@@ -1435,6 +1492,8 @@
}
public void collectAllRelatedInjectionsForBean(IFile validatingResource, Set<IPath> relatedResources) {
+ CDIValidationContext context = getCDIContext(validatingResource);
+ ICDIProject cdiProject = context.getCdiProject();
Set<IBean> beans = cdiProject.getBeans(validatingResource.getFullPath());
for (IBean bean : beans) {
Set<IParametedType> types = bean.getAllTypes();
@@ -1500,7 +1559,8 @@
}
}
- private void validateInjectionPoint(IInjectionPoint injection) {
+ private void validateInjectionPoint(CDIValidationContext context, IInjectionPoint injection) {
+ ICDIProject cdiProject = context.getCdiProject();
if(injection instanceof IInjectionPointParameter && injection.isAnnotationPresent(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)) {
//Disposer is validated separately
return;
@@ -2020,7 +2080,7 @@
}
}
- private void validateDecorator(IDecorator decorator) {
+ private void validateDecorator(CDIValidationContext context, IDecorator decorator) {
/*
* 2.5.3. Beans with no EL name
* - decorator has a name (Non-Portable behavior)
@@ -2114,7 +2174,7 @@
if(delegateParametedType!=null) {
IType delegateType = delegateParametedType.getType();
if(delegateType != null) {
- if(!checkTheOnlySuper(decorator, delegateParametedType)) {
+ if(!checkTheOnlySuper(context, decorator, delegateParametedType)) {
Set<IParametedType> decoratedParametedTypes = decorator.getDecoratedTypes();
List<String> supers = null;
if(shouldValidateType(delegateType)) {
@@ -2157,7 +2217,8 @@
}
}
- private boolean checkTheOnlySuper(IDecorator decorator, IParametedType delegatedType) {
+ private boolean checkTheOnlySuper(CDIValidationContext context, IDecorator decorator, IParametedType delegatedType) {
+ ICDIProject cdiProject = context.getCdiProject();
try {
String superClassSignature = decorator.getBeanClass().getSuperclassTypeSignature();
String[] superInterfaceSignatures = decorator.getBeanClass().getSuperInterfaceTypeSignatures();
11 years, 5 months
JBoss Tools SVN: r36028 - branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-26 18:35:38 -0400 (Wed, 26 Oct 2011)
New Revision: 36028
Modified:
branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-10028 JBoss Central Editor Maximize/Restore actions freeze UI and loads CPU
Modified: branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 22:34:37 UTC (rev 36027)
+++ branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 22:35:38 UTC (rev 36028)
@@ -1015,9 +1015,9 @@
}
oldSize = size;
GridData gd;
- Point computedSize;
+ //Point computedSize;
int widthHint = size.x/2 - 40;
-
+ //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
gd = (GridData) newsSection.getLayoutData();
if (newsSection.isExpanded()) {
if (blogsSection.isExpanded()) {
@@ -1026,15 +1026,15 @@
gd.heightHint = size.y - 40;
}
} else {
- computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.heightHint = computedSize.y;
+ gd.heightHint = 20;
}
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- newsSection.setSize(widthHint, computedSize.y);
+ //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //newsSection.setSize(widthHint, computedSize.y);
gd = (GridData) blogsSection.getLayoutData();
+ //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
if (blogsSection.isExpanded()) {
if (newsSection.isExpanded()) {
gd.heightHint = size.y/2 - 20;
@@ -1042,56 +1042,55 @@
gd.heightHint = size.y - 40;
}
} else {
- computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.heightHint = computedSize.y;
+ gd.heightHint = 20;
}
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- blogsSection.setSize(widthHint, computedSize.y);
+ //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //blogsSection.setSize(widthHint, computedSize.y);
gd = (GridData) tutorialsSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
tutorialPageBook.pack();
- computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- tutorialsSection.setSize(widthHint, computedSize.y);
+ //computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //tutorialsSection.setSize(widthHint, computedSize.y);
gd = (GridData) documentationSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = documentationSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- documentationSection.setSize(widthHint, computedSize.y);
+ //computedSize = documentationSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //documentationSection.setSize(widthHint, computedSize.y);
gd = (GridData) settingsSection.getLayoutData();
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = settingsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- settingsSection.setSize(widthHint, computedSize.y);
+ //computedSize = settingsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //settingsSection.setSize(widthHint, computedSize.y);
gd = (GridData) projectsSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = projectsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- projectsSection.setSize(widthHint, computedSize.y);
+ //computedSize = projectsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //projectsSection.setSize(widthHint, computedSize.y);
form.reflow(true);
form.redraw();
blogsScrollComposite.setMinSize(widthHint, size.y - 55);
newsScrollComposite.setMinSize(widthHint, size.y - 55);
- computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int y = computedSize.y;
if (y > 200) {
y = 200;
}
tutorialScrollComposite.setMinSize(widthHint, y);
- refreshNews();
- refreshBlogs();
+ //refreshNews();
+ //refreshBlogs();
form.layout(true, true);
}
11 years, 5 months
JBoss Tools SVN: r36027 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-26 18:34:37 -0400 (Wed, 26 Oct 2011)
New Revision: 36027
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-10028 JBoss Central Editor Maximize/Restore actions freeze UI and loads CPU
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 21:51:35 UTC (rev 36026)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 22:34:37 UTC (rev 36027)
@@ -1015,9 +1015,9 @@
}
oldSize = size;
GridData gd;
- Point computedSize;
+ //Point computedSize;
int widthHint = size.x/2 - 40;
-
+ //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
gd = (GridData) newsSection.getLayoutData();
if (newsSection.isExpanded()) {
if (blogsSection.isExpanded()) {
@@ -1026,15 +1026,15 @@
gd.heightHint = size.y - 40;
}
} else {
- computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.heightHint = computedSize.y;
+ gd.heightHint = 20;
}
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- newsSection.setSize(widthHint, computedSize.y);
+ //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //newsSection.setSize(widthHint, computedSize.y);
gd = (GridData) blogsSection.getLayoutData();
+ //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
if (blogsSection.isExpanded()) {
if (newsSection.isExpanded()) {
gd.heightHint = size.y/2 - 20;
@@ -1042,56 +1042,55 @@
gd.heightHint = size.y - 40;
}
} else {
- computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.heightHint = computedSize.y;
+ gd.heightHint = 20;
}
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- blogsSection.setSize(widthHint, computedSize.y);
+ //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //blogsSection.setSize(widthHint, computedSize.y);
gd = (GridData) tutorialsSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
tutorialPageBook.pack();
- computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- tutorialsSection.setSize(widthHint, computedSize.y);
+ //computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //tutorialsSection.setSize(widthHint, computedSize.y);
gd = (GridData) documentationSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = documentationSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- documentationSection.setSize(widthHint, computedSize.y);
+ //computedSize = documentationSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //documentationSection.setSize(widthHint, computedSize.y);
gd = (GridData) settingsSection.getLayoutData();
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = settingsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- settingsSection.setSize(widthHint, computedSize.y);
+ //computedSize = settingsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //settingsSection.setSize(widthHint, computedSize.y);
gd = (GridData) projectsSection.getLayoutData();
//gridData.heightHint = size.y - 40;
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- computedSize = projectsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- projectsSection.setSize(widthHint, computedSize.y);
+ //computedSize = projectsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //projectsSection.setSize(widthHint, computedSize.y);
form.reflow(true);
form.redraw();
blogsScrollComposite.setMinSize(widthHint, size.y - 55);
newsScrollComposite.setMinSize(widthHint, size.y - 55);
- computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int y = computedSize.y;
if (y > 200) {
y = 200;
}
tutorialScrollComposite.setMinSize(widthHint, y);
- refreshNews();
- refreshBlogs();
+ //refreshNews();
+ //refreshBlogs();
form.layout(true, true);
}
11 years, 5 months
JBoss Tools SVN: r36026 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-26 17:51:35 -0400 (Wed, 26 Oct 2011)
New Revision: 36026
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
Log:
JBIDE-10028 JBoss Central Editor Maximize/Restore actions freeze UI and loads CPU
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-10-26 21:50:07 UTC (rev 36025)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-10-26 21:51:35 UTC (rev 36026)
@@ -19,6 +19,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
@@ -98,4 +99,14 @@
formText.setText(text, true, false);
return composite;
}
+
+ protected void setBusyIndicator(Composite composite, boolean busy) {
+ Control[] children = composite.getChildren();
+ for (Control child:children) {
+ if (child instanceof RefreshIndicator) {
+ RefreshIndicator indicator = (RefreshIndicator) child;
+ indicator.setBusy(busy);
+ }
+ }
+ }
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 21:50:07 UTC (rev 36025)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-26 21:51:35 UTC (rev 36026)
@@ -150,6 +150,7 @@
private RefreshNewsJobChangeListener refreshNewsJobChangeListener;
private Section settingsSection;
private Composite settingsComposite;
+ private Point oldSize;
public GettingStartedPage(FormEditor editor) {
super(editor, ID, "Getting Started");
@@ -715,12 +716,12 @@
@Override
public void run() {
pageBook.showPage(composite);
+ setBusyIndicator(composite, true);
form.reflow(true);
form.redraw();
recomputeScrollComposite(scrolledComposite, pageBook);
}
});
-
return true;
}
@@ -1009,6 +1010,10 @@
} else {
size = form.getBody().getSize();
}
+ if (size.equals(oldSize)) {
+ return;
+ }
+ oldSize = size;
GridData gd;
Point computedSize;
int widthHint = size.x/2 - 40;
@@ -1109,6 +1114,7 @@
@Override
public void run() {
+ setBusyIndicator(blogsLoadingComposite, false);
refreshBlogs();
}
});
@@ -1151,6 +1157,7 @@
@Override
public void run() {
+ setBusyIndicator(tutorialsLoadingComposite, false);
refreshTutorials();
}
});
@@ -1193,6 +1200,7 @@
@Override
public void run() {
+ setBusyIndicator(newsLoadingComposite, false);
refreshNews();
}
});
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java 2011-10-26 21:50:07 UTC (rev 36025)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java 2011-10-26 21:51:35 UTC (rev 36026)
@@ -108,6 +108,9 @@
while (!stop) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
+ if (!getParent().isVisible()) {
+ return;
+ }
if (!stop) {
if (count < maxCount)
setImage(images[count]);
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-10-26 21:50:07 UTC (rev 36025)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-10-26 21:51:35 UTC (rev 36026)
@@ -252,11 +252,11 @@
@Override
public void run() {
pageBook.showPage(loadingComposite);
+ setBusyIndicator(loadingComposite, true);
form.reflow(true);
form.redraw();
}
});
-
return true;
}
@@ -309,6 +309,7 @@
@Override
public void run() {
+ setBusyIndicator(loadingComposite, false);
refresh();
}
});
11 years, 5 months