JBoss Tools SVN: r15599 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-29 09:53:46 -0400 (Fri, 29 May 2009)
New Revision: 15599
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3786
Name changes in Properties view calls ConsoleConfiguration rename(If the name is valid)
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2009-05-29 13:52:27 UTC (rev 15598)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2009-05-29 13:53:46 UTC (rev 15599)
@@ -28,8 +28,8 @@
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent.Type;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
/**
@@ -70,11 +70,10 @@
}
private ILaunchConfiguration getLaunchConfiguration(IProject project) throws CoreException{
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType lct = lm.getLaunchConfigurationType(ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
- for (int i = 0; i < lm.getLaunchConfigurations(lct).length; i++){
- ILaunchConfiguration lc = lm.getLaunchConfigurations(lct)[i];
+ ILaunchConfiguration[] lcs = LaunchHelper.findHibernateLaunchConfigs();
+ for (int i = 0; i < lcs.length; i++){
+ ILaunchConfiguration lc = lcs[i];
if (project.getName().equals(
lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""))){//lc uses this project //$NON-NLS-1$
if (project.getName().equals(lc.getName())) return lc;
@@ -92,7 +91,7 @@
protected void buildConsoleConfiguration(IProject project){
ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType lct = lm.getLaunchConfigurationType(ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
+ ILaunchConfigurationType lct = LaunchHelper.getHibernateLaunchConfigsType();
String launchName = lm.generateUniqueLaunchConfigurationNameFrom(project.getName());
ILaunchConfigurationWorkingCopy wc;
try {
15 years, 7 months
JBoss Tools SVN: r15598 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-29 09:52:27 -0400 (Fri, 29 May 2009)
New Revision: 15598
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
trunk/jsf/docs/userguide/en/modules/vwt_faq.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBIDE-4076 -The info about the issue and it's resolving was added to Doc - VisualWebTools. </p>
</body></html>
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-29 13:50:25 UTC (rev 15597)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-29 13:52:27 UTC (rev 15598)
@@ -1690,7 +1690,23 @@
visual page editor then close all browser views/editors and leave one visual page
editor open and restart eclipse. This should force a load of the right XULRunner
viewer.</para>
-
+ <para> If it doesn't help and you use Fedora Core Linux and Eclipse Version: 3.4.1,the issue can be produced because libswt-xulrunner-gtk-3449.so file doesn't present
+ in eclipse-swt-3.4.1-5.fc10.x86_64.rpm/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.4.1.v3449c.jar.To add this file to eclipse you should:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Decompress eclipse/plugins/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar form eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz</para>
+ </listitem>
+ <listitem>
+ <para>Copy <property>libswt-xulrunner-gtk-3449.so</property> file to your Fedora Eclipse location.</para>
+ </listitem>
+
+ <listitem>
+ <para>Open the file eclipse.ini,which can be found in your Fedora Eclipse location and add the following line: </para>
+ <programlisting role="JAVA"><![CDATA[-Dswt.library.path=/usr/lib/eclipse
+]]></programlisting><para>,where <code>/usr/lib/eclipse</code> is the path to your eclipse folder.</para>
+ </listitem>
+ </itemizedlist>
</section>
<!-- <section id="CreateLookAndFeel(Design-timeMetadate)ForAnyCustomJSFComponents41">
Modified: trunk/jsf/docs/userguide/en/modules/vwt_faq.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/vwt_faq.xml 2009-05-29 13:50:25 UTC (rev 15597)
+++ trunk/jsf/docs/userguide/en/modules/vwt_faq.xml 2009-05-29 13:52:27 UTC (rev 15598)
@@ -30,11 +30,28 @@
]]></programlisting>
</listitem>
</itemizedlist>
-
+
<para> In case you have the library installed and you still have issue with starting the
<property>Visual Page Editor</property> then close all browser views/editors and leave one <property>Visual Page
Editor</property> open and restart eclipse. This should force a load of the right XULRunner
viewer.</para>
+ <para> If it doesn't help and you use Fedora Core Linux and Eclipse Version: 3.4.1,the issue can be produced because libswt-xulrunner-gtk-3449.so file doesn't present
+ in eclipse-swt-3.4.1-5.fc10.x86_64.rpm/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.4.1.v3449c.jar.To add this file to eclipse you should:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Decompress eclipse/plugins/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar form eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz</para>
+ </listitem>
+ <listitem>
+ <para>Copy <property>libswt-xulrunner-gtk-3449.so</property> file to your Fedora Eclipse location. </para>
+ </listitem>
+
+ <listitem>
+ <para>Open the file eclipse.ini,which can be found in your Fedora Eclipse location and add the following line: </para>
+ <programlisting role="JAVA"><![CDATA[-Dswt.library.path=/usr/lib/eclipse
+]]></programlisting><para>,where <code>/usr/lib/eclipse</code> is the path to your eclipse folder.</para>
+ </listitem>
+ </itemizedlist>
</section>
<section id="question_2">
15 years, 7 months
JBoss Tools SVN: r15597 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-29 09:50:25 -0400 (Fri, 29 May 2009)
New Revision: 15597
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBIDE-4076 -The info about the issue and it's resolving was added to Doc - RHDS GSG . </p>
</body></html>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml 2009-05-29 13:43:33 UTC (rev 15596)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml 2009-05-29 13:50:25 UTC (rev 15597)
@@ -39,6 +39,24 @@
<para>Open the JBDS perspective. If you see the Help view open, close it and restart
JBDS</para>
</listitem>
+ <listitem><para> If it doesn't help and you use Fedora Core Linux and Eclipse Version: 3.4.1,the issue can be produced because libswt-xulrunner-gtk-3449.so file doesn't present
+ in eclipse-swt-3.4.1-5.fc10.x86_64.rpm/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.4.1.v3449c.jar.To add this file to eclipse you should:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Decompress eclipse/plugins/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar form eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz</para>
+ </listitem>
+ <listitem>
+ <para>Copy <property>libswt-xulrunner-gtk-3449.so</property> file to your Fedora Eclipse location.</para>
+ </listitem>
+
+ <listitem>
+ <para>Open the file eclipse.ini,which can be found in your Fedora Eclipse location and add the following line: </para>
+ <programlisting role="JAVA"><![CDATA[-Dswt.library.path=/usr/lib/eclipse
+]]></programlisting><para>,where <code>/usr/lib/eclipse</code> is the path to your eclipse folder.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
<listitem>
<para>If none of these work, do the following:</para>
<itemizedlist>
15 years, 7 months
JBoss Tools SVN: r15596 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: console/actions and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-29 09:43:33 -0400 (Fri, 29 May 2009)
New Revision: 15596
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3786
Name changes in Properties view calls ConsoleConfiguration rename(If the name is valid)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -37,7 +37,6 @@
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.text.JavaTextTools;
@@ -62,6 +61,7 @@
import org.hibernate.console.KnownConfigurationsListener;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.workbench.ConfigurationAdapterFactory;
import org.hibernate.eclipse.criteriaeditor.CriteriaEditorInput;
import org.hibernate.eclipse.criteriaeditor.CriteriaEditorStorage;
@@ -252,10 +252,7 @@
private void loadExistingConfigurations() throws CoreException {
- final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
- ILaunchConfigurationType lct = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
- ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( lct );
+ ILaunchConfiguration[] launchConfigurations = LaunchHelper.findHibernateLaunchConfigs();
for (int i = 0; i < launchConfigurations.length; i++) {
KnownConfigurations.getInstance().addConfiguration(
new ConsoleConfiguration(new EclipseLaunchConsoleConfigurationPreferences(launchConfigurations[i])), false );
@@ -274,25 +271,9 @@
}
}
- private ILaunchConfiguration findLaunchConfig(String name)
+ public ILaunchConfiguration findLaunchConfig(String name)
throws CoreException {
- ILaunchManager launchManager = DebugPlugin.getDefault()
- .getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager
- .getLaunchConfigurationType(ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
- ILaunchConfiguration[] launchConfigurations = launchManager
- .getLaunchConfigurations(launchConfigurationType);
-
- for (int i = 0; i < launchConfigurations.length; i++) { // can't believe
- // there is no
- // look up by
- // name API
- ILaunchConfiguration launchConfiguration = launchConfigurations[i];
- if (launchConfiguration.getName().equals(name)) {
- return launchConfiguration;
- }
- }
- return null;
+ return LaunchHelper.findHibernateLaunchConfig(name);
}
/**
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -38,7 +38,7 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
/**
*
@@ -91,7 +91,7 @@
throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
+ ILaunchConfigurationType launchConfigurationType = LaunchHelper.getHibernateLaunchConfigsType();
String launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(HibernateConsoleMessages.AddConfigurationAction_hibernate);
//ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( launchConfigurationType );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null, launchName);
@@ -118,12 +118,8 @@
static private List<ILaunchConfiguration> getTemporaryLaunchConfigurations()
throws CoreException {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
-
List<ILaunchConfiguration> listTempConfigs = new ArrayList<ILaunchConfiguration>();
- ILaunchConfiguration[] configs = launchManager.getLaunchConfigurations(launchConfigurationType);
+ ILaunchConfiguration[] configs = LaunchHelper.findHibernateLaunchConfigs();
for (int i = 0; i < configs.length; i++) {
boolean temporary = configs[i].getAttribute(AddConfigurationAction.TEMPORARY_CONFIG_FLAG, false);
if (temporary) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -24,10 +24,7 @@
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IWorkbenchWindow;
@@ -36,7 +33,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
/**
* @author max
@@ -82,32 +79,17 @@
private void edit(final ConsoleConfiguration config) {
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- /*if(MessageDialog.openQuestion( null, "Use old dialog ?", "Use old dialog" )) {
- ConsoleConfigurationCreationWizard wizard = new ConsoleConfigurationCreationWizard();
- wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(config) );
-
-
- WizardDialog dialog = new WizardDialog(win.getShell(), wizard);
- dialog.open(); // This opens a dialog
- } else {*/
- try {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
- ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( launchConfigurationType );
- for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there is no look up by name API
- ILaunchConfiguration launchConfiguration = launchConfigurations[i];
- if(launchConfiguration.getName().equals(config.getName())) {
- DebugUITools.openLaunchConfigurationPropertiesDialog( win.getShell(), launchConfiguration, "org.eclipse.debug.ui.launchGroup.run" ); //$NON-NLS-1$
- return;
- }
- }
- String out = NLS.bind(HibernateConsoleMessages.EditConsoleConfiguration_could_not_find_launch_cfg, config.getName());
- HibernateConsolePlugin.getDefault().showError(win.getShell(), out, new IllegalStateException(HibernateConsoleMessages.EditConsoleConfiguration_no_launch_cfg_matched + config.getName()));
- } catch (CoreException ce) {
- HibernateConsolePlugin.getDefault().showError( win.getShell(), HibernateConsoleMessages.EditConsoleConfiguration_problem_adding_console_cfg, ce);
+ try {
+ ILaunchConfiguration launchConfiguration = LaunchHelper.findHibernateLaunchConfig(config.getName());
+ if(launchConfiguration != null) {
+ DebugUITools.openLaunchConfigurationPropertiesDialog( win.getShell(), launchConfiguration, "org.eclipse.debug.ui.launchGroup.run" ); //$NON-NLS-1$
+ return;
}
- //}
+ String out = NLS.bind(HibernateConsoleMessages.EditConsoleConfiguration_could_not_find_launch_cfg, config.getName());
+ HibernateConsolePlugin.getDefault().showError(win.getShell(), out, new IllegalStateException(HibernateConsoleMessages.EditConsoleConfiguration_no_launch_cfg_matched + config.getName()));
+ } catch (CoreException ce) {
+ HibernateConsolePlugin.getDefault().showError( win.getShell(), HibernateConsoleMessages.EditConsoleConfiguration_problem_adding_console_cfg, ce);
+ }
}
protected boolean updateState(ConsoleConfiguration consoleConfiguration) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -2,20 +2,39 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.actions.AddConfigurationAction;
+import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
public class LaunchHelper {
+
+ public static ILaunchConfiguration findHibernateLaunchConfig(String name) throws CoreException {
+ return findLaunchConfigurationByName(
+ ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID, name);
+ }
+
+ public static ILaunchConfigurationType getHibernateLaunchConfigsType(){
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ return launchManager.getLaunchConfigurationType(
+ ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
+ }
+
+ public static ILaunchConfiguration[] findHibernateLaunchConfigs() throws CoreException {
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ return launchManager.getLaunchConfigurations(getHibernateLaunchConfigsType());
+ }
- static public ILaunchConfiguration findLaunchConfigurationByName(String launchConfigurationTypeId, String name) throws CoreException {
+ public static ILaunchConfiguration findLaunchConfigurationByName(String launchConfigurationTypeId, String name) throws CoreException {
Assert.isNotNull(launchConfigurationTypeId, HibernateConsoleMessages.LaunchHelper_launch_cfg_type_cannot_be_null);
- ILaunchManager launchManager = DebugPlugin.getDefault()
- .getLaunchManager();
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
ILaunchConfigurationType launchConfigurationType = launchManager
.getLaunchConfigurationType(launchConfigurationTypeId);
@@ -33,4 +52,48 @@
}
return null;
}
+
+ public static String verifyConfigurationName(String currentName) {
+ if (currentName == null || currentName.length() < 1) {
+ return HibernateConsoleMessages.ConsoleConfigurationWizardPage_name_must_specified;
+ }
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ String[] badnames = new String[] { "aux", "clock$", "com1", "com2", "com3", "com4", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ "com5", "com6", "com7", "com8", "com9", "con", "lpt1", "lpt2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+ "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "nul", "prn" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ for (int i = 0; i < badnames.length; i++) {
+ if (currentName.equals(badnames[i])) {
+ return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationWizardPage_bad_name, currentName);
+ }
+ }
+ }
+ // See if name contains any characters that we deem illegal.
+ // '@' and '&' are disallowed because they corrupt menu items.
+ char[] disallowedChars = new char[] { '@', '&', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0' };
+ for (int i = 0; i < disallowedChars.length; i++) {
+ char c = disallowedChars[i];
+ if (currentName.indexOf(c) > -1) {
+ return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationWizardPage_bad_char, c);
+ }
+ }
+
+ if(existingLaunchConfiguration(currentName)) {
+ return HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_name_already_exist;
+ }
+ return null;
+ }
+
+ public static boolean existingLaunchConfiguration(String name) {
+ try {
+ ILaunchConfiguration config = findHibernateLaunchConfig(name);
+ if(config != null && !config.getAttribute(AddConfigurationAction.TEMPORARY_CONFIG_FLAG, false)) {
+ if (name.equalsIgnoreCase(config.getName())) {
+ return true;
+ }
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(e.getMessage(), e);
+ }
+ return false;
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -43,10 +43,7 @@
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
@@ -65,7 +62,6 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.hibernate.util.StringHelper;
import org.osgi.service.prefs.BackingStoreException;
@@ -216,27 +212,20 @@
* @return a handle to the project resource
*/
public static IProject findProject(ConsoleConfiguration consoleConfiguration) {
- IProject res = null;
if (consoleConfiguration != null) {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
try {
- ILaunchConfiguration[] launchConfigurations =
- launchManager.getLaunchConfigurations( launchConfigurationType );
- // can't believe there is no look up by name API
- for (int i = 0; i < launchConfigurations.length && res == null; i++) {
- ILaunchConfiguration launchConfiguration = launchConfigurations[i];
- if (launchConfiguration.getName().equals(consoleConfiguration.getName())) {
- String projName = launchConfiguration.getAttribute(
- IConsoleConfigurationLaunchConstants.PROJECT_NAME, ""); //$NON-NLS-1$
- res = findProject(projName);
- }
+ ILaunchConfiguration launchConfiguration = LaunchHelper.findHibernateLaunchConfig(
+ consoleConfiguration.getName());
+ if(launchConfiguration != null) {
+ String projName = launchConfiguration.getAttribute(
+ IConsoleConfigurationLaunchConstants.PROJECT_NAME, ""); //$NON-NLS-1$
+ return findProject(projName);
}
} catch (CoreException e1) {
HibernateConsolePlugin.getDefault().log(e1);
}
}
- return res;
+ return null;
}
/**
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -24,19 +24,24 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
public class ConsoleConfigurationPropertySource implements IPropertySource {
- private final ConsoleConfiguration cfg;
+ private ConsoleConfiguration cfg;
-
static IPropertyDescriptor[] pd;
static {
List<IPropertyDescriptor> l = new ArrayList<IPropertyDescriptor>();
@@ -93,6 +98,27 @@
}
public void setPropertyValue(Object id, Object value) {
+ if("name".equals(id) && value instanceof String) { //$NON-NLS-1$
+ String newName = (String) value;
+ if (LaunchHelper.verifyConfigurationName(newName) != null) {
+ return;//just do not change name
+ }
+ String oldName = cfg.getName();
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(oldName);
+ if (lc != null){
+ ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
+ wc.rename(newName);
+ wc.doSave();
+ //find newly created console configuration
+ cfg = KnownConfigurations.getInstance().find(newName);
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + oldName + "\"");
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log(e);
+ }
}
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -31,10 +31,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
@@ -72,9 +69,9 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.ConsoleConfigurationMainTab;
import org.hibernate.eclipse.launch.ConsoleConfigurationTabGroup;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.hibernate.util.StringHelper;
@@ -264,7 +261,7 @@
if (name != null) {
name = name.trim();
}
- messageError = verifyConfigurationName(name);
+ messageError = LaunchHelper.verifyConfigurationName(name);
if (messageError != null) {
setMessage(messageWarning);
updateStatus(messageError);
@@ -295,26 +292,6 @@
updateStatus(messageError);
}
- private boolean existingLaunchConfiguration(String name) {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager
- .getLaunchConfigurationType(ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
- try {
- ILaunchConfiguration[] configs;
- configs = launchManager.getLaunchConfigurations(launchConfigurationType);
- for (int i = 0; i < configs.length; i++) {
- if(!configs[i].getAttribute(AddConfigurationAction.TEMPORARY_CONFIG_FLAG, false)) {
- if (name.equalsIgnoreCase(configs[i].getName())) {
- return true;
- }
- }
- }
- } catch (CoreException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(e.getMessage(), e);
- }
- return false;
- }
-
/**
* Notification that a tab has been selected
*
@@ -368,36 +345,6 @@
return null;
}
- protected String verifyConfigurationName(String currentName) {
- if (currentName == null || currentName.length() < 1) {
- return HibernateConsoleMessages.ConsoleConfigurationWizardPage_name_must_specified;
- }
- if (Platform.OS_WIN32.equals(Platform.getOS())) {
- String[] badnames = new String[] { "aux", "clock$", "com1", "com2", "com3", "com4", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- "com5", "com6", "com7", "com8", "com9", "con", "lpt1", "lpt2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
- "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "nul", "prn" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- for (int i = 0; i < badnames.length; i++) {
- if (currentName.equals(badnames[i])) {
- return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationWizardPage_bad_name, currentName);
- }
- }
- }
- // See if name contains any characters that we deem illegal.
- // '@' and '&' are disallowed because they corrupt menu items.
- char[] disallowedChars = new char[] { '@', '&', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0' };
- for (int i = 0; i < disallowedChars.length; i++) {
- char c = disallowedChars[i];
- if (currentName.indexOf(c) > -1) {
- return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationWizardPage_bad_char, c);
- }
- }
-
- if(existingLaunchConfiguration(currentName)) {
- return HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_name_already_exist;
- }
- return null;
- }
-
private String getConfigurationName() {
return nameWidget.getText();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-05-29 13:40:46 UTC (rev 15595)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-05-29 13:43:33 UTC (rev 15596)
@@ -27,7 +27,6 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -38,9 +37,6 @@
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -48,8 +44,8 @@
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
-import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -334,10 +330,9 @@
public static ILaunchConfiguration[] getAffectedLaunchConfigurations(IPath path){
ILaunchConfiguration[] configs = null;
try {
- configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
+ configs = LaunchHelper.findHibernateLaunchConfigs();
List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
for(int i = 0; i < configs.length && configs[i].exists(); i++) {//refactor only hibernate launch configurations
- if (!ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID.equals(configs[i].getType().getIdentifier())) continue;
if (HibernateRefactoringUtil.isConfigurationAffected(configs[i], path)) list.add(configs[i]);
}
configs = list.toArray(new ILaunchConfiguration[list.size()]);
@@ -353,10 +348,9 @@
public static ILaunchConfiguration[] getAffectedLaunchConfigurations(IConnectionProfile profile){
ILaunchConfiguration[] configs = null;
try {
- configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
+ configs = LaunchHelper.findHibernateLaunchConfigs();
List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
for(int i = 0; i < configs.length && configs[i].exists(); i++) {//refactor only hibernate launch configurations
- if (!ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID.equals(configs[i].getType().getIdentifier())) continue;
if (profile.getName().equals(configs[i].getAttribute(IConsoleConfigurationLaunchConstants.CONNECTION_PROFILE_NAME, ""))) //$NON-NLS-1$
list.add(configs[i]);
}
15 years, 7 months
JBoss Tools SVN: r15595 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-29 09:40:46 -0400 (Fri, 29 May 2009)
New Revision: 15595
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
Tests improvements
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-05-29 11:43:14 UTC (rev 15594)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-05-29 13:40:46 UTC (rev 15595)
@@ -36,5 +36,6 @@
org.eclipse.wst.validation,
org.eclipse.jdt.launching,
org.eclipse.jdt.ui,
- org.eclipse.jst.j2ee;bundle-version="1.1.300"
+ org.eclipse.jst.j2ee;bundle-version="1.1.300",
+ org.eclipse.text;bundle-version="3.5.0"
Bundle-Localization: plugin
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-29 11:43:14 UTC (rev 15594)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-29 13:40:46 UTC (rev 15595)
@@ -10,7 +10,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
+import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.MultiTextEdit;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
@@ -63,47 +66,55 @@
public void testSeamComponentRename() throws CoreException {
ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
- TestChangeStructure structure = new TestChangeStructure(ejbProject.getProject(), "/ejbModule/org/domain/"+warProjectName+"/session/TestComponent.java",
- 89, 6, "\"best\"");
+ TestChangeStructure structure = new TestChangeStructure(ejbProject.getProject(), "/ejbModule/org/domain/"+warProjectName+"/session/TestComponent.java");
+ TestTextChange change = new TestTextChange(89, 6, "\"best\"");
+ structure.addTextChange(change);
list.add(structure);
- structure = new TestChangeStructure(warProject, "/WebContent/WEB-INF/components.xml",
- 1106, 4, "best");
+ structure = new TestChangeStructure(warProject, "/WebContent/WEB-INF/components.xml");
+ change = new TestTextChange(1106, 4, "best");
+ structure.addTextChange(change);
+
+ change = new TestTextChange(1934, 4, "best");
+ structure.addTextChange(change);
list.add(structure);
- structure = new TestChangeStructure(warProject, "/WebContent/WEB-INF/components.xml",
- 1934, 4, "best");
- list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
- 420, 11, "@In(\"best\")");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java");
+ change = new TestTextChange(420, 11, "@In(\"best\")");
+ structure.addTextChange(change);
+
+ change = new TestTextChange(389, 8, "(\"best\")");
+ structure.addTextChange(change);
+
+ change = new TestTextChange(455, 16, "@Factory(\"best\")");
+ structure.addTextChange(change);
+
+ change = new TestTextChange(529, 8, "(\"best\")");
+ structure.addTextChange(change);
+
+ change = new TestTextChange(589, 4, "best");
+ structure.addTextChange(change);
+
list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
- 389, 8, "(\"best\")");
- list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
- 455, 16, "@Factory(\"best\")");
- list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
- 529, 8, "(\"best\")");
- list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
- 589, 4, "best");
- list.add(structure);
- structure = new TestChangeStructure(ejbProject, "/ejbModule/seam.properties",
- 0, 4, "best");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/seam.properties");
+ change = new TestTextChange(0, 4, "best");
+ structure.addTextChange(change);
list.add(structure);
- structure = new TestChangeStructure(warProject, "/WebContent/test.xhtml",
- 1088, 4, "best");
+ structure = new TestChangeStructure(warProject, "/WebContent/test.xhtml");
+ change = new TestTextChange(1088, 4, "best");
+ structure.addTextChange(change);
list.add(structure);
- structure = new TestChangeStructure(warProject, "/WebContent/test.jsp",
- 227, 4, "best");
+ structure = new TestChangeStructure(warProject, "/WebContent/test.jsp");
+ change = new TestTextChange(227, 4, "best");
+ structure.addTextChange(change);
list.add(structure);
- structure = new TestChangeStructure(warProject, "/WebContent/test.properties",
- 29, 4, "best");
+ structure = new TestChangeStructure(warProject, "/WebContent/test.properties");
+ change = new TestTextChange(29, 4, "best");
+ structure.addTextChange(change);
list.add(structure);
renameComponent(seamEjbProject, "test", "best", list);
@@ -118,7 +129,9 @@
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
content = FileUtil.readStream(file.getContents());
- assertNotSame(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
+ for(TestTextChange change : changeStructure.getTextChanges()){
+ assertNotSame(change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
+ }
}
assertNotNull("Component " + component.getName() + " does not have java declaration.", component.getJavaDeclaration());
@@ -127,7 +140,22 @@
RenameComponentProcessor processor = new RenameComponentProcessor(component);
processor.setNewComponentName(newName);
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
-
+
+ for(int i = 0; i < rootChange.getChildren().length;i++){
+ TextFileChange fileChange = (TextFileChange)rootChange.getChildren()[i];
+
+ MultiTextEdit edit = (MultiTextEdit)fileChange.getEdit();
+
+ TestChangeStructure change = findChange(changeList, fileChange.getFile());
+ if(change != null){
+ if(change.size() != edit.getChildrenSize()){
+ System.out.println("File - "+fileChange.getFile().getName());
+ System.out.println("Edit size - "+edit.getChildrenSize());
+ }
+ assertEquals(change.size(), edit.getChildrenSize());
+ }
+ }
+
rootChange.perform(new NullProgressMonitor());
JobUtils.waitForIdle();
@@ -139,23 +167,29 @@
String content = null;
content = FileUtil.readStream(file.getContents());
//System.out.println("File - "+file.getName()+" offset - "+changeStructure.getOffset()+" expected - ["+changeStructure.getText()+"] actual - ["+content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength())+"]");
- assertEquals(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
+ for(TestTextChange change : changeStructure.getTextChanges()){
+ assertEquals(change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
+ }
}
}
+
+ private TestChangeStructure findChange(List<TestChangeStructure> changeList, IFile file){
+ for(TestChangeStructure tcs : changeList){
+ if(tcs.getFileName().equals("/"+file.getFullPath().removeFirstSegments(1).toString()))
+ return tcs;
+ }
+ return null;
+ }
class TestChangeStructure{
private IProject project;
private String fileName;
- private int offset;
- private int length;
- private String text;
+ ArrayList<TestTextChange> textChanges = new ArrayList<TestTextChange>();
+
- public TestChangeStructure(IProject project, String fileName, int offset, int length, String text){
+ public TestChangeStructure(IProject project, String fileName){
this.project = project;
this.fileName = fileName;
- this.offset = offset;
- this.length = length;
- this.text = text;
}
public IProject getProject(){
@@ -165,7 +199,32 @@
public String getFileName(){
return fileName;
}
+
+ public ArrayList<TestTextChange> getTextChanges(){
+ return textChanges;
+ }
+
+ public void addTextChange(TestTextChange change){
+ textChanges.add(change);
+ }
+
+ public int size(){
+ return textChanges.size();
+ }
+ }
+
+ class TestTextChange{
+ private int offset;
+ private int length;
+ private String text;
+
+ public TestTextChange(int offset, int length, String text){
+ this.offset = offset;
+ this.length = length;
+ this.text = text;
+ }
+
public int getOffset(){
return offset;
}
15 years, 7 months
JBoss Tools SVN: r15594 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-05-29 07:43:14 -0400 (Fri, 29 May 2009)
New Revision: 15594
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/jbide4337.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/main.css
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4337Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4337
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/jbide4337.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/jbide4337.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/jbide4337.xhtml 2009-05-29 11:43:14 UTC (rev 15594)
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:loadBundle var="msg" basename="dataTable.columns.messages"/>
+<f:loadBundle var="message" basename="extendedDataTable.messages"/>
+
+<link rel="stylesheet" href="${facesContext.externalContext.requestContextPath}/pages/JBIDE/4337/main.css"
+type="text/css"/>
+ <a4j:form>
+ <rich:panel style="width : 1087px; height : 4012px;" styleClass="btn">
+ <f:facet name="header">
+ <h:outputText value="Main Table"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="End of components" />
+ </f:facet>
+ <table>
+ <tr>
+ <td width="30%">Component</td>
+ <td align="center" style="background-color: black; font: bold; color: white;">Problems</td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tooltip" />
+ </f:facet>
+ <h:panelGrid columns="2">
+ <rich:panel id="sample1" styleClass="tooltip-text" bodyClass="rich-laguna-panel-no-header">
+ <p>
+ Here you can see <b>default client-side</b> tool-tip
+ </p>
+ <rich:toolTip>
+ <span style="white-space:nowrap">
+ This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </rich:toolTip>
+ </rich:panel>
+ <rich:panel id="sample2" styleClass="tooltip-text" bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip will <b>follow mouse</b>. Also this tool-tip has a <b>delay 0.5 sec</b>,
+ so be patient!
+ </p>
+ <rich:toolTip followMouse="true" direction="top-right" showDelay="500" styleClass="tooltip">
+ <span style="white-space:nowrap">
+ This tool-tip content also <strong>pre-rendered</strong> to the page.<br/>
+ However, the look of this tool-tip is customized<br/>
+ by styleClass attribute.
+ </span>
+ </rich:toolTip>
+ </rich:panel>
+ <h:form>
+ <rich:panel id="sample3" styleClass="tooltip-text" bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip rendered on server <b>in separate request</b>.
+ </p>
+ <rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip" layout="block">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span style="white-space:nowrap">This tool-tip content was <strong>rendered on server</strong>
+ </span>
+ <h:panelGrid columns="2">
+ <h:outputText style="white-space:nowrap" value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </rich:panel>
+ </h:form>
+ <h:form>
+ <rich:panel id="sample4" styleClass="tooltip-text" bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip will be <b>activated on mouse click</b>. It also has a <b>bottom-left</b> position.
+ </p>
+ <rich:toolTip showEvent="onclick" direction="bottom-left" mode="ajax" styleClass="tooltip" layout="block">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span style="white-space:nowrap">This tool-tip content was <strong>rendered on server</strong><br/></span>
+ <h:panelGrid columns="2">
+ <h:outputText style="white-space:nowrap" value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </rich:panel>
+ </h:form>
+ </h:panelGrid>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tool Bar & Tool Bar Group" />
+ </f:facet>
+ <rich:toolBar contentClass="btn" height="26" itemSeparator="line" separatorClass="btn" styleClass="btn">
+ <rich:toolBarGroup style="font-style:italic;background-color:Cornsilk;text-decoration:overline;font-family:Arial Narrow;font-weight:bolder;" width="500">
+ <h:graphicImage value="images/icons/create_doc.gif" styleClass="pic"/>
+ <h:graphicImage value="images/icons/create_folder.gif" styleClass="pic"/>
+ <h:graphicImage value="images/icons/copy.gif" styleClass="pic"/>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:graphicImage value="images/icons/save.gif" styleClass="pic"/>
+ <h:graphicImage value="images/icons/save_as.gif" styleClass="pic"/>
+ <h:graphicImage value="images/icons/save_all.gif" styleClass="pic"/>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:graphicImage value="images/icons/find.gif" styleClass="pic"/>
+ <h:graphicImage value="images/icons/filter.gif" styleClass="pic"/>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ <h:form>
+ <rich:toolBar height="34" contentStyle="color:PaleVioletRed;font-size:medium;font-style:italic;background-color:FloralWhite;font-family:Arial TUR;font-weight:bolder;"
+ itemSeparator="line" styleClass="evenRow" separatorClass="btn">
+ <rich:toolBarGroup itemSeparator="grid">
+ <h:graphicImage id="edit" value="images/icons/edit.gif" />
+ <h:outputLabel value="Edit" for="edit" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <h:graphicImage id="find" value="images/icons/find.gif" />
+ <h:outputLabel value="Find" for="find" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <h:graphicImage id="filter" value="images/icons/filter.gif" />
+ <h:outputLabel value="Filter" for="filter" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:inputText styleClass="barsearch" />
+ <h:commandButton styleClass="barsearchbutton" onclick="return false;" value="Search" />
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ </h:form>
+ <h:form>
+ <h:panelGrid columns="3" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom : 4px">
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Separator:" />
+ <a4j:commandLink value="Line" reRender="bar">
+ <a4j:actionparam name="gs" value="line" assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid" reRender="bar">
+ <a4j:actionparam name="gs" value="grid" assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc" reRender="bar">
+ <a4j:actionparam name="gs" value="disc" assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square" reRender="bar">
+ <a4j:actionparam name="gs" value="square" assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None" reRender="bar">
+ <a4j:actionparam name="gs" value="none" assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ <h:panelGroup style="padding-left : 4px">
+ <br/>
+ </h:panelGroup>
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Item Separator:" />
+ <a4j:commandLink value="Line" reRender="bar">
+ <a4j:actionparam name="gs" value="line" assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid" reRender="bar">
+ <a4j:actionparam name="gs" value="grid" assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc" reRender="bar">
+ <a4j:actionparam name="gs" value="disc" assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square" reRender="bar">
+ <a4j:actionparam name="gs" value="square" assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None" reRender="bar">
+ <a4j:actionparam name="gs" value="none" assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+ </h:form>
+
+ <rich:toolBar contentClass="btn" contentStyle="color:PaleVioletRed;font-size:medium;font-style:italic;background-color:FloralWhite;font-family:Arial TUR;font-weight:bolder;" id="bar" height="30" itemSeparator="#{tbBean.groupSeparator}" style="color:Cornsilk;font-style:italic;background-color:Orchid;text-decoration:underline;font-family:Arial Narrow,Bodoni MT;font-weight:bold;">
+ <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group1.1"></h:outputText>
+ <h:outputText value="Group1.2"></h:outputText>
+ <h:outputText value="Group1.3"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group2.1"></h:outputText>
+ <h:outputText value="Group2.2"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right" itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group3.1"></h:outputText>
+ <h:outputText value="Group3.2"></h:outputText>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tooltip" />
+ </f:facet>
+ <rich:togglePanel id="panel" initialState="panelB" switchType="client"
+
+ stateOrder="panelA,panelB,panelC">
+
+ <f:facet name="panelA">
+
+ ...
+
+ </f:facet>
+
+ <f:facet name="panelB">
+
+ ...
+
+ </f:facet>
+
+ <f:facet name="panelC">
+
+ ...
+
+ </f:facet>
+
+ </rich:togglePanel>
+
+ <rich:toggleControl for="panel" value="Switch" style=""/>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+ <rich:panel style="text-align:center">
+ <h:outputLink value="${facesContext.externalContext.requestContextPath}/pages/allComponents3.jsf">
+ <f:verbatim>PREVIUOS PAGE</f:verbatim>
+ </h:outputLink>
+ </rich:panel>
+ </a4j:form>
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/main.css
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/main.css (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4337/main.css 2009-05-29 11:43:14 UTC (rev 15594)
@@ -0,0 +1,40 @@
+.evenRow {
+ text-align: center;
+ background-color: green;
+ font-style: italic;
+
+}
+
+.oddRow{
+ text-align: right;
+ background-color: blue;
+ font-style: oblique;
+
+}
+
+.btn {
+ text-align: center;
+ color: DodgerBlue;
+ font-size: x-large;
+ font-style: italic;
+ background-color: Turquoise;
+ border-style: ridge;
+ border-color: DarkViolet;
+ text-decoration: overline;
+ font-weight: bolder;
+ border-width: thick;
+}
+
+
+.btn {
+
+}
+
+.vpe-text {
+ color:red;
+}
+
+#editor {
+ background-color: red;
+
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-29 10:33:22 UTC (rev 15593)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-29 11:43:14 UTC (rev 15594)
@@ -57,6 +57,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3734Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3969Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4037Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4337Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4373Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
@@ -142,6 +143,7 @@
suite.addTestSuite(JBIDE4373Test.class);
suite.addTestSuite(JBIDE675Test.class);
suite.addTestSuite(JBIDE3969Test.class);
+ suite.addTestSuite(JBIDE4337Test.class);
// $JUnit-END$
// added by Max Areshkau
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2009-05-29 10:33:22 UTC (rev 15593)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2009-05-29 11:43:14 UTC (rev 15594)
@@ -60,7 +60,8 @@
Job job = new WorkspaceJob("Test JBIDE-1479"){ //$NON-NLS-1$
- public IStatus runInWorkspace(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
new FormatProcessorXML().formatFile(file);
}catch (Throwable exception){
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4337Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4337Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4337Test.java 2009-05-29 11:43:14 UTC (rev 15594)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.swt.custom.StyledText;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE4337Test extends VpeTest {
+
+ public JBIDE4337Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE4337() throws Exception {
+
+ final String testFileName = "JBIDE/4337/jbide4337.xhtml";//$NON-NLS-1$
+ setException(null);
+
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_PROJECT_NAME,testFileName);
+ long headChildCount = vpeController.getVisualBuilder().getHeadNode().getChildNodes().getLength();
+
+ StyledText styledText = vpeController.getSourceEditor().getTextViewer().getTextWidget();
+ int offset = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 11, 23);
+ styledText.setCaretOffset(offset);
+ styledText.insert(" "); //$NON-NLS-1$
+ TestUtil.delay(450);
+ TestUtil.waitForJobs();
+ assertEquals("Number of child nodes should be equal before and after change",headChildCount, //$NON-NLS-1$
+ vpeController.getVisualBuilder().getHeadNode().getChildNodes().getLength());
+
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-05-29 10:33:22 UTC (rev 15593)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-05-29 11:43:14 UTC (rev 15594)
@@ -1039,9 +1039,11 @@
} else {
// Max Areshkau Why we need update parent node when we update text
// node?
- // lookd like we haven't need do it.
+ // looks like we haven't need do it.
if (sourceNode.getNodeType() == Node.TEXT_NODE) {
updateNode(sourceNode.getParentNode());
+ }else if(HTML.TAG_LINK.equalsIgnoreCase(sourceNode.getNodeName())) {
+ addNode(sourceNode, null, getHeadNode());
}
}
}
15 years, 7 months
JBoss Tools SVN: r15593 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-29 06:33:22 -0400 (Fri, 29 May 2009)
New Revision: 15593
Modified:
trunk/as/docs/reference/en/modules/runtimes_servers.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-732 -According to the new features of JBoss AS profile docs were updated. </p>
</body></html>
Modified: trunk/as/docs/reference/en/modules/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en/modules/runtimes_servers.xml 2009-05-29 04:24:23 UTC (rev 15592)
+++ trunk/as/docs/reference/en/modules/runtimes_servers.xml 2009-05-29 10:33:22 UTC (rev 15593)
@@ -255,7 +255,7 @@
<property>Edit</property></emphasis>.
</para>
</section>
-
+ </section>
<section>
<title>Servers</title>
<para>WTP servers are eclipse-representations of a backing server installation. They are used to
@@ -334,6 +334,6 @@
url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss forum</ulink>.</para>
</section>
</section>
- </section>
+
</chapter>
15 years, 7 months
JBoss Tools SVN: r15592 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-05-29 00:24:23 -0400 (Fri, 29 May 2009)
New Revision: 15592
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java
Log:
JBIDE-4385
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-05-29 04:01:51 UTC (rev 15591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-05-29 04:24:23 UTC (rev 15592)
@@ -78,6 +78,8 @@
public static String ServerNotFound;
public static String CannotLoadServerPoller;
public static String AddingJMXDeploymentFailed;
+ public static String JMXPauseScannerError;
+ public static String JMXResumeScannerError;
public static String CannotSaveServersStartArgs;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-05-29 04:01:51 UTC (rev 15591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-05-29 04:24:23 UTC (rev 15592)
@@ -58,4 +58,6 @@
ServerNotFound=Server {0} not found.
CannotLoadServerPoller=Error instantiating Server Poller {0}
CannotSaveServersStartArgs=Could not save server start arguments for server {0}.
-AddingJMXDeploymentFailed=Error adding deployment folder to deployment scanner
\ No newline at end of file
+AddingJMXDeploymentFailed=Error adding deployment folder to deployment scanner
+JMXPauseScannerError=JBossTools was unable to pause the JBoss deployment scanner. For optimal performance, verify your version includes an unsecured JMX RMI adaptor
+JMXResumeScannerError=JBossTools was unable to resume the JBoss deployment scanner. For optimal performance, verify your version includes an unsecured JMX RMI adaptor
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-05-29 04:01:51 UTC (rev 15591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-05-29 04:24:23 UTC (rev 15592)
@@ -10,9 +10,17 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.extensions.events;
+import org.eclipse.core.runtime.IStatus;
+
public interface IEventCodes {
- public static final int MAJOR_TYPE_MASK = 0xFF << 24;
+ public static final int ISTATUS_CODE_OK = 0 << 29;
+ public static final int ISTATUS_CODE_INFO = 1 << 29;
+ public static final int ISTATUS_CODE_WARN = 2 << 29;
+ public static final int ISTATUS_CODE_ERROR = 3 << 29;
+
+ public static final int ISTATUS_MASK = 0xE0 << 24; // slot 31 and 32
+ public static final int MAJOR_TYPE_MASK = 0x1F << 24;
public static final int POLLING_CODE = 1 << 24;
public static final int PUBLISHING_CODE = 2 << 24;
public static final int POLLER_MASK = 0xFF << 16;
@@ -35,7 +43,10 @@
public static final int JST_PUBLISHER_CODE = PUBLISHING_CODE | (2 << 16);
public static final int SINGLE_FILE_PUBLISHER_CODE = PUBLISHING_CODE | (3 << 16);
public static final int ADD_DEPLOYMENT_FOLDER = PUBLISHING_CODE | (4<<16);
-
+ public static final int SUSPEND_DEPLOYMENT_SCANNER = PUBLISHING_CODE | ISTATUS_CODE_WARN | (5<<16);
+ public static final int RESUME_DEPLOYMENT_SCANNER = PUBLISHING_CODE | ISTATUS_CODE_WARN | (6<<16);
+
+
// Publishing.JST
public static final int JST_PUB_FULL_SUCCESS = JST_PUBLISHER_CODE | 1;
public static final int JST_PUB_FULL_FAIL = JST_PUBLISHER_CODE | 2;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-05-29 04:01:51 UTC (rev 15591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-05-29 04:24:23 UTC (rev 15592)
@@ -43,9 +43,9 @@
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.tools.jmx.core.IJMXRunnable;
+import org.jboss.tools.jmx.core.JMXException;
/**
*
@@ -187,16 +187,19 @@
protected void publishStart(IProgressMonitor monitor) throws CoreException {
super.publishStart(monitor);
- JMXClassLoaderRepository.getDefault().addConcerned(getServer(), this);
- final boolean suspend = shouldSuspendScanner();
- if( suspend ) {
+ if( shouldSuspendScanner()) {
+ JMXClassLoaderRepository.getDefault().addConcerned(getServer(), this);
IJMXRunnable r = new IJMXRunnable() {
public void run(MBeanServerConnection connection) throws Exception {
- if( suspend )
- suspendDeployment(connection);
+ suspendDeployment(connection);
}
};
- JBossServerConnectionProvider.run(getServer(), r);
+ try {
+ JBossServerConnectionProvider.run(getServer(), r);
+ } catch( JMXException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SUSPEND_DEPLOYMENT_SCANNER, Messages.JMXPauseScannerError, jmxe);
+ ServerLogger.getDefault().log(getServer(), status);
+ }
}
}
@@ -207,15 +210,21 @@
resumeDeployment(connection);
}
};
- JBossServerConnectionProvider.run(getServer(), r);
+ try {
+ JBossServerConnectionProvider.run(getServer(), r);
+ } catch( JMXException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.RESUME_DEPLOYMENT_SCANNER, Messages.JMXResumeScannerError, jmxe);
+ ServerLogger.getDefault().log(getServer(), status);
+ } finally {
+ JMXClassLoaderRepository.getDefault().removeConcerned(getServer(), this);
+ }
}
- JMXClassLoaderRepository.getDefault().removeConcerned(getServer(), this);
super.publishFinish(monitor);
}
protected boolean shouldSuspendScanner() {
- if( getServer().getServerType().getId().equals(IConstants.AS_50))
- return false;
+// if( getServer().getServerType().getId().equals(IConstants.AS_50))
+// return false;
if( getServer().getServerState() != IServer.STATE_STARTED)
return false;
return true;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java 2009-05-29 04:01:51 UTC (rev 15591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java 2009-05-29 04:24:23 UTC (rev 15592)
@@ -32,6 +32,17 @@
if( element instanceof LogEntry) {
int code = ((LogEntry)element).getCode();
+ int istatusCode = (code & IEventCodes.ISTATUS_MASK) >> 29;
+
+
+ if(istatusCode != 0 ) {
+ switch(istatusCode) {
+ case 1: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ case 2: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ case 3: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ }
+ }
+
int majorType = code & IEventCodes.MAJOR_TYPE_MASK;
switch(majorType) {
case IEventCodes.POLLING_CODE:
15 years, 7 months
JBoss Tools SVN: r15591 - in branches/jbosstools-3.0.x/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-05-29 00:01:51 -0400 (Fri, 29 May 2009)
New Revision: 15591
Modified:
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java
Log:
/JBIDE-4385
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-05-29 02:25:21 UTC (rev 15590)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-05-29 04:01:51 UTC (rev 15591)
@@ -29,6 +29,8 @@
public static String server;
public static String runtime;
public static String runModeNotSupported;
+ public static String JMXPauseScannerError;
+ public static String JMXResumeScannerError;
static {
NLS.initializeMessages(JBossServerCorePlugin.PLUGIN_ID + ".Messages",
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-05-29 02:25:21 UTC (rev 15590)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-05-29 04:01:51 UTC (rev 15591)
@@ -1,4 +1,6 @@
jboss=JBoss
server=Server
runtime=Runtime
-runModeNotSupported=Selected VM does not support this mode
\ No newline at end of file
+runModeNotSupported=Selected VM does not support this mode
+JMXPauseScannerError=JBossTools was unable to pause the JBoss deployment scanner. For optimal performance, verify your version includes an unsecured JMX RMI adaptor
+JMXResumeScannerError=JBossTools was unable to resume the JBoss deployment scanner. For optimal performance, verify your version includes an unsecured JMX RMI adaptor
\ No newline at end of file
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-05-29 02:25:21 UTC (rev 15590)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-05-29 04:01:51 UTC (rev 15591)
@@ -1,8 +1,16 @@
package org.jboss.ide.eclipse.as.core.extensions.events;
+import org.eclipse.core.runtime.IStatus;
+
public interface IEventCodes {
- public static final int MAJOR_TYPE_MASK = 0xFF << 24;
+ public static final int ISTATUS_CODE_OK = 0 << 29;
+ public static final int ISTATUS_CODE_INFO = 1 << 29;
+ public static final int ISTATUS_CODE_WARN = 2 << 29;
+ public static final int ISTATUS_CODE_ERROR = 3 << 29;
+
+ public static final int ISTATUS_MASK = 0xE0 << 24; // slot 31 and 32
+ public static final int MAJOR_TYPE_MASK = 0x1F << 24;
public static final int POLLING_CODE = 1 << 24;
public static final int PUBLISHING_CODE = 2 << 24;
public static final int POLLER_MASK = 0xFF << 16;
@@ -25,7 +33,10 @@
public static final int JST_PUBLISHER_CODE = PUBLISHING_CODE | (2 << 16);
public static final int SINGLE_FILE_PUBLISHER_CODE = PUBLISHING_CODE | (3 << 16);
public static final int ADD_DEPLOYMENT_FOLDER = PUBLISHING_CODE | (4<<16);
-
+ public static final int SUSPEND_DEPLOYMENT_SCANNER = PUBLISHING_CODE | ISTATUS_CODE_WARN | (5<<16);
+ public static final int RESUME_DEPLOYMENT_SCANNER = PUBLISHING_CODE | ISTATUS_CODE_WARN | (6<<16);
+
+
// Publishing.JST
public static final int JST_PUB_FULL_SUCCESS = JST_PUBLISHER_CODE | 1;
public static final int JST_PUB_FULL_FAIL = JST_PUBLISHER_CODE | 2;
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-05-29 02:25:21 UTC (rev 15590)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-05-29 04:01:51 UTC (rev 15591)
@@ -36,6 +36,7 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JBossServerConnectionProvider;
@@ -44,6 +45,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
import org.jboss.tools.jmx.core.IJMXRunnable;
+import org.jboss.tools.jmx.core.JMXException;
/**
*
@@ -190,16 +192,19 @@
protected void publishStart(IProgressMonitor monitor) throws CoreException {
super.publishStart(monitor);
- JMXClassLoaderRepository.getDefault().addConcerned(getServer(), this);
- final boolean suspend = shouldSuspendScanner();
- if( suspend ) {
+ if( shouldSuspendScanner()) {
+ JMXClassLoaderRepository.getDefault().addConcerned(getServer(), this);
IJMXRunnable r = new IJMXRunnable() {
public void run(MBeanServerConnection connection) throws Exception {
- if( suspend )
- suspendDeployment(connection);
+ suspendDeployment(connection);
}
};
- JBossServerConnectionProvider.run(getServer(), r);
+ try {
+ JBossServerConnectionProvider.run(getServer(), r);
+ } catch( JMXException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SUSPEND_DEPLOYMENT_SCANNER, Messages.JMXPauseScannerError, jmxe);
+ ServerLogger.getDefault().log(getServer(), status);
+ }
}
}
@@ -210,15 +215,21 @@
resumeDeployment(connection);
}
};
- JBossServerConnectionProvider.run(getServer(), r);
+ try {
+ JBossServerConnectionProvider.run(getServer(), r);
+ } catch( JMXException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.RESUME_DEPLOYMENT_SCANNER, Messages.JMXResumeScannerError, jmxe);
+ ServerLogger.getDefault().log(getServer(), status);
+ } finally {
+ JMXClassLoaderRepository.getDefault().removeConcerned(getServer(), this);
+ }
}
- JMXClassLoaderRepository.getDefault().removeConcerned(getServer(), this);
super.publishFinish(monitor);
}
protected boolean shouldSuspendScanner() {
- if( getServer().getServerType().getId().equals("org.jboss.ide.eclipse.as.50"))
- return false;
+// if( getServer().getServerType().getId().equals("org.jboss.ide.eclipse.as.50"))
+// return false;
if( getServer().getServerState() != IServer.STATE_STARTED)
return false;
return true;
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java 2009-05-29 02:25:21 UTC (rev 15590)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/LogLabelProvider.java 2009-05-29 04:01:51 UTC (rev 15591)
@@ -17,6 +17,8 @@
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.views.ServerLogView.EventCategory;
+import sun.security.util.BitArray;
+
public class LogLabelProvider extends LabelProvider implements ITableLabelProvider {
public Image getImage(Object element) {
if( element instanceof EventCategory ) {
@@ -28,8 +30,17 @@
}
- if( element instanceof LogEntry) {
+ if( element instanceof LogEntry) {
int code = ((LogEntry)element).getCode();
+ int istatusCode = (code & IEventCodes.ISTATUS_MASK) >> 29;
+
+ if(istatusCode != 0 ) {
+ switch(istatusCode) {
+ case 1: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ case 2: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ case 3: return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ }
+ }
int majorType = code & IEventCodes.MAJOR_TYPE_MASK;
switch(majorType) {
case IEventCodes.POLLING_CODE:
15 years, 7 months
JBoss Tools SVN: r15590 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: icons/16 and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-05-28 22:25:21 -0400 (Thu, 28 May 2009)
New Revision: 15590
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/input.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/output.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/InputParameterListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/OutputParameterListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ParameterTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SubprocessTaskTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddChildHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddInputParameterHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddOutputParameterHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/InputParameter.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/OutputParameter.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Parameter.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterExpressionSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterInnerVariableSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterLanguageSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterOuterVariableSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SequenceFlowOutcomeValueSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/SequenceFlowOutcomeValueFilter.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SubprocessTask.java
Log:
support subprocess elements (GPD-327)
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/input.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/input.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/output.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/output.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-29 02:25:21 UTC (rev 15590)
@@ -258,6 +258,20 @@
label="event"
language="org.jboss.tools.flow.jpdl4">
</element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.InputParameter"
+ figure="icons/16/input.gif"
+ id="org.jboss.tools.flow.jpdl4.inputParameter"
+ label="input parameter"
+ language="org.jboss.tools.flow.jpdl4">
+ </element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.OutputParameter"
+ figure="icons/16/output.gif"
+ id="org.jboss.tools.flow.jpdl4.outputParameter"
+ label="output parameter"
+ language="org.jboss.tools.flow.jpdl4">
+ </element>
</extension>
<extension
point="org.eclipse.ui.newWizards">
@@ -438,6 +452,13 @@
<input type="org.jboss.tools.flow.jpdl4.model.SequenceFlow"/>
</propertySection>
<propertySection
+ afterSection="org.jboss.tools.jpdl4.sequenceFlow.timer"
+ class="org.jboss.tools.flow.jpdl4.properties.SequenceFlowOutcomeValueSection"
+ filter="org.jboss.tools.jpdl4.properties.SequenceFlowOutcomeValueFilter"
+ id="org.jboss.tools.jpdl4.sequenceFlow.outcome"
+ tab="org.jboss.tools.jpdl4.general">
+ </propertySection>
+ <propertySection
afterSection="org.jboss.tools.jpdl4.name"
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskClassSection"
id="org.jboss.tools.jpdl4.javaTask.class"
@@ -486,6 +507,60 @@
tab="org.jboss.tools.jpdl4.general">
<input type="org.jboss.tools.flow.jpdl4.model.ScriptTask"/>
</propertySection>
+ <propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterOuterVariableSection"
+ id="org.jboss.tools.jpdl4.inputParameter.outerVariable"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.InputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.inputParameter.outerVariable"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterInnerVariableSection"
+ id="org.jboss.tools.jpdl4.inputParameter.innerVariable"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.InputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.inputParameter.innerVariable"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterExpressionSection"
+ id="org.jboss.tools.jpdl4.inputParameter.expression"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.InputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.inputParameter.expression"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterLanguageSection"
+ id="org.jboss.tools.jpdl4.inputParameter.language"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.InputParameter"/>
+ </propertySection>
+ <propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterInnerVariableSection"
+ id="org.jboss.tools.jpdl4.outputParameter.innerVariable"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.outputParameter.innerVariable"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterOuterVariableSection"
+ id="org.jboss.tools.jpdl4.outputParameter.outerVariable"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.outputParameter.outerVariable"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterExpressionSection"
+ id="org.jboss.tools.jpdl4.outputParameter.expression"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.outputParameter.expression"
+ class="org.jboss.tools.flow.jpdl4.properties.ParameterLanguageSection"
+ id="org.jboss.tools.jpdl4.outputParameter.language"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
+ </propertySection>
</propertySections>
</extension>
<extension
@@ -525,6 +600,18 @@
</command>
<command
categoryId="org.jboss.tools.flow.jpdl4"
+ defaultHandler="org.jboss.tools.flow.jpdl4.handler.AddInputParameterHandler"
+ id="org.jboss.tools.flow.jpdl4.addInputParameter"
+ name="Add Input Parameter">
+ </command>
+ <command
+ categoryId="org.jboss.tools.flow.jpdl4"
+ defaultHandler="org.jboss.tools.flow.jpdl4.handler.AddOutputParameterHandler"
+ id="org.jboss.tools.flow.jpdl4.addOutputParameter"
+ name="Add Output Parameter">
+ </command>
+ <command
+ categoryId="org.jboss.tools.flow.jpdl4"
defaultHandler="org.jboss.tools.flow.jpdl4.handler.DeleteElementHandler"
id="org.jboss.tools.flow.jpdl4.delete"
name="Delete">
@@ -597,6 +684,44 @@
</iterate>
</visibleWhen>
</command>
+ <command
+ commandId="org.jboss.tools.flow.jpdl4.addInputParameter"
+ icon="icons/16/input.gif"
+ id="org.jboss.tools.flow.jpdl4.addInputParameter"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <iterate>
+ <or>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.SubprocessTaskTreeRootEditPart">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.InputParameterListTreeEditPart">
+ </instanceof>
+ </or>
+ </iterate>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.flow.jpdl4.addOutputParameter"
+ icon="icons/16/output.gif"
+ id="org.jboss.tools.flow.jpdl4.addOutputParameter"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <iterate>
+ <or>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.SubprocessTaskTreeRootEditPart">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.OutputParameterListTreeEditPart">
+ </instanceof>
+ </or>
+ </iterate>
+ </visibleWhen>
+ </command>
<separator
name="org.jboss.tools.flow.jpdl4.details.separator1"
visible="true">
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -23,7 +23,10 @@
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
+import org.jboss.tools.flow.jpdl4.model.InputParameter;
import org.jboss.tools.flow.jpdl4.model.JavaTask;
+import org.jboss.tools.flow.jpdl4.model.OutputParameter;
+import org.jboss.tools.flow.jpdl4.model.Parameter;
import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.model.ScriptTask;
import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
@@ -173,6 +176,30 @@
}
}
+ class ParameterAttributeHandler extends DefaultAttributeDeserializer {
+ protected List<String> getAttributesToRead() {
+ List<String> result = super.getAttributesToRead();
+ result.add(Parameter.VAR);
+ result.add(Parameter.SUBVAR);
+ result.add(Parameter.EXPR);
+ result.add(Parameter.LANG);
+ return result;
+ }
+ protected String getXmlName(String attributeName) {
+ if (Parameter.VAR.equals(attributeName)) {
+ return "var";
+ } else if (Parameter.SUBVAR.equals(attributeName)) {
+ return "subvar";
+ } else if (Parameter.EXPR.equals(attributeName)) {
+ return "expr";
+ } else if (Parameter.LANG.equals(attributeName)) {
+ return "lang";
+ } else {
+ return super.getXmlName(attributeName);
+ }
+ }
+ }
+
class SubprocessTaskAttributeHandler extends NodeAttributeHandler {
protected List<String> getAttributesToRead() {
List<String> result = super.getAttributesToRead();
@@ -275,8 +302,17 @@
if (duedate != null && !("".equals(duedate))) {
parent.setPropertyValue(SequenceFlow.TIMER, duedate);
}
+ } else if ("outcome-value".equals(node.getNodeName())) {
+ NodeList nodeList = ((Element)node).getElementsByTagName("string");
+ if (nodeList.getLength() == 1) {
+ String value = ((Element)nodeList.item(0)).getAttribute("value");
+ if (value != null && !("".equals("value"))) {
+ parent.setPropertyValue(SequenceFlow.OUTCOME_VALUE, value);
+ }
+ }
+ } else {
+ result = createWrapper((Element)node);
}
- result = createWrapper((Element)node);
if (result == null) return null;
if (result instanceof Wrapper) {
if (result.getElement() instanceof EventListener) {
@@ -325,6 +361,19 @@
}
}
+ class SubprocessTaskChildNodeHandler extends NodeChildNodeHandler {
+ public Wrapper deserializeChildNode(Wrapper parent, Node node) {
+ Wrapper result = super.deserializeChildNode(parent, node);
+ if (result == null) return result;
+ if (result.getElement() instanceof InputParameter) {
+ parent.addChild(SubprocessTask.INPUT_PARAMETERS, result);
+ } else if (result.getElement() instanceof OutputParameter) {
+ parent.addChild(SubprocessTask.OUTPUT_PARAMETERS, result);
+ }
+ return result;
+ }
+ }
+
class EventListenerContainerChildNodeHandler implements ChildNodeDeserializer {
public Wrapper deserializeChildNode(Wrapper parent, Node node) {
Wrapper result = null;
@@ -486,6 +535,8 @@
return new EventListenerContainerAttributeHandler();
} else if (element instanceof EventListener) {
return new EventListenerAttributeHandler();
+ } else if (element instanceof Parameter) {
+ return new ParameterAttributeHandler();
}
return null;
}
@@ -528,6 +579,8 @@
return new ExclusiveGateWayChildNodeHandler();
} else if (element instanceof ScriptTask) {
return new ScriptTaskChildNodeHandler();
+ } else if (element instanceof SubprocessTask) {
+ return new SubprocessTaskChildNodeHandler();
} else {
return new NodeChildNodeHandler();
}
@@ -563,6 +616,8 @@
else if ("timer".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.timer";
else if ("on".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.eventListenerContainer";
else if ("event-listener".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.eventListener";
+ else if ("parameter-in".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.inputParameter";
+ else if ("parameter-out".equals(nodeName)) return "org.jboss.tools.flow.jpdl4.outputParameter";
else return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -169,15 +169,15 @@
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
);
entries.add(combined);
-// combined = new CombinedTemplateCreationEntry(
-// "sub-process",
-// "Create a new Subprocess",
-// "org.jboss.tools.flow.jpdl4.subprocess",
-// ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.subprocessTask"),
-// ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/task_empty.png")),
-// ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
-// );
-// entries.add(combined);
+ combined = new CombinedTemplateCreationEntry(
+ "sub-process",
+ "Create a new Subprocess",
+ "org.jboss.tools.flow.jpdl4.subprocess",
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.subprocessTask"),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/task_empty.png")),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
+ );
+ entries.add(combined);
return entries;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -38,9 +38,12 @@
import org.jboss.tools.flow.jpdl4.model.ForkParallelGateway;
import org.jboss.tools.flow.jpdl4.model.HqlTask;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
+import org.jboss.tools.flow.jpdl4.model.InputParameter;
import org.jboss.tools.flow.jpdl4.model.JavaTask;
import org.jboss.tools.flow.jpdl4.model.JoinParallelGateway;
import org.jboss.tools.flow.jpdl4.model.MailTask;
+import org.jboss.tools.flow.jpdl4.model.OutputParameter;
+import org.jboss.tools.flow.jpdl4.model.Parameter;
import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.model.ProcessNode;
import org.jboss.tools.flow.jpdl4.model.ScriptTask;
@@ -202,6 +205,8 @@
else if ("org.jboss.tools.flow.jpdl4.timer".equals(elementId)) return "timer";
else if ("org.jboss.tools.flow.jpdl4.eventListenerContainer".equals(elementId)) return "on";
else if ("org.jboss.tools.flow.jpdl4.eventListener".equals(elementId)) return "event-listener";
+ else if ("org.jboss.tools.flow.jpdl4.inputParameter".equals(elementId)) return "parameter-in";
+ else if ("org.jboss.tools.flow.jpdl4.outputParameter".equals(elementId)) return "parameter-out";
else return null;
}
@@ -272,6 +277,12 @@
appendPadding(buffer, level + 1);
buffer.append("<timer duedate=\"" + timer + "\"/>");
}
+ String outcome = (String)wrapper.getPropertyValue(SequenceFlow.OUTCOME_VALUE);
+ if (outcome != null && !("".equals(outcome))) {
+ buffer.append("\n");
+ appendPadding(buffer, level + 1);
+ buffer.append("<outcome-value><string value=\"" + outcome + "\"/></outcome-value>");
+ }
List<Element> eventListeners = wrapper.getChildren("listener");
if (eventListeners != null) {
for (Element eventListener : eventListeners) {
@@ -506,9 +517,32 @@
}
}
+ class ParameterWrapperSerializer extends AbstractWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ ArrayList<String> result = new ArrayList<String>();
+ result.add("var");
+ result.add("subvar");
+ result.add("expr");
+ result.add("lang");
+ return result;
+ }
+ protected String getPropertyName(String attributeName) {
+ if ("var".equals(attributeName)) {
+ return Parameter.VAR;
+ } else if ("subvar".equals(attributeName)) {
+ return Parameter.SUBVAR;
+ } else if ("expr".equals(attributeName)) {
+ return Parameter.EXPR;
+ } else if ("lang".equals(attributeName)) {
+ return Parameter.LANG;
+ }
+ return super.getPropertyName(attributeName);
+ }
+ }
+
class SubprocessTaskWrapperSerializer extends ProcessNodeWrapperSerializer {
protected List<String> getAttributesToSave() {
- ArrayList<String> result = new ArrayList<String>();
+ List<String> result = super.getAttributesToSave();
result.add("sub-process-id");
result.add("sub-process-key");
result.add("outcome");
@@ -524,6 +558,23 @@
}
return super.getPropertyName(attributeName);
}
+ public void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
+ List<Element> inputParameters = wrapper.getChildren(SubprocessTask.INPUT_PARAMETERS);
+ if (inputParameters != null) {
+ for (Element inputParameter : inputParameters) {
+ if (!(inputParameter instanceof Wrapper)) continue;
+ appendToBuffer(buffer, (Wrapper)inputParameter, level+1);
+ }
+ }
+ List<Element> outputParameters = wrapper.getChildren(SubprocessTask.OUTPUT_PARAMETERS);
+ if (outputParameters != null) {
+ for (Element outputParameter : outputParameters) {
+ if (!(outputParameter instanceof Wrapper)) continue;
+ appendToBuffer(buffer, (Wrapper)outputParameter, level+1);
+ }
+ }
+ super.appendBody(buffer, wrapper, level);
+ }
}
class EventListenerContainerWrapperSerializer extends AbstractWrapperSerializer {
@@ -712,6 +763,8 @@
new EventListenerContainerWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof EventListener) {
new EventListenerWrapperSerializer().appendOpening(buffer, wrapper, level);
+ } else if (element instanceof Parameter) {
+ new ParameterWrapperSerializer().appendOpening(buffer, wrapper, level);
}
}
@@ -812,7 +865,7 @@
buffer.append("</esb>");
} else if (element instanceof HumanTask) {
buffer.append("</task>");
- } else if (element instanceof HumanTask) {
+ } else if (element instanceof SubprocessTask) {
buffer.append("</sub-process>");
} else if (element instanceof ExclusiveGateway) {
buffer.append("</decision>");
@@ -830,6 +883,10 @@
buffer.append("</on>");
} else if (element instanceof EventListener) {
buffer.append("</event-listener>");
+ } else if (element instanceof InputParameter) {
+ buffer.append("</parameter-in>");
+ } else if (element instanceof OutputParameter) {
+ buffer.append("</parameter-out>");
}
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/InputParameterListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/InputParameterListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/InputParameterListTreeEditPart.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,34 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class InputParameterListTreeEditPart extends JpdlTreeEditPart {
+
+ public InputParameterListTreeEditPart(List<Element> parameters) {
+ super(parameters);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/input.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Input Parameters";
+ }
+
+ @SuppressWarnings("unchecked")
+ protected List<Object> getModelChildren() {
+ return (List<Object>)getModel();
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/InputParameterListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -9,6 +9,8 @@
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.model.EventListener;
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.Timer;
@@ -16,17 +18,24 @@
public EditPart createEditPart(EditPart context, Object model) {
if (model instanceof FlowWrapper && context == null) return new ProcessTreeRootEditPart((FlowWrapper)model);
- if (model instanceof NodeWrapper && context == null) return new TaskTreeRootEditPart((NodeWrapper)model);
+ if (model instanceof NodeWrapper && context == null) {
+ Element element = ((NodeWrapper)model).getElement();
+ if (element instanceof SubprocessTask) return new SubprocessTaskTreeRootEditPart((Wrapper)model);
+ return new TaskTreeRootEditPart((NodeWrapper)model);
+ }
if (model instanceof ConnectionWrapper && context == null) return new SequenceFlowTreeRootEditPart((ConnectionWrapper)model);
if (model instanceof Wrapper) {
Element element = ((Wrapper)model).getElement();
if (element instanceof Swimlane) return new SwimlaneTreeEditPart((Wrapper)model);
+ if (element instanceof Parameter) return new ParameterTreeEditPart((Wrapper)model);
if (element instanceof EventListenerContainer) return new EventListenerListTreeEditPart((Wrapper)model);
if (element instanceof EventListener) return new EventListenerTreeEditPart((Wrapper)model);
if (element instanceof Timer) return new TimerTreeEditPart((Wrapper)model);
return new NoDetailsTreeRootEditPart();
}
if (model instanceof SwimlaneListTreeEditPart) return (EditPart)model;
+ if (model instanceof InputParameterListTreeEditPart) return (EditPart)model;
+ if (model instanceof OutputParameterListTreeEditPart) return (EditPart)model;
if (model instanceof TimerListTreeEditPart) return (EditPart)model;
if (model instanceof ListenerListTreeEditPart) return (EditPart)model;
return new NoDetailsTreeRootEditPart();
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/OutputParameterListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/OutputParameterListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/OutputParameterListTreeEditPart.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,34 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class OutputParameterListTreeEditPart extends JpdlTreeEditPart {
+
+ public OutputParameterListTreeEditPart(List<Element> parameters) {
+ super(parameters);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/output.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Output Parameters";
+ }
+
+ @SuppressWarnings("unchecked")
+ protected List<Object> getModelChildren() {
+ return (List<Object>)getModel();
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/OutputParameterListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ParameterTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ParameterTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ParameterTreeEditPart.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,49 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.InputParameter;
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class ParameterTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
+
+ public ParameterTreeEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected Image getImage() {
+ Element element = ((Wrapper)getModel()).getElement();
+ String iconPath = element instanceof InputParameter ? "icons/16/input.gif" : "icons/16/output.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ Element element = ((Wrapper)getModel()).getElement();
+ String property = element instanceof InputParameter ? Parameter.VAR : Parameter.SUBVAR;
+ String variable = (String)((Wrapper)getModel()).getPropertyValue(property);
+ return variable == null || "".equals(variable) ? "variable" : variable;
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == Wrapper.CHANGE_PROPERTY) {
+ refreshVisuals();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ ((Wrapper)getModel()).addListener(this);
+ }
+
+ public void deactivate() {
+ ((Wrapper)getModel()).removeListener(this);
+ super.deactivate();
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ParameterTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SubprocessTaskTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SubprocessTaskTreeRootEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SubprocessTaskTreeRootEditPart.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,39 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
+
+public class SubprocessTaskTreeRootEditPart extends TaskTreeRootEditPart {
+
+ public SubprocessTaskTreeRootEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected List<Object> getModelChildren() {
+ List<Object> result = new ArrayList<Object>();
+ addInputParameters(result, (Wrapper)getModel());
+ addOutputParameters(result, (Wrapper)getModel());
+ result.addAll(super.getModelChildren());
+ return result;
+ }
+
+ private void addInputParameters(List<Object> list, Wrapper wrapper) {
+ List<Element> inputParameters = wrapper.getChildren(SubprocessTask.INPUT_PARAMETERS);
+ if (inputParameters != null && !inputParameters.isEmpty()) {
+ list.add(new InputParameterListTreeEditPart(inputParameters));
+ }
+ }
+
+ private void addOutputParameters(List<Object> list, Wrapper wrapper) {
+ List<Element> outputParameters = wrapper.getChildren(SubprocessTask.OUTPUT_PARAMETERS);
+ if (outputParameters != null && !outputParameters.isEmpty()) {
+ list.add(new OutputParameterListTreeEditPart(outputParameters));
+ }
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SubprocessTaskTreeRootEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddChildHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddChildHandler.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddChildHandler.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,58 @@
+package org.jboss.tools.flow.jpdl4.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.flow.common.command.AddChildCommand;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public abstract class AddChildHandler extends AbstractHandler implements IHandler {
+
+ protected abstract String getChildId();
+ protected abstract String getChildType();
+
+ private Wrapper getParent(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ if (page == null) return null;
+ ISelection selection = page.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return null;
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Object first = structuredSelection.getFirstElement();
+ if (!(first instanceof EditPart)) return null;
+ EditPart editPart = (EditPart)first;
+ while (editPart != null) {
+ Object model = editPart.getModel();
+ if (model != null && model instanceof Wrapper) {
+ return (Wrapper)model;
+ }
+ editPart = editPart.getParent();
+ }
+ return null;
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Wrapper parent = getParent(event);
+ IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+ if (editorPart == null) return null;
+ Object object = editorPart.getAdapter(CommandStack.class);
+ if (object == null || !(object instanceof CommandStack)) return null;
+ CommandStack commandStack = (CommandStack)object;
+ AddChildCommand addChildCommand = new AddChildCommand();
+ Wrapper child = ElementRegistry.createWrapper(getChildId());
+ addChildCommand.setChild(child);
+ addChildCommand.setType(getChildType());
+ addChildCommand.setParent(parent);
+ commandStack.execute(addChildCommand);
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddChildHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddInputParameterHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddInputParameterHandler.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddInputParameterHandler.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.jpdl4.handler;
+
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
+
+public class AddInputParameterHandler extends AddChildHandler {
+
+ @Override
+ protected String getChildId() {
+ return "org.jboss.tools.flow.jpdl4.inputParameter";
+ }
+
+ @Override
+ protected String getChildType() {
+ return SubprocessTask.INPUT_PARAMETERS;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddInputParameterHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddOutputParameterHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddOutputParameterHandler.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddOutputParameterHandler.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.jpdl4.handler;
+
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
+
+public class AddOutputParameterHandler extends AddChildHandler {
+
+ @Override
+ protected String getChildId() {
+ return "org.jboss.tools.flow.jpdl4.outputParameter";
+ }
+
+ @Override
+ protected String getChildType() {
+ return SubprocessTask.OUTPUT_PARAMETERS;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddOutputParameterHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -19,7 +19,10 @@
import org.jboss.tools.flow.jpdl4.editpart.EventListenerListTreeEditPart;
import org.jboss.tools.flow.jpdl4.model.EventListener;
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
+import org.jboss.tools.flow.jpdl4.model.InputParameter;
+import org.jboss.tools.flow.jpdl4.model.OutputParameter;
import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.Timer;
@@ -61,6 +64,10 @@
}
} else if (child.getElement() instanceof EventListenerContainer) {
deleteChildCommand.setType("eventListener");
+ } else if (child.getElement() instanceof InputParameter) {
+ deleteChildCommand.setType(SubprocessTask.INPUT_PARAMETERS);
+ } else if (child.getElement() instanceof OutputParameter) {
+ deleteChildCommand.setType(SubprocessTask.OUTPUT_PARAMETERS);
}
deleteChildCommand.setParent(parent);
if (deleteChildCommand.canExecute()) {
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/InputParameter.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/InputParameter.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/InputParameter.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+public class InputParameter extends Parameter {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/InputParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/OutputParameter.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/OutputParameter.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/OutputParameter.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+public class OutputParameter extends Parameter {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/OutputParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Parameter.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Parameter.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Parameter.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,107 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.DefaultElement;
+
+public class Parameter extends DefaultElement {
+
+ public static final String VAR = "org.jboss.tools.flow.jpdl4.model.parameter.var";
+ public static final String SUBVAR = "org.jboss.tools.flow.jpdl4.model.parameter.subvar";
+ public static final String EXPR = "org.jboss.tools.flow.jpdl4.model.parameter.expr";
+ public static final String LANG = "org.jboss.tools.flow.jpdl4.model.parameter.lang";
+
+ private String outerVariable;
+ private String innerVariable;
+ private String expression;
+ private String language;
+
+ public Parameter() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public String getOuterVariable() {
+ return outerVariable;
+ }
+
+ public void setOuterVariable(String outerVariable) {
+ this.outerVariable = outerVariable;
+ }
+
+ public String getInnerVariable() {
+ return innerVariable;
+ }
+
+ public void setInnerVariable(String innerVariable) {
+ this.innerVariable = innerVariable;
+ }
+
+ public String getExpression() {
+ return expression;
+ }
+
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ private class PropertySource implements IPropertySource {
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (VAR.equals(id)) {
+ return getOuterVariable();
+ } else if (SUBVAR.equals(id)) {
+ return getInnerVariable();
+ } else if (EXPR.equals(id)) {
+ return getExpression();
+ } else if (LANG.equals(id)) {
+ return getLanguage();
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (VAR.equals(id)) {
+ return getOuterVariable() != null;
+ } else if (SUBVAR.equals(id)) {
+ return getInnerVariable() != null;
+ } else if (EXPR.equals(id)) {
+ return getExpression() != null;
+ } else if (LANG.equals(id)) {
+ return getLanguage() != null;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (VAR.equals(id)) {
+ setOuterVariable((String)value);
+ } else if (SUBVAR.equals(id)) {
+ setInnerVariable((String)value);
+ } else if (EXPR.equals(id)) {
+ setExpression((String)value);
+ } else if (LANG.equals(id)) {
+ setLanguage((String)value);
+ }
+ }
+
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Parameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -12,11 +12,13 @@
public class SequenceFlow extends DefaultConnection {
- public static final String TIMER = "org.jboss.tools.flow.jpdl4.model.eventListenerContainer.timer";
+ public static final String TIMER = "org.jboss.tools.flow.jpdl4.model.sequenceFlow.timer";
+ public static final String OUTCOME_VALUE = "org.jboss.tools.flow.jpdl4.model.sequenceFlow.outcome";
private String name;
private boolean conditional = false;
private String timer;
+ private String outcomeValue;
public SequenceFlow() {
this(null, null);
@@ -43,6 +45,14 @@
this.timer = timer;
}
+ public String getOutcomeValue() {
+ return outcomeValue;
+ }
+
+ public void setOutcomeValue(String outcomeValue) {
+ this.outcomeValue = outcomeValue;
+ }
+
public void setConditional(boolean conditional) {
this.conditional = conditional;
}
@@ -85,6 +95,8 @@
return getName();
} else if (TIMER.equals(id)) {
return getTimer();
+ } else if (OUTCOME_VALUE.equals(id)) {
+ return getOutcomeValue();
}
return null;
}
@@ -94,6 +106,8 @@
return getName() != null;
} else if (TIMER.equals(id)) {
return getTimer() != null;
+ } else if (OUTCOME_VALUE.equals(id)) {
+ return getOutcomeValue() != null;
}
return false;
}
@@ -106,6 +120,8 @@
setName((String)value);
} else if (TIMER.equals(id)) {
setTimer((String)value);
+ } else if (OUTCOME_VALUE.equals(id)) {
+ setOutcomeValue((String)value);
}
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SubprocessTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SubprocessTask.java 2009-05-28 21:04:00 UTC (rev 15589)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SubprocessTask.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -1,5 +1,8 @@
package org.jboss.tools.flow.jpdl4.model;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
@@ -10,11 +13,15 @@
public final static String ID = "org.jboss.tools.flow.jpdl4.model.subprocess.id";
public final static String KEY = "org.jboss.tools.flow.jpdl4.model.subprocess.key";
- public final static String OUTCOME = "org.jboss.tools.flow.jpdl4.model.subprocess.outcome";
+ public final static String OUTCOME = "org.jboss.tools.flow.jpdl4.model.subprocess.outcome";
+ public final static String INPUT_PARAMETERS = "org.jboss.tools.flow.jpdl4.model.subprocess.inputParameters";
+ public final static String OUTPUT_PARAMETERS = "org.jboss.tools.flow.jpdl4.model.subprocess.outputParameters";
private String subprocessId;
private String key;
private String outcome;
+ private List<InputParameter> inputParameters = new ArrayList<InputParameter>();
+ private List<OutputParameter> outputParameters = new ArrayList<OutputParameter>();
public SubprocessTask() {
setMetaData("propertySource", new PropertySource());
@@ -83,6 +90,10 @@
return getKey() != null ? getKey() : "";
} else if (OUTCOME.equals(id)) {
return getOutcome() != null ? getOutcome() : "";
+ } else if (INPUT_PARAMETERS.equals(id)) {
+ return inputParameters;
+ } else if (OUTPUT_PARAMETERS.equals(id)) {
+ return outputParameters;
}
return null;
}
@@ -94,6 +105,10 @@
return getKey() != null;
} else if (OUTCOME.equals(id)) {
return getOutcome() != null;
+ } else if (INPUT_PARAMETERS.equals(id)) {
+ return true;
+ } else if (OUTPUT_PARAMETERS.equals(id)) {
+ return true;
}
return false;
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterExpressionSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterExpressionSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterExpressionSection.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+
+public class ParameterExpressionSection extends TextFieldPropertySection {
+
+ public ParameterExpressionSection() {
+ super(Parameter.EXPR, "Expression");
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterExpressionSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterInnerVariableSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterInnerVariableSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterInnerVariableSection.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+
+public class ParameterInnerVariableSection extends TextFieldPropertySection {
+
+ public ParameterInnerVariableSection() {
+ super(Parameter.SUBVAR, "Subprocess Variable Name");
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterInnerVariableSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterLanguageSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterLanguageSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterLanguageSection.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+
+public class ParameterLanguageSection extends TextFieldPropertySection {
+
+ public ParameterLanguageSection() {
+ super(Parameter.LANG, "Language");
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterLanguageSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterOuterVariableSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterOuterVariableSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterOuterVariableSection.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Parameter;
+
+public class ParameterOuterVariableSection extends TextFieldPropertySection {
+
+ public ParameterOuterVariableSection() {
+ super(Parameter.VAR, "Main Process Variable Name");
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ParameterOuterVariableSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SequenceFlowOutcomeValueSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SequenceFlowOutcomeValueSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SequenceFlowOutcomeValueSection.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
+
+public class SequenceFlowOutcomeValueSection extends TextFieldPropertySection {
+
+ public SequenceFlowOutcomeValueSection() {
+ super(SequenceFlow.OUTCOME_VALUE, "Outcome Value");
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SequenceFlowOutcomeValueSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/SequenceFlowOutcomeValueFilter.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/SequenceFlowOutcomeValueFilter.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/SequenceFlowOutcomeValueFilter.java 2009-05-29 02:25:21 UTC (rev 15590)
@@ -0,0 +1,19 @@
+package org.jboss.tools.jpdl4.properties;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.viewers.IFilter;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.editpart.SequenceFlowGraphicalEditPart;
+import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
+
+public class SequenceFlowOutcomeValueFilter implements IFilter {
+
+ public boolean select(Object toTest) {
+ if (!(toTest instanceof SequenceFlowGraphicalEditPart)) return false;
+ SequenceFlowGraphicalEditPart editPart = (SequenceFlowGraphicalEditPart)toTest;
+ EditPart source = editPart.getSource();
+ Wrapper wrapper = (Wrapper)source.getModel();
+ return wrapper.getElement() instanceof SubprocessTask;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/jpdl4/properties/SequenceFlowOutcomeValueFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months