JBoss Tools SVN: r18948 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-01 11:28:14 -0500 (Tue, 01 Dec 2009)
New Revision: 18948
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4510Test.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4635
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4510Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4510Test.java 2009-12-01 16:27:21 UTC (rev 18947)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4510Test.java 2009-12-01 16:28:14 UTC (rev 18948)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JarEntryFile;
@@ -32,6 +33,8 @@
private static final String JAR_NAME = "WebContent/WEB-INF/lib/mareshkau.jar"; //$NON-NLS-1$
private static final String FILE_NAME = "components/paginator.xhtml"; //$NON-NLS-1$
+ private static final String PACKAGE_NAME = "components"; //$NON-NLS-1$
+ private static final String SHORT_NAME = "paginator.xhtml"; //$NON-NLS-1$
public JBIDE4510Test(String name) {
super(name);
@@ -59,14 +62,15 @@
assertNotNull("Cannot process java project:" //$NON-NLS-1$
+ JsfAllTests.IMPORT_JBIDE3247_PROJECT_NAME, javaProject);
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(jarArchive);
+ IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(jarArchive.getLocation().toString());
/*
* Root element should have the correct type.
*/
if (root instanceof JarPackageFragmentRoot) {
- JarPackageFragmentRoot jarRoot = (JarPackageFragmentRoot) root;
- JarEntryFile jarFile = new JarEntryFile(FILE_NAME);
- jarFile.setParent(jarRoot);
+ JarPackageFragmentRoot jarRoot = (JarPackageFragmentRoot) root;
+ IPackageFragment pf = jarRoot.getPackageFragment(PACKAGE_NAME);
+ JarEntryFile jarFile = new JarEntryFile(SHORT_NAME);
+ jarFile.setParent(pf);
JarEntryEditorInput jarEditorInput = new JarEntryEditorInput(jarFile);
JSPMultiPageEditor editor = openEditor(jarEditorInput);
/*
16 years
JBoss Tools SVN: r18947 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-12-01 11:27:21 -0500 (Tue, 01 Dec 2009)
New Revision: 18947
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-5332
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2009-12-01 16:20:17 UTC (rev 18946)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2009-12-01 16:27:21 UTC (rev 18947)
@@ -32,11 +32,11 @@
org.eclipse.wst.xsl.core,
org.eclipse.zest.core,
org.eclipse.zest.layouts,
- org.eclipse.debug.core;bundle-version="3.5.0",
- org.eclipse.debug.ui;bundle-version="3.5.1",
- org.eclipse.jdt.debug.ui;bundle-version="3.4.1",
- org.eclipse.jdt.junit;bundle-version="3.5.1",
- org.eclipse.ui.console;bundle-version="3.4.0"
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.jdt.junit,
+ org.eclipse.ui.console
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
16 years
JBoss Tools SVN: r18946 - trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-12-01 11:20:17 -0500 (Tue, 01 Dec 2009)
New Revision: 18946
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
Log:
Ongoing update of Hibernate SWTBot tests and SWTBotExt - conflict update 1
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01 15:58:29 UTC (rev 18945)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01 16:20:17 UTC (rev 18946)
@@ -26,7 +26,6 @@
public static final SWTBotExt bot = new SWTBotExt();
public static final SWTUtilExt util = new SWTUtilExt();
public static final SWTEclipseExt eclipse = new SWTEclipseExt();
- public static final SWTDebugExt debug = new SWTDebugExt();
// Views
public static final PackageExplorer packageExplorer = new PackageExplorer();
16 years
JBoss Tools SVN: r18945 - in trunk: hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-12-01 10:58:29 -0500 (Tue, 01 Dec 2009)
New Revision: 18945
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
Removed:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
Log:
Ongoing update of Hibernate SWTBot tests and SWTBotExt
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2009-12-01 15:58:29 UTC (rev 18945)
@@ -14,7 +14,9 @@
org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
- org.jboss.tools.ui.bot.ext;bundle-version="1.0.0"
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
+ org.eclipse.jdt.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
+Import-Package: org.eclipse.jdt.internal.ui
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml 2009-12-01 15:58:29 UTC (rev 18945)
@@ -6,8 +6,13 @@
<appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
+ <!--
<param name="ConversionPattern"
value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ -->
+ <param name="ConversionPattern"
+ value="(%C{1}.java:%L) - %m%n" />
+
</layout>
</appender>
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -10,20 +10,61 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testcase;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.hamcrest.Matcher;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class ConfigurationFileTest extends HibernateTest {
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.createProject();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+
/**
- * TC 02
+ * TC 02 - Create Hibernate Configuration file with predefined variables
*/
@Test
public void createFile() {
+ eclipse.createNew(EntityType.HIBERNATE_CONFIGURATION_FILE);
+
+ eclipse.selectTreeLocation(Project.PROJECT_NAME,"src");
+ bot.textWithLabel(IDELabel.HBConfigurationWizard.FILE_NAME).setText(Project.CONF_FILE_NAME2);
+ bot.button(IDELabel.Button.NEXT).click();
+ // Create new configuration file
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DRIVER_CLASS).setSelection(Project.DRIVER_CLASS);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(Project.JDBC_STRING);
+
+ // Create console configuration
+ Matcher<Button> matcher = WidgetMatcherFactory.withText(IDELabel.HBConsoleWizard.CREATE_CONSOLE_CONFIGURATION);
+ Button button = bot.widget(matcher);
+ SWTBotCheckBox cb = new SWTBotCheckBox(button);
+
+ if (!cb.isChecked())
+ cb.click();
+
+ SWTBotShell shell = bot.activeShell();
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.waitForClosedShell(shell);
}
/**
@@ -31,7 +72,7 @@
*/
@Test
public void editFile() {
-
+ // TODO
}
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -11,59 +11,112 @@
package org.jboss.tools.hibernate.ui.bot.testcase;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class ConsoleTest extends HibernateTest {
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.createProject();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+
+ private SWTBotShell mainShell;
+
/**
- * TC 03
+ * Create console TestCases TC03 - TC16
*/
@Test
- public void createMainTab() {
-
+ public void createConsole() {
+ packageExplorer.selectProject(Project.PROJECT_NAME);
+ eclipse.createNew(EntityType.HIBERNATE_CONSOLE);
+
+ createMainTab();
+ mainShell.activate();
+ createOptionTab();
+ createClasspathTab();
+ createMappingsTab();
+ createCommonTab();
+
+ bot.button(IDELabel.Button.FINISH).click();
}
+
+ /**
+ * TC 03
+ */
+ private void createMainTab() {
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAIN_TAB).activate();
+ bot.textWithLabelInGroup("",IDELabel.HBConsoleWizard.PROJECT_GROUP ).setText(Project.PROJECT_NAME);
+ mainShell = bot.activeShell();
+
+ // Create new configuration file
+ bot.buttonInGroup(IDELabel.HBConsoleWizard.SETUP_BUTTON,IDELabel.HBConsoleWizard.CONFIGURATION_FILE_GROUP).click();
+ bot.button(IDELabel.HBConsoleWizard.CREATE_NEW_BUTTON).click();
+ eclipse.selectTreeLocation(Project.PROJECT_NAME, "src");
+ eclipse.button(IDELabel.Button.NEXT).click();
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DRIVER_CLASS).setSelection(Project.DRIVER_CLASS);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(Project.JDBC_STRING);
+
+ SWTBotShell shell = bot.activeShell();
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.waitForClosedShell(shell);
+ }
/**
* TC 04
*/
- @Test
- public void createOptionTab() {
+ private void createOptionTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.OPTIONS_TAB).activate();
+
+ bot.comboBoxWithLabelInGroup("", IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
}
/**
* TC 05
*/
- @Test
- public void createClasspathTab() {
-
+ private void createClasspathTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.CLASSPATH_TAB).activate();
}
/**
* TC 06
*/
- @Test
- public void createMappingsTab() {
-
+ private void createMappingsTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAPPINGS_TAB).activate();
}
/**
* TC 07
*/
- @Test
- public void createCommonTab() {
-
+ private void createCommonTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.COMMON_TAB).activate();
}
/**
* TC 16
*/
- @Test
+ @Test
public void editConsole() {
-
+ // TODO
}
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -37,7 +37,12 @@
/**
* TC 01 - Create Hibernate Mapping file (when package is selected)
- */
+ * Create new .hbm.xml
+ * ASSERT: No exception
+ * Select Class to map
+ * ASSERT: .hbm.xml must appears in JBoss Editor
+ * Note: 2 Way check Created from package and classes
+ */
@Test
public void createFile() {
createFilesFromPackage();
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -12,6 +12,8 @@
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -23,7 +25,12 @@
*/
@Test
public void createFile() {
-
+ // Create
+ eclipse.createNew(EntityType.HIBERNATE_REVERSE_FILE);
+
+
+ packageExplorer.selectProject(Project.PROJECT_NAME);
+
}
/**
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testsuite;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConfigurationFileTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConsoleTest;
import org.jboss.tools.hibernate.ui.bot.testcase.MappingFileTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -18,12 +20,22 @@
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses( { /*CodeGenerationLauncherTest.class,
- ConfigurationContextTest.class, ConfigurationFileTest.class,
- ConsolePerspectiveTest.class, ConsoleTest.class,
- CriteriaEditorsTest.class, DaliTest.class, JIRATest.class,*/
- MappingFileTest.class/*, MappingsDiagramTest.class,
- ReverseEngineerFileTest.class, ViewsTest.class */})
+/* CodeGenerationLauncherTest.class,
+ ConfigurationContextTest.class,
+ ConfigurationFileTest.class,
+ ConsolePerspectiveTest.class,
+ ConsoleTest.class,
+ CriteriaEditorsTest.class,
+ DaliTest.class,
+ JIRATest.class,
+ MappingFileTest.class,
+ MappingsDiagramTest.class,
+ ReverseEngineerFileTest.class, ViewsTest.class */
+
+@SuiteClasses( { ConfigurationFileTest.class,
+ ConsoleTest.class,
+ MappingFileTest.class})
+
public class HibernateAllTests extends HibernateTest {
@BeforeClass
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -10,38 +10,43 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testsuite;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.hibernate.ui.bot.testcase.Activator;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
public class HibernateTest extends SWTTestExt {
- private static boolean prepared = false;
+ private static boolean finished = false;
+ private static boolean classesCreated = false;
+ private static boolean projectCreated = false;
+
//private static Properties properties;
+
+
- public static void prepare() {
-
- if (prepared == true)
- return;
+ public static void prepare() {
+ createProject();
+ createClasses();
+ }
+
+ public static void createClasses() {
- log.info("Hibernate test preparation started");
- // Load project properties (not needed yet)
- // loadProperties(Activator.PLUGIN_ID);
+ if (classesCreated) return;
- // Show perspective and view
- eclipse.closeView(IDELabel.View.WELCOME);
- eclipse.openPerspective(PerspectiveType.JAVA);
-
- // Create needed project
- // Prepare entity
- JavaProjectEntity projectEntity = new JavaProjectEntity();
- projectEntity.setProjectName(Project.PROJECT_NAME);
- eclipse.createJavaProject(projectEntity);
-
- // Create classes
// Class 1
JavaClassEntity classEntity = new JavaClassEntity();
classEntity.setClassName(Project.CLASS1);
@@ -55,12 +60,74 @@
eclipse.createJavaClass(classEntity);
eclipse.setClassContentFromResource(Activator.PLUGIN_ID, "src", Project.PACKAGE_NAME, Project.CLASS2+".java");
- prepared = true;
- log.info("Hibernate test preparation finished");
+ classesCreated = true;
}
+
+ public static void createProject() {
+
+ if (projectCreated) return;
+
+ eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ bot.activeView();
+
+ System.out.println("View Activated");
+
+ // Show perspective and view
+ eclipse.closeView(IDELabel.View.WELCOME);
+ eclipse.openPerspective(PerspectiveType.JAVA);
- public static void clean() {
+ // Create needed project
+ // Prepare entity
+ JavaProjectEntity projectEntity = new JavaProjectEntity();
+ projectEntity.setProjectName(Project.PROJECT_NAME);
+ eclipse.createJavaProject(projectEntity);
+
+ // add HSQLDB Driver
+ addDriver();
+
+ projectCreated = true;
+ }
+
+ public static void addDriver() {
+ try {
+ addDriverIntoProject();
+ } catch (FileNotFoundException e) {
+ fail(e.getMessage());
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ addDriverClassPath();
+ }
+
+ public static void addDriverClassPath() {
+ // TODO add hsqldb into classpath
+ }
+
+ /**
+ * Add HSQLDB driver into project
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static void addDriverIntoProject() throws FileNotFoundException, IOException {
+ File in = util.getResourceFile(Activator.PLUGIN_ID, "drv","hsqldb.jar");
+ File out = new File(Platform.getLocation() + File.separator + Project.PROJECT_NAME + File.separator + "hsqldb.jar");
+
+ FileChannel inChannel = null;
+ FileChannel outChannel = null;
+
+ inChannel = new FileInputStream(in).getChannel();
+ outChannel = new FileOutputStream(out).getChannel();
+
+ inChannel.transferTo(0, inChannel.size(), outChannel);
+
+ if (inChannel != null) inChannel.close();
+ if (outChannel != null) outChannel.close();
+ }
+
+ public static void clean() {
+ if (finished) return;
+
log.info("Clean finished");
bot.sleep(TIME_10S);
}
-}
+}
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -20,5 +20,10 @@
public static final String CLASS2 = "Order";
public static final String PACKAGE_NAME = "org.jboss.hibernate.test";
public static final String PROJECT_NAME = "HibernateTest";
+ public static final String DB_DIALECT = "HSQL";
+ public static final String DRIVER_CLASS = "org.hsqldb.jdbcDriver";
+ public static final String JDBC_STRING = "jdbc:hsqldb:hsql://localhost/hbtestdb";
+ public static final String HSQLDB_PATH = "/home/jpeterka/lib/hsqldb";
+ public static final String CONF_FILE_NAME2 = "hibernate2.cfg.xml";
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2009-12-01 15:58:29 UTC (rev 18945)
@@ -21,5 +21,6 @@
Export-Package: org.jboss.tools.ui.bot.ext,
org.jboss.tools.ui.bot.ext.entity,
org.jboss.tools.ui.bot.ext.helper,
- org.jboss.tools.ui.bot.ext.types
+ org.jboss.tools.ui.bot.ext.types,
+ org.jboss.tools.ui.bot.ext.view
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml 2009-12-01 15:58:29 UTC (rev 18945)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- WARNING: Eclipse auto-generated file.
+ Any modifications will be overwritten.
+ To include a user specific buildfile here, simply create one in the same
+ directory with the processing instruction <?eclipse.ant.import?>
+ as the first entry and export the buildfile again. -->
+<project basedir="." default="build" name="org.jboss.tools.ui.bot.ext">
+ <property environment="env"/>
+ <property name="ECLIPSE_HOME" value="../../../ide/jbt/eclipse"/>
+ <property name="org.jboss.tools.hibernate.ui.bot.test.location" value="../org.jboss.tools.hibernate.ui.bot.test"/>
+ <property name="debuglevel" value="source,lines,vars"/>
+ <property name="target" value="1.5"/>
+ <property name="source" value="1.5"/>
+ <path id="Plug-in Dependencies.libraryclasspath">
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui_3.5.1.M20090902-1000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swt_3.5.1.v3555a.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swt.gtk.linux.x86_64_3.5.1.v3555a.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.jboss.tools.xulrunner.initializer_1.1.0.v200911050315N-H55-GA.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jface_3.5.1.M20090826-0800.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.commands_3.5.0.I20090525-2000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.workbench_3.5.1.M20090826-0800a.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime_3.5.0.v20090525.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.osgi_3.5.1.R35x_v20090827.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/javax.transaction_1.1.1.v200909161740.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.persistence.jpa.equinox.weaving_1.1.2.v20090612-r4475.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.jobs_3.4.100.v20090429-1800.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800/runtime_registry_compatibility.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.preferences_3.2.300.v20090520-1800.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.app_1.2.0.v20090520-1800.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.core_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.finder_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.spy_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.ui_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.junit4_x_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.swt.finder_2.0.0.433-dev-e35.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest_1.1.0.v20090501071000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.library_1.1.0.v20090501071000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.integration_1.1.0.v20090501071000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.text_1.1.0.v20090501071000.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
+ <pathelement location="${ECLIPSE_HOME}/plugins/org.apache.log4j_1.2.13.v200903072027.jar"/>
+ </path>
+ <path id="org.jboss.tools.ui.bot.ext.classpath">
+ <path refid="Plug-in Dependencies.libraryclasspath"/>
+ <pathelement location="bin"/>
+ </path>
+ <target name="init">
+ <mkdir dir="bin"/>
+ <copy includeemptydirs="false" todir="bin">
+ <fileset dir="src">
+ <exclude name="**/*.launch"/>
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+ </target>
+ <target name="clean">
+ <delete dir="bin"/>
+ </target>
+ <target depends="clean" name="cleanall"/>
+ <target depends="build-subprojects,build-project" name="build"/>
+ <target name="build-subprojects"/>
+ <target depends="init" name="build-project">
+ <echo message="${ant.project.name}: ${ant.file}"/>
+ <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
+ <src path="src"/>
+ <classpath refid="org.jboss.tools.ui.bot.ext.classpath"/>
+ </javac>
+ </target>
+ <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects">
+ <ant antfile="${org.jboss.tools.hibernate.ui.bot.test.location}/build.xml" dir="${org.jboss.tools.hibernate.ui.bot.test.location}" inheritAll="false" target="clean"/>
+ <ant antfile="${org.jboss.tools.hibernate.ui.bot.test.location}/build.xml" dir="${org.jboss.tools.hibernate.ui.bot.test.location}" inheritAll="false" target="build">
+ <propertyset>
+ <propertyref name="build.compiler"/>
+ </propertyset>
+ </ant>
+ </target>
+ <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
+ <copy todir="${ant.library.dir}">
+ <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
+ </copy>
+ <unzip dest="${ant.library.dir}">
+ <patternset includes="jdtCompilerAdapter.jar"/>
+ <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
+ </unzip>
+ </target>
+ <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
+ <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+ <antcall target="build"/>
+ </target>
+</project>
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml 2009-12-01 15:58:29 UTC (rev 18945)
@@ -6,8 +6,12 @@
<appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
+ <!-- <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ -->
<param name="ConversionPattern"
- value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ value="%d{HH:mm:ss} - (%C{1}.java:%L) - %m%n" />
+
</layout>
</appender>
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -14,13 +14,14 @@
import static org.junit.Assert.assertEquals;
import java.io.File;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
@@ -35,14 +36,14 @@
* @author jpeterka
*
*/
-public class SWTEclipseExt {
+public class SWTEclipseExt extends SWTBotExt{
SWTBotExt bot = new SWTBotExt();
SWTUtilExt util = new SWTUtilExt();
- Logger log = Logger.getLogger(SWTEclipseExt.class.getName());
+ Logger log = Logger.getLogger(SWTEclipseExt.class);
// ------------------------------------------------------------
- // Additional missing or more advance methods
+ // View related methods
// ------------------------------------------------------------
/**
* Close view by text
@@ -64,7 +65,9 @@
}
-
+ // ------------------------------------------------------------
+ // Perspective related methods
+ // ------------------------------------------------------------
/**
* Open Perspective
*
@@ -82,12 +85,15 @@
bot.table().select(perspectiveLabel);
// Another approach
- // SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
- // openPerpectiveShell.activate();
+ SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
+ openPerpectiveShell.activate();
bot.button(IDELabel.Button.OK).click();
}
+ // ------------------------------------------------------------
+ // Create related methods
+ // ------------------------------------------------------------
/**
* Create Java Project desribed with propriate entity
* @param entity
@@ -107,6 +113,9 @@
util.waitForNonIgnoredJobs();
}
+ // ------------------------------------------------------------
+ // Create related methods
+ // ------------------------------------------------------------
/**
* Create new Java Class described with JavaClassEntity
* @param entity
@@ -164,7 +173,27 @@
log.info("File Opened:" + builder.toString());
}
+ // ------------------------------------------------------------
+ // Navigation related
+ // ------------------------------------------------------------
+ /**
+ * Select element in tree
+ */
+ public void selectTreeLocation(String... path) {
+ SWTBotTreeItem item = null;
+ // Go through path
+ for ( String nodeName: path ) {
+ if ( item == null ) {
+ item = bot.tree().expandNode(nodeName);
+ } else {
+ item = item.expandNode(nodeName);
+ }
+ log.info(nodeName);
+ }
+ item.select();
+ }
+
// ------------------------------------------------------------
// Subroutines
// ------------------------------------------------------------
@@ -192,6 +221,7 @@
Matcher<Shell> matcher = WidgetMatcherFactory
.withText(shellName);
bot.waitUntil(Conditions.waitForShell(matcher));
+
}
/**
@@ -199,8 +229,15 @@
* @param shellName
*/
public void waitForClosedShell(String shellName) {
- bot.waitWhile(Conditions.shellIsActive(shellName));
+ bot.waitWhile(Conditions.shellIsActive(shellName));
}
+
+ public void waitForClosedShell(SWTBotShell shell) {
+ while (shell.isActive()) {
+ bot.sleep(200);
+ log.info("Waiting for closing shell...");
+ }
+ }
/**
* Assert same content of file in project explorer with content of file in resources
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -13,6 +13,7 @@
import java.util.Properties;
import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
/**
* Base class for SWTBot Tests using SWTBotExt
@@ -21,10 +22,15 @@
*/
public class SWTTestExt {
- public static Logger log = Logger.getLogger(SWTTestExt.class);
- public static SWTBotExt bot = new SWTBotExt();
- public static SWTUtilExt util = new SWTUtilExt();
- public static SWTEclipseExt eclipse = new SWTEclipseExt();
+ public static final Logger log = Logger.getLogger(SWTTestExt.class);
+ public static final SWTBotExt bot = new SWTBotExt();
+ public static final SWTUtilExt util = new SWTUtilExt();
+ public static final SWTEclipseExt eclipse = new SWTEclipseExt();
+ public static final SWTDebugExt debug = new SWTDebugExt();
+
+ // Views
+ public static final PackageExplorer packageExplorer = new PackageExplorer();
+
private static Properties properties;
/**
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -17,7 +17,8 @@
* @author jpeterka
*/
public enum EntityType {
- HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS;
+ HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS, HIBERNATE_REVERSE_FILE, HIBERNATE_CONSOLE,
+ HIBERNATE_CONFIGURATION_FILE;
public String getGroupLabel() {
String groupLabel = "";
@@ -26,7 +27,10 @@
switch (this) {
case HIBERNATE_MAPPING_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
case JAVA_PROJECT: groupLabel = IDELabel.EntityGroup.JAVA; break;
- case JAVA_CLASS: groupLabel = IDELabel.EntityGroup.JAVA; break;
+ case JAVA_CLASS: groupLabel = IDELabel.EntityGroup.JAVA; break;
+ case HIBERNATE_REVERSE_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
+ case HIBERNATE_CONFIGURATION_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
+ case HIBERNATE_CONSOLE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
default: fail("Unknown Entity Type");
}
@@ -42,6 +46,9 @@
switch (this) {
case HIBERNATE_MAPPING_FILE: entityLabel = IDELabel.EntityLabel.HIBERNATE_MAPPING_FILE; break;
+ case HIBERNATE_REVERSE_FILE: entityLabel = IDELabel.EntityLabel.HIBERNATE_REVERSE_FILE; break;
+ case HIBERNATE_CONFIGURATION_FILE: entityLabel = IDELabel.EntityLabel.HIBERNATE_CONFIGURATION_FILE; break;
+ case HIBERNATE_CONSOLE: entityLabel = IDELabel.EntityLabel.HIBERNATE_CONSOLE; break;
case JAVA_PROJECT: entityLabel = IDELabel.EntityLabel.JAVA_PROJECT; break;
case JAVA_CLASS: entityLabel = IDELabel.EntityLabel.JAVA_CLASS; break;
default: fail("Unknown Entity Type");
Deleted: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -1,141 +0,0 @@
- /*******************************************************************************
- * 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.ui.bot.ext.types;
-
-/**
- * Base label constants for all widgets. Naming convention is (except buttons
- * and menus) based on Eclipse platform class names of each part (e.g.
- * NewJavaProjectWizardPageOne)
- *
- * @author jpeterka
- */
-public class IDELabel {
- public class Menu {
- public static final String FILE = "File";
- public static final String NEW = "New";
- public static final String PROJECT = "Project";
- public static final String OTHER = "Other...";
- public static final String WINDOW = "Window";
- public static final String SHOW_VIEW = "Show View";
- public static final String OPEN_PERSPECTIVE = "Open Perspective";
- public static final String OPEN_WITH = "Open With";
- public static final String TEXT_EDITOR = "Text Editor";
- public static final String EDIT = "Edit";
- public static final String SELECT_ALL = "Select All";
- public static final String JSP_FILE = "JSP File";
- public static final String XHTML_FILE = "XHTML File";
- public static final String CLOSE = "Close";
- public static final String OPEN = "Open";
- public static final String RENAME = "Rename";
- public static final String PROPERTIES = "Properties";
- public static final String HELP = "Help";
- public static final String ABOUT_JBOSS_DEVELOPER_STUDIO = "About JBoss Developer Studio";
- }
-
- public class Button {
- public static final String NEXT = "Next >";
- public static final String BACK = "< Back";
- public static final String CANCEL = "Cancel";
- public static final String FINISH = "Finish";
- public static final String OK = "OK";
- public static final String YES = "Yes";
- public static final String NO = "No";
- public static final String CLOSE = "Close";
- }
-
- public class Shell {
- public static final String NEW_JAVA_PROJECT = "New Java Project";
- public static final String NEW_JAVA_CLASS = "New Java Class";
- public static final String NEW_HIBERNATE_MAPPING_FILE = "New Hibernate XML Mapping file (hbm.xml)";
- public static final String NEW = "New";
- public static final String NEW_JSP_FILE = "New File JSP";
- public static final String NEW_XHTML_FILE = "New File XHTML";
- public static final String SAVE_RESOURCE = "Save Resource";
- public static final String RENAME_RESOURCE = "Rename Resource";
- public static final String PROPERTIES = "Properties";
- }
-
- public class EntityGroup {
- public static final String HIBERNATE = "Hibernate";
- public static final String JAVA = "Java";
- public static final String SEAM = "Seam";
- }
-
- public class EntityLabel {
- public static final String HIBERNATE_MAPPING_FILE = "Hibernate XML Mapping file (hbm.xml)";
- public static final String JAVA_CLASS = "Class";
- public static final String JAVA_PROJECT = "Java Project";
- public static final String SEAM_PROJECT = "Seam Web Project";
- }
-
- public class JavaProjectWizard {
- public static final String PROJECT_NAME = "Project name:";
- }
-
- public class NewClassCreationWizard {
- public static final String CLASS_NAME = "Name:";
- public static final String PACKAGE_NAME = "Package:";
- }
-
- public class ShowViewDialog {
- public static final String JAVA_GROUP = "Java";
- public static final String PROJECT_EXPLORER = "Project Explorer";
-
- }
-
- public class View {
- public static final String WELCOME = "Welcome";
- public static final String PROJECT_EXPLORER = "Project Explorer";
- public static final String PACKAGE_EXPLORER = "Package Explorer";
- }
-
- public class ViewGroup {
- public static final String GENERAL = "General";
- public static final String JAVA = "Java";
- }
-
- public class SelectPerspectiveDialog {
- public static final String JAVA = "Java";
- public static final String HIBERNATE = "Hibernate";
-
- }
-
- public class WebProjectsTree {
- public static final String WEB_CONTENT = "WebContent";
- public static final String TAG_LIBRARIES = "Tag Libraries";
- public static final String RESOURCE_BUNDLES = "Resource Bundles";
- public static final String CONFIGURATION = "Configuration";
- public static final String BEANS = "Beans";
- public static final String TILES = "Tiles";
- public static final String WEB_XML = "web.xml";
- public static final String CONTEXT_PARAMS = "Context Params";
- public static final String JAVAX_FACES_CONFIG_FILES = "javax.faces.CONFIG_FILES";
- }
-
- public class NewJSPFileDialog {
- public static final String NAME = "Name*";
- public static final String TEMPLATE = "Template";
- public static final String TEMPLATE_JSF_BASE_PAGE = "JSFBasePage";
- }
-
- public class NewXHTMLFileDialog {
- public static final String NAME = "Name*";
- public static final String TEMPLATE = "Template";
- public static final String TEMPLATE_FACELET_FORM_XHTML = "FaceletForm.xhtml";
- }
- public class RenameResourceDialog {
- public static final String NEW_NAME = "New name:";
- }
- public class PropertiesDialog {
- public static final String PARAM_NAME = "Param-Name";
- public static final String PARAM_VALUE = "Param-Value";
- }
-}
Copied: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java (from rev 18608, trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/Label.java)
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -0,0 +1,123 @@
+ /*******************************************************************************
+ * 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.ui.bot.ext.types;
+
+/**
+ * Base label constants for all widgets. Naming convention is (except buttons
+ * and menus) based on Eclipse platform class names of each part (e.g.
+ * NewJavaProjectWizardPageOne)
+ *
+ * @author jpeterka
+ */
+public class IDELabel {
+ public class Menu {
+ public static final String FILE = "File";
+ public static final String NEW = "New";
+ public static final String PROJECT = "Project";
+ public static final String OTHER = "Other...";
+ public static final String WINDOW = "Window";
+ public static final String SHOW_VIEW = "Show View";
+ public static final String OPEN_PERSPECTIVE = "Open Perspective";
+ public static final String OPEN_WITH = "Open With";
+ public static final String TEXT_EDITOR = "Text Editor";
+ public static final String EDIT = "Edit";
+ public static final String SELECT_ALL = "Select All";
+ }
+
+ public class Button {
+ public static final String NEXT = "Next >";
+ public static final String BACK = "< Back";
+ public static final String CANCEL = "Cancel";
+ public static final String FINISH = "Finish";
+ public static final String OK = "OK";
+ }
+
+ public class Shell {
+ public static final String NEW_JAVA_PROJECT = "New Java Project";
+ public static final String NEW_JAVA_CLASS = "New Java Class";
+ public static final String NEW_HIBERNATE_MAPPING_FILE = "New Hibernate XML Mapping file (hbm.xml)";
+ public static final String NEW = "New";
+ }
+
+ public class EntityGroup {
+ public static final String HIBERNATE = "Hibernate";
+ public static final String JAVA = "Java";
+ public static final String SEAM = "Seam";
+ }
+
+ public class EntityLabel {
+ public static final String HIBERNATE_MAPPING_FILE = "Hibernate XML Mapping file (hbm.xml)";
+ public static final String HIBERNATE_REVERSE_FILE = "Hibernate Reverse Engineering File(reveng.xml)";
+ public static final String HIBERNATE_CONSOLE = "Hibernate Console Configuration";
+ public static final String JAVA_CLASS = "Class";
+ public static final String JAVA_PROJECT = "Java Project";
+ public static final String SEAM_PROJECT = "Seam Web Project";
+ public static final String HIBERNATE_CONFIGURATION_FILE = "Hibernate Configuration File (cfg.xml)";
+ }
+
+ public class JavaProjectWizard {
+ public static final String PROJECT_NAME = "Project name:";
+ }
+
+ public class NewClassCreationWizard {
+ public static final String CLASS_NAME = "Name:";
+ public static final String PACKAGE_NAME = "Package:";
+ }
+
+ public class ShowViewDialog {
+ public static final String JAVA_GROUP = "Java";
+ public static final String PROJECT_EXPLORER = "Project Explorer";
+
+ }
+
+ public class View {
+ public static final String WELCOME = "Welcome";
+ public static final String PROJECT_EXPLORER = "Project Explorer";
+ public static final String PACKAGE_EXPLORER = "Package Explorer";
+ }
+
+ public class ViewGroup {
+ public static final String GENERAL = "General";
+ public static final String JAVA = "Java";
+ }
+
+ public class SelectPerspectiveDialog {
+ public static final String JAVA = "Java";
+ public static final String HIBERNATE = "Hibernate";
+
+ }
+ /**
+ * Hibernate Console Wizard (ConsoleConfigurationCreationWizard) Labels (
+ * @author jpeterka
+ *
+ */
+ public class HBConsoleWizard {
+ public static final String MAIN_TAB = "Main";
+ public static final String OPTIONS_TAB = "Options";
+ public static final String CLASSPATH_TAB = "Classpath";
+ public static final String MAPPINGS_TAB = "Mappings";
+ public static final String COMMON_TAB = "Common";
+ public static final String PROJECT_GROUP = "Project:";
+ public static final String CONFIGURATION_FILE_GROUP = "Configuration file:";
+ public static final String SETUP_BUTTON = "Setup...";
+ public static final String CREATE_NEW_BUTTON = "Create new...";
+ public static final String USE_EXISTING_BUTTON = "Use existing...";
+ public static final String DATABASE_DIALECT = "Database dialect:";
+ public static final String DRIVER_CLASS = "Driver class:";
+ public static final String CONNECTION_URL = "Connection URL:";
+ public static final String USERNAME = "Username:";
+ public static final String CREATE_CONSOLE_CONFIGURATION = "Create a console configuration";
+ }
+
+ public class HBConfigurationWizard {
+ public static final String FILE_NAME = "File name:";
+ }
+}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2009-12-01 10:56:05 UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -18,13 +18,14 @@
*
*/
public enum ViewType {
- PROJECT_EXPLORER, WELCOME;
+ PACKAGE_EXPLORER, PROJECT_EXPLORER, WELCOME;
public String getGroupLabel() {
String viewLabel = "";
switch (this) {
case PROJECT_EXPLORER: viewLabel = IDELabel.ViewGroup.GENERAL; break;
+ case PACKAGE_EXPLORER: viewLabel = IDELabel.ViewGroup.JAVA; break;
default: fail("Unknown View Type");
}
return viewLabel;
@@ -34,6 +35,7 @@
String viewLabel = "";
switch (this) {
case PROJECT_EXPLORER: viewLabel = IDELabel.View.PROJECT_EXPLORER; break;
+ case PACKAGE_EXPLORER: viewLabel = IDELabel.View.PACKAGE_EXPLORER; break;
default: fail("Unknown View Type");
}
return viewLabel;
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java 2009-12-01 15:58:29 UTC (rev 18945)
@@ -0,0 +1,22 @@
+package org.jboss.tools.ui.bot.ext.view;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * Class provides bot routines related to Package Explorer View
+ * @author jpeterka
+ *
+ */
+public class PackageExplorer extends SWTBotExt {
+
+ /*
+ * Selects project in Package Explorer
+ */
+ public void selectProject(String projectName) {
+ SWTBot viewBot = viewByTitle(IDELabel.View.PACKAGE_EXPLORER).bot();
+ viewBot.tree().expandNode(projectName).select();
+ }
+
+}
16 years
JBoss Tools SVN: r18944 - in documentation/trunk/movies: rename_context_variables_properties and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-12-01 05:56:05 -0500 (Tue, 01 Dec 2009)
New Revision: 18944
Added:
documentation/trunk/movies/rename_context_variables_properties/
documentation/trunk/movies/rename_context_variables_properties/readme.txt
documentation/trunk/movies/rename_context_variables_properties/rename_context_variables_properties.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-957 - adding the 'Renaming a Seam Context Variable in EL in the JBoss Tools Properties Editor' demo;
Added: documentation/trunk/movies/rename_context_variables_properties/readme.txt
===================================================================
--- documentation/trunk/movies/rename_context_variables_properties/readme.txt (rev 0)
+++ documentation/trunk/movies/rename_context_variables_properties/readme.txt 2009-12-01 10:56:05 UTC (rev 18944)
@@ -0,0 +1,25 @@
+To apply Jboss org styles to the generated HTML file, you should do next:
+
+
+- first, add the HEAD of the HTML document to attach a style sheet, a tab icon and a title of the page:
+
+ <head>
+ <title>Renaming a Seam Context Variable in EL in the JBoss Tools Properties Editor</title>
+ <link rel="stylesheet" href="../resources/tools.css"
+ type="text/css"/>
+ <link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+ </head>
+
+
+- place the generated by Wink OBJECT inside this block element:
+
+ <div class="book">
+ <p id="title"><a href="http://www.jboss.org" class="site_href">
+ <strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+ <strong>Community Demos</strong></a></p>
+
+ <--! Place the OBJECT generated by Wink here. -->
+
+ </div>
+
+
\ No newline at end of file
Added: documentation/trunk/movies/rename_context_variables_properties/rename_context_variables_properties.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/rename_context_variables_properties/rename_context_variables_properties.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Tools SVN: r18943 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors: editparts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-01 03:23:46 -0500 (Tue, 01 Dec 2009)
New Revision: 18943
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
Log:
JBIDE-5314
Done
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-01 08:16:37 UTC (rev 18942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-01 08:23:46 UTC (rev 18943)
@@ -40,10 +40,12 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.Request;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.commands.CommandStackEvent;
import org.eclipse.gef.commands.CommandStackEventListener;
@@ -93,6 +95,7 @@
import org.jboss.tools.smooks.graphical.editors.autolayout.IAutoLayout;
import org.jboss.tools.smooks.graphical.editors.commands.IgnoreException;
import org.jboss.tools.smooks.graphical.editors.editparts.InputDataContainerEditPart;
+import org.jboss.tools.smooks.graphical.editors.editparts.RightClickSelectMarqueeDragTraker;
import org.jboss.tools.smooks.graphical.editors.editparts.SmooksGraphUtil;
import org.jboss.tools.smooks.graphical.editors.model.IValidatableModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataContianerModel;
@@ -669,7 +672,11 @@
getGraphicalViewer().setEditDomain(editDomain);
getGraphicalViewer().setEditPartFactory(createEdtiPartFactory());
- getGraphicalViewer().setRootEditPart(new FreeformGraphicalRootEditPart());
+ getGraphicalViewer().setRootEditPart(new FreeformGraphicalRootEditPart() {
+ public DragTracker getDragTracker(Request req) {
+ return new RightClickSelectMarqueeDragTraker();
+ }
+ });
getGraphicalViewer().addDropTargetListener(
(TransferDropTargetListener) new TemplateTransferDropTargetListener(getGraphicalViewer()));
@@ -768,7 +775,7 @@
expandConnectedModels(connections);
this.autoLayout(false);
-
+
List<Diagnostic> diagnosticList = this.getSmooksModelProvider().getDiagnosticList();
this.validateEnd(diagnosticList);
}
@@ -1360,8 +1367,8 @@
}
}
-
- protected String getDiagnosticMessage(Diagnostic diagnostic){
+
+ protected String getDiagnosticMessage(Diagnostic diagnostic) {
List<?> datas = diagnostic.getData();
if (datas.size() == 2) {
Object parentObj = datas.get(0);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-12-01 08:16:37 UTC (rev 18942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-12-01 08:23:46 UTC (rev 18943)
@@ -28,11 +28,9 @@
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaMappingActionCreator;
import org.jboss.tools.smooks.model.javabean.BindingsType;
import org.jboss.tools.smooks.model.javabean.ExpressionType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
import org.jboss.tools.smooks.model.javabean.ValueType;
import org.jboss.tools.smooks.model.javabean.WiringType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java 2009-12-01 08:23:46 UTC (rev 18943)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import org.eclipse.gef.tools.MarqueeDragTracker;
+
+/**
+ * @author Dart
+ *
+ */
+public class RightClickSelectMarqueeDragTraker extends MarqueeDragTracker{
+
+ @Override
+ protected boolean handleButtonUp(int button) {
+ int state = getState();
+ setState(STATE_DRAG_IN_PROGRESS);
+ boolean flag = super.handleButtonUp(button);
+ setState(state);
+ return flag;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-12-01 08:16:37 UTC (rev 18942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-12-01 08:23:46 UTC (rev 18943)
@@ -26,7 +26,7 @@
public static final int BEAN_TYPE = 2;
public static final int BINDINGS_TYPE = 1;
-
+
/*
* (non-Javadoc)
*
@@ -42,5 +42,4 @@
DefaultEditDomain editDomain = (DefaultEditDomain) viewer.getEditDomain();
return editDomain.getEditorPart();
}
-
}
16 years
JBoss Tools SVN: r18942 - in branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors: editparts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-01 03:16:37 -0500 (Tue, 01 Dec 2009)
New Revision: 18942
Added:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
Log:
JBIDE-5314
Change the DragTraker for root editpart
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-01 07:41:03 UTC (rev 18941)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-01 08:16:37 UTC (rev 18942)
@@ -40,10 +40,12 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.Request;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.commands.CommandStackEvent;
import org.eclipse.gef.commands.CommandStackEventListener;
@@ -93,6 +95,7 @@
import org.jboss.tools.smooks.graphical.editors.autolayout.IAutoLayout;
import org.jboss.tools.smooks.graphical.editors.commands.IgnoreException;
import org.jboss.tools.smooks.graphical.editors.editparts.InputDataContainerEditPart;
+import org.jboss.tools.smooks.graphical.editors.editparts.RightClickSelectMarqueeDragTraker;
import org.jboss.tools.smooks.graphical.editors.editparts.SmooksGraphUtil;
import org.jboss.tools.smooks.graphical.editors.model.IValidatableModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataContianerModel;
@@ -120,8 +123,9 @@
* @author Dart
*
*/
-public class SmooksGraphicalEditorPart extends GraphicalEditor implements ISelectionChangedListener,
- ISourceSynchronizeListener, IGraphicalEditorPart, ITaskNodeProvider, ISmooksModelValidateListener {
+public class SmooksGraphicalEditorPart extends GraphicalEditor implements
+ ISelectionChangedListener, ISourceSynchronizeListener,
+ IGraphicalEditorPart, ITaskNodeProvider, ISmooksModelValidateListener {
public static final int EXECUTE_COMMAND = 0;
@@ -175,12 +179,13 @@
}
});
- this.editDomain.getCommandStack().addCommandStackEventListener(new CommandStackEventListener() {
+ this.editDomain.getCommandStack().addCommandStackEventListener(
+ new CommandStackEventListener() {
- public void stackChanged(CommandStackEvent event) {
- firePropertyChange(PROP_DIRTY);
- }
- });
+ public void stackChanged(CommandStackEvent event) {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
this.smooksModelProvider = provider;
this.setEditDomain(editDomain);
}
@@ -205,7 +210,8 @@
IEditorSite site = getEditorSite();
if (site instanceof SmooksTaskDetailsEditorSite) {
- FormPage page = ((SmooksTaskDetailsEditorSite) site).getParentEditor();
+ FormPage page = ((SmooksTaskDetailsEditorSite) site)
+ .getParentEditor();
FormToolkit tool = page.getManagedForm().getToolkit();
Composite mainComposite = tool.createComposite(parent);
mainComposite.setBackground(tool.getColors().getBorderColor());
@@ -223,63 +229,90 @@
return super.getGraphicalViewer();
}
- private void handleCommandStack(org.eclipse.emf.common.command.CommandStack commandStack) {
- commandStack.addCommandStackListener(new org.eclipse.emf.common.command.CommandStackListener() {
- public void commandStackChanged(EventObject event) {
- final Command mostRecentCommand = ((org.eclipse.emf.common.command.CommandStack) event.getSource())
- .getMostRecentCommand();
- final EventObject fe = event;
- getEditorSite().getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (mostRecentCommand != null) {
- Command rawCommand = mostRecentCommand;
- while (rawCommand instanceof CommandWrapper) {
- rawCommand = ((CommandWrapper) rawCommand).getCommand();
- }
- int commandType = EXECUTE_COMMAND;
- Command undoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource())
- .getUndoCommand();
- Command redoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource())
- .getRedoCommand();
- if (undoCommand != null || rawCommand.equals(undoCommand)) {
- commandType = EXECUTE_COMMAND;
- }
- if (redoCommand != null || rawCommand.equals(redoCommand)) {
- commandType = UNDO_COMMAND;
- }
- if (rawCommand instanceof CompoundCommand) {
- List<Command> commandList = ((CompoundCommand) rawCommand).getCommandList();
- for (Iterator<?> iterator = commandList.iterator(); iterator.hasNext();) {
- Command command = (Command) iterator.next();
- while (command instanceof CommandWrapper) {
- command = ((CommandWrapper) command).getCommand();
+ private void handleCommandStack(
+ org.eclipse.emf.common.command.CommandStack commandStack) {
+ commandStack
+ .addCommandStackListener(new org.eclipse.emf.common.command.CommandStackListener() {
+ public void commandStackChanged(EventObject event) {
+ final Command mostRecentCommand = ((org.eclipse.emf.common.command.CommandStack) event
+ .getSource()).getMostRecentCommand();
+ final EventObject fe = event;
+ getEditorSite().getShell().getDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (mostRecentCommand != null) {
+ Command rawCommand = mostRecentCommand;
+ while (rawCommand instanceof CommandWrapper) {
+ rawCommand = ((CommandWrapper) rawCommand)
+ .getCommand();
+ }
+ int commandType = EXECUTE_COMMAND;
+ Command undoCommand = ((org.eclipse.emf.common.command.CommandStack) fe
+ .getSource())
+ .getUndoCommand();
+ Command redoCommand = ((org.eclipse.emf.common.command.CommandStack) fe
+ .getSource())
+ .getRedoCommand();
+ if (undoCommand != null
+ || rawCommand
+ .equals(undoCommand)) {
+ commandType = EXECUTE_COMMAND;
+ }
+ if (redoCommand != null
+ || rawCommand
+ .equals(redoCommand)) {
+ commandType = UNDO_COMMAND;
+ }
+ if (rawCommand instanceof CompoundCommand) {
+ List<Command> commandList = ((CompoundCommand) rawCommand)
+ .getCommandList();
+ for (Iterator<?> iterator = commandList
+ .iterator(); iterator
+ .hasNext();) {
+ Command command = (Command) iterator
+ .next();
+ while (command instanceof CommandWrapper) {
+ command = ((CommandWrapper) command)
+ .getCommand();
+ }
+ handleInputParamChange(command);
+ if (command instanceof SetCommand
+ || command instanceof AddCommand
+ || command instanceof DeleteCommand
+ || command instanceof RemoveCommand) {
+ refershRecentAffectedModel(
+ command,
+ command
+ .getAffectedObjects(),
+ commandType);
+ }
+ }
+ } else {
+ if (rawCommand instanceof SetCommand
+ || rawCommand instanceof AddCommand
+ || rawCommand instanceof DeleteCommand
+ || rawCommand instanceof RemoveCommand) {
+ handleInputParamChange(rawCommand);
+ refershRecentAffectedModel(
+ rawCommand,
+ mostRecentCommand
+ .getAffectedObjects(),
+ commandType);
+ }
+ }
+ }
}
- handleInputParamChange(command);
- if (command instanceof SetCommand || command instanceof AddCommand
- || command instanceof DeleteCommand || command instanceof RemoveCommand) {
- refershRecentAffectedModel(command, command.getAffectedObjects(), commandType);
- }
- }
- } else {
- if (rawCommand instanceof SetCommand || rawCommand instanceof AddCommand
- || rawCommand instanceof DeleteCommand || rawCommand instanceof RemoveCommand) {
- handleInputParamChange(rawCommand);
- refershRecentAffectedModel(rawCommand, mostRecentCommand.getAffectedObjects(),
- commandType);
- }
- }
- }
+
+ });
}
-
});
- }
- });
}
protected void handleInputParamChange(Command command) {
Collection<?> affectedObjects = command.getAffectedObjects();
boolean refreshInputModel = false;
- for (Iterator<?> iterator2 = affectedObjects.iterator(); iterator2.hasNext();) {
+ for (Iterator<?> iterator2 = affectedObjects.iterator(); iterator2
+ .hasNext();) {
Object object = (Object) iterator2.next();
if (object instanceof ParamType) {
if (SmooksUIUtils.isInputParamType((ParamType) object)) {
@@ -295,10 +328,12 @@
deletedObjs = ((RemoveCommand) command).getCollection();
}
if (deletedObjs != null) {
- for (Iterator<?> iterator = deletedObjs.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = deletedObjs.iterator(); iterator
+ .hasNext();) {
Object object2 = (Object) iterator.next();
if (object2 instanceof ParamType) {
- if (SmooksUIUtils.isInputParamType((ParamType) object2)) {
+ if (SmooksUIUtils
+ .isInputParamType((ParamType) object2)) {
refreshInputModel = true;
break;
}
@@ -327,7 +362,8 @@
return new ConnectionModelFactoryImpl();
}
- public void setConnectionModelFactory(ConnectionModelFactory connectionModelFactory) {
+ public void setConnectionModelFactory(
+ ConnectionModelFactory connectionModelFactory) {
this.connectionModelFactory = connectionModelFactory;
}
@@ -342,7 +378,8 @@
return new GraphicalModelFactoryImpl();
}
- public void setGraphicalModelFactory(GraphicalModelFactoryImpl graphicalModelFactory) {
+ public void setGraphicalModelFactory(
+ GraphicalModelFactoryImpl graphicalModelFactory) {
this.graphicalModelFactory = graphicalModelFactory;
}
@@ -355,27 +392,37 @@
getSelectionActions().add(autoLayout.getId());
}
- private void deleteRelatedConnection(AbstractSmooksGraphicalModel effecedNode, EStructuralFeature feature,
- SetCommand command) {
- EObject data = (EObject) AdapterFactoryEditingDomain.unwrap(effecedNode.getData());
+ private void deleteRelatedConnection(
+ AbstractSmooksGraphicalModel effecedNode,
+ EStructuralFeature feature, SetCommand command) {
+ EObject data = (EObject) AdapterFactoryEditingDomain.unwrap(effecedNode
+ .getData());
if (feature.equals(SmooksUIUtils.getBeanIDRefFeature(data))) {
- List<TreeNodeConnection> sourceConnections = effecedNode.getSourceConnections();
- List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(sourceConnections);
+ List<TreeNodeConnection> sourceConnections = effecedNode
+ .getSourceConnections();
+ List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(
+ sourceConnections);
for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
- TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
- AbstractSmooksGraphicalModel target = treeNodeConnection.getTargetNode();
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator
+ .next();
+ AbstractSmooksGraphicalModel target = treeNodeConnection
+ .getTargetNode();
String refID = command.getValue().toString();
- Object targetModel = AdapterFactoryEditingDomain.unwrap(target.getData());
+ Object targetModel = AdapterFactoryEditingDomain.unwrap(target
+ .getData());
if (targetModel instanceof EObject) {
- EStructuralFeature idfeature = SmooksUIUtils.getBeanIDFeature((EObject) targetModel);
+ EStructuralFeature idfeature = SmooksUIUtils
+ .getBeanIDFeature((EObject) targetModel);
if (idfeature == null)
continue;
Object iddata = ((EObject) targetModel).eGet(idfeature);
if (iddata != null) {
if (refID == null || !refID.equals(iddata)) {
- target.getTargetConnections().remove(treeNodeConnection);
- effecedNode.getSourceConnections().remove(treeNodeConnection);
+ target.getTargetConnections().remove(
+ treeNodeConnection);
+ effecedNode.getSourceConnections().remove(
+ treeNodeConnection);
target.fireConnectionChanged();
}
}
@@ -384,22 +431,31 @@
}
if (feature.equals(SmooksUIUtils.getBeanIDFeature(data))) {
- List<TreeNodeConnection> targetConnections = effecedNode.getTargetConnections();
- List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(targetConnections);
+ List<TreeNodeConnection> targetConnections = effecedNode
+ .getTargetConnections();
+ List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(
+ targetConnections);
for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
- TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
- AbstractSmooksGraphicalModel source = treeNodeConnection.getSourceNode();
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator
+ .next();
+ AbstractSmooksGraphicalModel source = treeNodeConnection
+ .getSourceNode();
String beanID = command.getValue().toString();
- Object sourceModel = AdapterFactoryEditingDomain.unwrap(source.getData());
+ Object sourceModel = AdapterFactoryEditingDomain.unwrap(source
+ .getData());
if (sourceModel instanceof EObject) {
- EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ EStructuralFeature idRefFeature = SmooksUIUtils
+ .getBeanIDRefFeature((EObject) sourceModel);
if (idRefFeature == null)
continue;
- Object idRefData = ((EObject) sourceModel).eGet(idRefFeature);
+ Object idRefData = ((EObject) sourceModel)
+ .eGet(idRefFeature);
if (idRefData != null) {
if (beanID == null || !beanID.equals(idRefData)) {
- source.getSourceConnections().remove(treeNodeConnection);
- effecedNode.getTargetConnections().remove(treeNodeConnection);
+ source.getSourceConnections().remove(
+ treeNodeConnection);
+ effecedNode.getTargetConnections().remove(
+ treeNodeConnection);
source.fireConnectionChanged();
}
}
@@ -408,27 +464,37 @@
}
if (feature.equals(SmooksUIUtils.getSelectorFeature(data))) {
- List<TreeNodeConnection> targetConnections = effecedNode.getTargetConnections();
- List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(targetConnections);
+ List<TreeNodeConnection> targetConnections = effecedNode
+ .getTargetConnections();
+ List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(
+ targetConnections);
for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
- TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
- AbstractSmooksGraphicalModel source = treeNodeConnection.getSourceNode();
- if (source instanceof InputDataContianerModel || source instanceof InputDataTreeNodeModel) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator
+ .next();
+ AbstractSmooksGraphicalModel source = treeNodeConnection
+ .getSourceNode();
+ if (source instanceof InputDataContianerModel
+ || source instanceof InputDataTreeNodeModel) {
String selector = command.getValue().toString();
- Object sourceModel = AdapterFactoryEditingDomain.unwrap(source.getData());
+ Object sourceModel = AdapterFactoryEditingDomain
+ .unwrap(source.getData());
if (sourceModel instanceof IXMLStructuredObject) {
- IXMLStructuredObject root = SmooksUIUtils.getRootParent((IXMLStructuredObject) sourceModel);
+ IXMLStructuredObject root = SmooksUIUtils
+ .getRootParent((IXMLStructuredObject) sourceModel);
Object oldNode = null;
try {
- oldNode = SmooksUIUtils.localXMLNodeWithPath(selector, root);
+ oldNode = SmooksUIUtils.localXMLNodeWithPath(
+ selector, root);
} catch (Throwable t) {
}
if (oldNode == sourceModel) {
break;
} else {
- source.getSourceConnections().remove(treeNodeConnection);
- effecedNode.getTargetConnections().remove(treeNodeConnection);
+ source.getSourceConnections().remove(
+ treeNodeConnection);
+ effecedNode.getTargetConnections().remove(
+ treeNodeConnection);
source.fireConnectionChanged();
}
}
@@ -438,14 +504,17 @@
}
}
- public AbstractSmooksGraphicalModel findRelatedInputGraphicalModel(Object model) {
+ public AbstractSmooksGraphicalModel findRelatedInputGraphicalModel(
+ Object model) {
if (model instanceof RuleType) {
String selector = ((RuleType) model).getExecuteOn();
- for (Iterator<?> iterator = inputDataList.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = inputDataList.iterator(); iterator
+ .hasNext();) {
Object inputData = (Object) iterator.next();
if (inputData instanceof IXMLStructuredObject) {
- IXMLStructuredObject node = SmooksUIUtils.localXMLNodeWithPath(selector,
- (IXMLStructuredObject) inputData);
+ IXMLStructuredObject node = SmooksUIUtils
+ .localXMLNodeWithPath(selector,
+ (IXMLStructuredObject) inputData);
AbstractSmooksGraphicalModel graphicalModel = findGraphicalModel(node);
return graphicalModel;
}
@@ -461,18 +530,23 @@
* @param affectedObjects
* @param commandType
*/
- protected void refershRecentAffectedModel(Command command, Collection<?> affectedObjects, int commandType) {
- for (Iterator<?> iterator = affectedObjects.iterator(); iterator.hasNext();) {
+ protected void refershRecentAffectedModel(Command command,
+ Collection<?> affectedObjects, int commandType) {
+ for (Iterator<?> iterator = affectedObjects.iterator(); iterator
+ .hasNext();) {
Object object = (Object) iterator.next();
object = AdapterFactoryEditingDomain.unwrap(object);
if (commandType == EXECUTE_COMMAND || commandType == REDO_COMMAND) {
if (object instanceof SmooksResourceListType) {
if (command instanceof AddCommand) {
- Collection<?> colletion = ((AddCommand) command).getCollection();
- for (Iterator<?> iterator2 = colletion.iterator(); iterator2.hasNext();) {
+ Collection<?> colletion = ((AddCommand) command)
+ .getCollection();
+ for (Iterator<?> iterator2 = colletion.iterator(); iterator2
+ .hasNext();) {
Object childModel = (Object) iterator2.next();
- childModel = AdapterFactoryEditingDomain.unwrap(childModel);
+ childModel = AdapterFactoryEditingDomain
+ .unwrap(childModel);
AbstractSmooksGraphicalModel inputGraphicalModel = findRelatedInputGraphicalModel(childModel);
if (inputGraphicalModel != null) {
inputGraphicalModel.fireVisualChanged();
@@ -486,17 +560,22 @@
expandConnectedModels(connections);
}
}
- if (command instanceof DeleteCommand || command instanceof RemoveCommand) {
+ if (command instanceof DeleteCommand
+ || command instanceof RemoveCommand) {
Collection<?> colletion = null;
if (command instanceof DeleteCommand) {
- colletion = ((DeleteCommand) command).getCollection();
+ colletion = ((DeleteCommand) command)
+ .getCollection();
}
if (command instanceof RemoveCommand) {
- colletion = ((RemoveCommand) command).getCollection();
+ colletion = ((RemoveCommand) command)
+ .getCollection();
}
- for (Iterator<?> iterator2 = colletion.iterator(); iterator2.hasNext();) {
+ for (Iterator<?> iterator2 = colletion.iterator(); iterator2
+ .hasNext();) {
Object childModel = (Object) iterator2.next();
- childModel = AdapterFactoryEditingDomain.unwrap(childModel);
+ childModel = AdapterFactoryEditingDomain
+ .unwrap(childModel);
AbstractSmooksGraphicalModel inputGraphicalModel = findRelatedInputGraphicalModel(childModel);
if (inputGraphicalModel != null) {
inputGraphicalModel.fireVisualChanged();
@@ -504,7 +583,8 @@
AbstractSmooksGraphicalModel graphModel = findGraphicalModel(childModel);
if (graphModel == null)
continue;
- AbstractSmooksGraphicalModel.disconnectAllConnections(graphModel);
+ AbstractSmooksGraphicalModel
+ .disconnectAllConnections(graphModel);
root.removeTreeNode(graphModel);
}
}
@@ -516,9 +596,11 @@
continue;
}
node.fireVisualChanged();
- EStructuralFeature feature = ((SetCommand) command).getFeature();
+ EStructuralFeature feature = ((SetCommand) command)
+ .getFeature();
if (SmooksUIUtils.isRelatedConnectionFeature(feature)) {
- deleteRelatedConnection(node, feature, (SetCommand) command);
+ deleteRelatedConnection(node, feature,
+ (SetCommand) command);
Collection<TreeNodeConnection> connections = createConnection(node);
node.fireConnectionChanged();
expandConnectedModels(connections);
@@ -555,7 +637,8 @@
node.fireChildrenChanged();
node.fireConnectionChanged();
}
- if (command instanceof DeleteCommand || command instanceof RemoveCommand) {
+ if (command instanceof DeleteCommand
+ || command instanceof RemoveCommand) {
AbstractSmooksGraphicalModel inputGraphicalModel = findRelatedInputGraphicalModel(object);
if (inputGraphicalModel != null) {
inputGraphicalModel.fireVisualChanged();
@@ -573,10 +656,13 @@
AbstractSmooksGraphicalModel node = findGraphicalModel(object);
if (command instanceof AddCommand) {
if (object instanceof SmooksResourceListType) {
- Collection<?> cccc = ((AddCommand) command).getCollection();
- for (Iterator<?> iterator2 = cccc.iterator(); iterator2.hasNext();) {
+ Collection<?> cccc = ((AddCommand) command)
+ .getCollection();
+ for (Iterator<?> iterator2 = cccc.iterator(); iterator2
+ .hasNext();) {
Object object2 = (Object) iterator2.next();
- object2 = AdapterFactoryEditingDomain.unwrap(object2);
+ object2 = AdapterFactoryEditingDomain
+ .unwrap(object2);
AbstractSmooksGraphicalModel gmodel = findGraphicalModel(object2);
if (gmodel != null) {
root.removeTreeNode(gmodel);
@@ -594,15 +680,18 @@
continue;
}
node.fireVisualChanged();
- EStructuralFeature feature = ((SetCommand) command).getFeature();
+ EStructuralFeature feature = ((SetCommand) command)
+ .getFeature();
if (SmooksUIUtils.isRelatedConnectionFeature(feature)) {
- deleteRelatedConnection(node, feature, (SetCommand) command);
+ deleteRelatedConnection(node, feature,
+ (SetCommand) command);
Collection<TreeNodeConnection> connections = createConnection(node);
node.fireConnectionChanged();
expandConnectedModels(connections);
}
}
- if (command instanceof DeleteCommand || command instanceof RemoveCommand) {
+ if (command instanceof DeleteCommand
+ || command instanceof RemoveCommand) {
Collection<?> cccc = null;
if (command instanceof DeleteCommand) {
cccc = ((DeleteCommand) command).getCollection();
@@ -610,14 +699,16 @@
if (command instanceof RemoveCommand) {
cccc = ((RemoveCommand) command).getCollection();
}
- for (Iterator<?> iterator2 = cccc.iterator(); iterator2.hasNext();) {
+ for (Iterator<?> iterator2 = cccc.iterator(); iterator2
+ .hasNext();) {
Object object2 = (Object) iterator2.next();
object2 = AdapterFactoryEditingDomain.unwrap(object2);
// it means that it's deletecommand undo
if (object == object2) {
EObject owner = ((EObject) object).eContainer();
if (owner instanceof SmooksResourceListType) {
- object = AdapterFactoryEditingDomain.unwrap(object);
+ object = AdapterFactoryEditingDomain
+ .unwrap(object);
AbstractSmooksGraphicalModel graphModel = createGraphModel(object);
if (graphModel == null)
continue;
@@ -669,14 +760,22 @@
getGraphicalViewer().setEditDomain(editDomain);
getGraphicalViewer().setEditPartFactory(createEdtiPartFactory());
- getGraphicalViewer().setRootEditPart(new FreeformGraphicalRootEditPart());
+ getGraphicalViewer().setRootEditPart(
+ new FreeformGraphicalRootEditPart() {
+ public DragTracker getDragTracker(Request req) {
+ return new RightClickSelectMarqueeDragTraker();
+ }
+ });
- getGraphicalViewer().addDropTargetListener(
- (TransferDropTargetListener) new TemplateTransferDropTargetListener(getGraphicalViewer()));
+ getGraphicalViewer()
+ .addDropTargetListener(
+ (TransferDropTargetListener) new TemplateTransferDropTargetListener(
+ getGraphicalViewer()));
- GraphicalViewerKeyHandler keyHandler = new GraphicalViewerKeyHandler(getGraphicalViewer());
- keyHandler.put(org.eclipse.gef.KeyStroke.getPressed(SWT.DEL, 0), this.getActionRegistry().getAction(
- ActionFactory.DELETE.getId()));
+ GraphicalViewerKeyHandler keyHandler = new GraphicalViewerKeyHandler(
+ getGraphicalViewer());
+ keyHandler.put(org.eclipse.gef.KeyStroke.getPressed(SWT.DEL, 0), this
+ .getActionRegistry().getAction(ActionFactory.DELETE.getId()));
ContextMenuProvider provider = getContextMenuProvider();
getGraphicalViewer().setContextMenu(provider);
@@ -685,7 +784,8 @@
}
protected ContextMenuProvider getContextMenuProvider() {
- return new SmooksGraphicalEditorMenuContextProvider(getGraphicalViewer(), this.getActionRegistry());
+ return new SmooksGraphicalEditorMenuContextProvider(
+ getGraphicalViewer(), this.getActionRegistry());
}
private void hookSelectionActions() {
@@ -693,7 +793,8 @@
while (actions.hasNext()) {
Object action = actions.next();
if (action instanceof SelectionAction) {
- ((SelectionAction) action).setSelectionProvider(getGraphicalViewer());
+ ((SelectionAction) action)
+ .setSelectionProvider(getGraphicalViewer());
}
}
}
@@ -701,7 +802,8 @@
protected List<AbstractSmooksGraphicalModel> createInputDataGraphModel() {
List<AbstractSmooksGraphicalModel> inputGraphModel = new ArrayList<AbstractSmooksGraphicalModel>();
if (inputDataList != null && root != null) {
- for (Iterator<?> iterator = inputDataList.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = inputDataList.iterator(); iterator
+ .hasNext();) {
Object object = (Object) iterator.next();
ITreeContentProvider contentProvider = new XMLStructuredDataContentProvider();
ILabelProvider labelProvider = new XMLStructuredDataLabelProvider();
@@ -714,8 +816,9 @@
}
containerModel.getChildren().add((IXMLStructuredObject) object);
if (containerModel != null) {
- TreeContainerModel container = new InputDataContianerModel(containerModel, contentProvider,
- labelProvider, getSmooksModelProvider());
+ TreeContainerModel container = new InputDataContianerModel(
+ containerModel, contentProvider, labelProvider,
+ getSmooksModelProvider());
root.addTreeNode(container);
inputGraphModel.add(container);
}
@@ -727,7 +830,8 @@
@Override
protected void hookGraphicalViewer() {
super.hookGraphicalViewer();
- getGraphicalViewer().addSelectionChangedListener(getSelectionSynchronizer());
+ getGraphicalViewer().addSelectionChangedListener(
+ getSelectionSynchronizer());
getGraphicalViewer().addSelectionChangedListener(this);
}
@@ -743,9 +847,11 @@
return;
AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
.getEditingDomain();
- if (inputDataList != null && obj != null && obj instanceof DocumentRoot && editingDomain != null) {
+ if (inputDataList != null && obj != null && obj instanceof DocumentRoot
+ && editingDomain != null) {
createInputDataGraphModel();
- SmooksResourceListType listType = ((DocumentRoot) obj).getSmooksResourceList();
+ SmooksResourceListType listType = ((DocumentRoot) obj)
+ .getSmooksResourceList();
List<?> arcList = listType.getAbstractResourceConfig();
for (Iterator<?> iterator = arcList.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
@@ -768,16 +874,19 @@
expandConnectedModels(connections);
this.autoLayout(false);
-
- List<Diagnostic> diagnosticList = this.getSmooksModelProvider().getDiagnosticList();
+
+ List<Diagnostic> diagnosticList = this.getSmooksModelProvider()
+ .getDiagnosticList();
this.validateEnd(diagnosticList);
}
protected AbstractSmooksGraphicalModel createGraphModel(Object model) {
GraphicalModelFactory factory = getGraphicalModelFactory();
if (factory != null) {
- Object gmodel = factory.createGraphicalModel(model, smooksModelProvider);
- if (gmodel != null && gmodel instanceof AbstractSmooksGraphicalModel) {
+ Object gmodel = factory.createGraphicalModel(model,
+ smooksModelProvider);
+ if (gmodel != null
+ && gmodel instanceof AbstractSmooksGraphicalModel) {
AbstractSmooksGraphicalModel graphicalModel = (AbstractSmooksGraphicalModel) gmodel;
return graphicalModel;
}
@@ -793,7 +902,8 @@
return connections;
}
- protected Collection<TreeNodeConnection> createAllConnection(AbstractSmooksGraphicalModel model) {
+ protected Collection<TreeNodeConnection> createAllConnection(
+ AbstractSmooksGraphicalModel model) {
try {
if (model == null)
return null;
@@ -821,13 +931,15 @@
}
}
- public Collection<TreeNodeConnection> createConnection(AbstractSmooksGraphicalModel model) {
+ public Collection<TreeNodeConnection> createConnection(
+ AbstractSmooksGraphicalModel model) {
ConnectionModelFactory connectionModelFactory = getConnectionModelFactory();
List<TreeNodeConnection> cs = new ArrayList<TreeNodeConnection>();
if (connectionModelFactory != null) {
if (connectionModelFactory.hasConnection(model)) {
- Collection<TreeNodeConnection> cList = connectionModelFactory.createConnection(inputDataList,
- getSmooksResourceList(), root, model);
+ Collection<TreeNodeConnection> cList = connectionModelFactory
+ .createConnection(inputDataList,
+ getSmooksResourceList(), root, model);
if (cList != null) {
cs.addAll(cList);
}
@@ -915,9 +1027,11 @@
return null;
}
- public void createConnection(List<AbstractSmooksGraphicalModel> children, List<TreeNodeConnection> connections) {
+ public void createConnection(List<AbstractSmooksGraphicalModel> children,
+ List<TreeNodeConnection> connections) {
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator
+ .next();
if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
if (canCreateConnection(abstractSmooksGraphicalModel)) {
Collection<TreeNodeConnection> c = createConnection(abstractSmooksGraphicalModel);
@@ -925,7 +1039,8 @@
connections.addAll(c);
}
}
- List<AbstractSmooksGraphicalModel> cchildren = abstractSmooksGraphicalModel.getChildren();
+ List<AbstractSmooksGraphicalModel> cchildren = abstractSmooksGraphicalModel
+ .getChildren();
createConnection(cchildren, connections);
}
}
@@ -954,46 +1069,59 @@
Object obj = smooksModelProvider.getSmooksModel();
smooksResourceList = null;
if (obj instanceof DocumentRoot) {
- smooksResourceList = ((DocumentRoot) obj).getSmooksResourceList();
- inputDataList = SelectorCreationDialog.generateInputData(smooksResourceList);
+ smooksResourceList = ((DocumentRoot) obj)
+ .getSmooksResourceList();
+ inputDataList = SelectorCreationDialog
+ .generateInputData(smooksResourceList);
}
}
}
@Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
super.init(site, input);
initSmooksData();
if (smooksModelProvider != null) {
- this.handleCommandStack(smooksModelProvider.getEditingDomain().getCommandStack());
+ this.handleCommandStack(smooksModelProvider.getEditingDomain()
+ .getCommandStack());
}
}
- protected void expandConnectedModels(Collection<TreeNodeConnection> connections) {
+ protected void expandConnectedModels(
+ Collection<TreeNodeConnection> connections) {
if (connections == null || connections.isEmpty())
return;
List<TreeNodeModel> expanedTreeNodeList = new ArrayList<TreeNodeModel>();
for (Iterator<?> iterator = connections.iterator(); iterator.hasNext();) {
- TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
- AbstractSmooksGraphicalModel source = treeNodeConnection.getSourceNode();
- AbstractSmooksGraphicalModel target = treeNodeConnection.getTargetNode();
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator
+ .next();
+ AbstractSmooksGraphicalModel source = treeNodeConnection
+ .getSourceNode();
+ AbstractSmooksGraphicalModel target = treeNodeConnection
+ .getTargetNode();
Object data = source.getData();
Object data2 = target.getData();
- if (source instanceof TreeNodeModel && data instanceof IXMLStructuredObject) {
+ if (source instanceof TreeNodeModel
+ && data instanceof IXMLStructuredObject) {
expanedTreeNodeList.add((TreeNodeModel) source);
}
- if (target instanceof TreeNodeModel && data2 instanceof IXMLStructuredObject) {
+ if (target instanceof TreeNodeModel
+ && data2 instanceof IXMLStructuredObject) {
expanedTreeNodeList.add((TreeNodeModel) target);
}
}
EditPart rootEditPart = getGraphicalViewer().getContents();
if (rootEditPart != null) {
List<?> childrenEditPart = rootEditPart.getChildren();
- for (Iterator<?> iterator = childrenEditPart.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = childrenEditPart.iterator(); iterator
+ .hasNext();) {
Object object = (Object) iterator.next();
Object model = ((EditPart) object).getModel();
- if (object instanceof InputDataContainerEditPart || model instanceof XSLTemplateGraphicalModel) {
- SmooksUIUtils.expandGraphTree(expanedTreeNodeList, (TreeNodeEditPart) object);
+ if (object instanceof InputDataContainerEditPart
+ || model instanceof XSLTemplateGraphicalModel) {
+ SmooksUIUtils.expandGraphTree(expanedTreeNodeList,
+ (TreeNodeEditPart) object);
}
// if(model instanceof XSLTemplateGraphicalModel){
// ((TreeNodeEditPart) object).expandNode();
@@ -1018,7 +1146,8 @@
initGraphicalModel();
}
- protected void applyGraphicalInformation(AbstractSmooksGraphicalModel graphicalModel) {
+ protected void applyGraphicalInformation(
+ AbstractSmooksGraphicalModel graphicalModel) {
// GraphType graph1 = getSmooksGraphicsExtType().getGraph();
// applyGraphicalInformation(graph1, graphicalModel);
}
@@ -1081,9 +1210,11 @@
Node node = (Node) nodeMap.get(part);
figureList.add(part);
graphAnimation.recordInit(part);
- IMoveableModel graphicalModel = (IMoveableModel) part.getModel();
+ IMoveableModel graphicalModel = (IMoveableModel) part
+ .getModel();
map.put(graphicalModel, new Point(node.x, node.y));
- graphAnimation.recordFinal(part, new Rectangle(node.x, node.y, 0, 0));
+ graphAnimation.recordFinal(part, new Rectangle(node.x, node.y,
+ 0, 0));
}
if (animation) {
graphAnimation.start(figureList);
@@ -1120,7 +1251,8 @@
return null;
}
- protected DirectedGraph collectionGraphInformation(HashMap<Object, Node> nodeMap) {
+ protected DirectedGraph collectionGraphInformation(
+ HashMap<Object, Node> nodeMap) {
DirectedGraph graph = new DirectedGraph();
if (getGraphicalViewer() == null) {
return graph;
@@ -1143,17 +1275,21 @@
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
GraphicalEditPart object = (GraphicalEditPart) iterator.next();
- for (Iterator<?> iterator2 = children.iterator(); iterator2.hasNext();) {
- GraphicalEditPart testEditPart = (GraphicalEditPart) iterator2.next();
+ for (Iterator<?> iterator2 = children.iterator(); iterator2
+ .hasNext();) {
+ GraphicalEditPart testEditPart = (GraphicalEditPart) iterator2
+ .next();
Node node = nodeMap.get(object);
Node testNode = nodeMap.get(testEditPart);
if (node != null && testNode != null) {
- if (hasConnectionAssociation(object, testEditPart, SOURCE_CONNECT_TYPE)) {
+ if (hasConnectionAssociation(object, testEditPart,
+ SOURCE_CONNECT_TYPE)) {
Edge edge = new Edge(node, testNode);
edge.data = testEditPart;
graph.edges.add(edge);
}
- if (hasConnectionAssociation(object, testEditPart, TARGET_CONNECT_TYPE)) {
+ if (hasConnectionAssociation(object, testEditPart,
+ TARGET_CONNECT_TYPE)) {
Edge edge = new Edge(testNode, node);
graph.edges.add(edge);
}
@@ -1167,10 +1303,12 @@
if (model == editPart.getModel()) {
return true;
}
- AbstractSmooksGraphicalModel grphicalModel = (AbstractSmooksGraphicalModel) editPart.getModel();
+ AbstractSmooksGraphicalModel grphicalModel = (AbstractSmooksGraphicalModel) editPart
+ .getModel();
if (!grphicalModel.getChildrenWithoutDynamic().isEmpty()) {
List<?> children = editPart.getChildren();
- for (Iterator<?> iterator2 = children.iterator(); iterator2.hasNext();) {
+ for (Iterator<?> iterator2 = children.iterator(); iterator2
+ .hasNext();) {
GraphicalEditPart gpart = (GraphicalEditPart) iterator2.next();
if (hasAssociation(model, gpart)) {
return true;
@@ -1180,7 +1318,8 @@
return false;
}
- private boolean hasConnectionAssociation(GraphicalEditPart editPart, GraphicalEditPart testEditPart, int connectType) {
+ private boolean hasConnectionAssociation(GraphicalEditPart editPart,
+ GraphicalEditPart testEditPart, int connectType) {
List<?> sourceConnections = null;
if (connectType == SOURCE_CONNECT_TYPE) {
sourceConnections = editPart.getSourceConnections();
@@ -1188,9 +1327,11 @@
if (connectType == TARGET_CONNECT_TYPE) {
sourceConnections = editPart.getTargetConnections();
}
- for (Iterator<?> iterator = sourceConnections.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = sourceConnections.iterator(); iterator
+ .hasNext();) {
GraphicalEditPart object = (GraphicalEditPart) iterator.next();
- TreeNodeConnection connection = (TreeNodeConnection) object.getModel();
+ TreeNodeConnection connection = (TreeNodeConnection) object
+ .getModel();
Object testModel = null;
if (connectType == SOURCE_CONNECT_TYPE) {
testModel = connection.getTargetNode();
@@ -1202,12 +1343,15 @@
return true;
}
}
- AbstractSmooksGraphicalModel sourceGraphModel = (AbstractSmooksGraphicalModel) editPart.getModel();
+ AbstractSmooksGraphicalModel sourceGraphModel = (AbstractSmooksGraphicalModel) editPart
+ .getModel();
if (!sourceGraphModel.getChildrenWithoutDynamic().isEmpty()) {
List<?> children = editPart.getChildren();
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- GraphicalEditPart childEditPart = (GraphicalEditPart) iterator.next();
- if (hasConnectionAssociation(childEditPart, testEditPart, connectType)) {
+ GraphicalEditPart childEditPart = (GraphicalEditPart) iterator
+ .next();
+ if (hasConnectionAssociation(childEditPart, testEditPart,
+ connectType)) {
return true;
}
}
@@ -1234,7 +1378,8 @@
*/
@Override
public void doSave(IProgressMonitor monitor) {
- if (getEditDomain() != null && getEditDomain().getCommandStack() != null) {
+ if (getEditDomain() != null
+ && getEditDomain().getCommandStack() != null) {
getEditDomain().getCommandStack().flush();
}
}
@@ -1267,7 +1412,8 @@
Object obj = smooksModelProvider.getSmooksModel();
smooksResourceList = null;
if (obj instanceof DocumentRoot) {
- smooksResourceList = ((DocumentRoot) obj).getSmooksResourceList();
+ smooksResourceList = ((DocumentRoot) obj)
+ .getSmooksResourceList();
}
return smooksResourceList;
}
@@ -1284,7 +1430,8 @@
public void inputTypeChanged() {
if (root != null && inputDataList != null) {
- List<Object> newInputDataList = SelectorCreationDialog.generateInputData(getSmooksResourceListType());
+ List<Object> newInputDataList = SelectorCreationDialog
+ .generateInputData(getSmooksResourceListType());
List<InputDataContianerModel> inputs = new ArrayList<InputDataContianerModel>();
List<AbstractSmooksGraphicalModel> children = root.getChildren();
@@ -1293,13 +1440,16 @@
AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator
.next();
if (abstractSmooksGraphicalModel instanceof InputDataContianerModel) {
- inputs.add((InputDataContianerModel) abstractSmooksGraphicalModel);
+ inputs
+ .add((InputDataContianerModel) abstractSmooksGraphicalModel);
}
}
for (Iterator<?> iterator = inputs.iterator(); iterator.hasNext();) {
- InputDataContianerModel inputModel = (InputDataContianerModel) iterator.next();
- AbstractSmooksGraphicalModel.disconnectAllConnections(inputModel);
+ InputDataContianerModel inputModel = (InputDataContianerModel) iterator
+ .next();
+ AbstractSmooksGraphicalModel
+ .disconnectAllConnections(inputModel);
root.removeTreeNode(inputModel);
}
@@ -1325,7 +1475,8 @@
return;
List<AbstractSmooksGraphicalModel> children = root.getChildren();
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator
+ .next();
cleanValidationMarker(abstractSmooksGraphicalModel);
}
}
@@ -1333,9 +1484,11 @@
protected void cleanValidationMarker(AbstractSmooksGraphicalModel model) {
model.setSeverity(IValidatableModel.NONE);
model.getMessage().clear();
- List<AbstractSmooksGraphicalModel> children = model.getChildrenWithoutDynamic();
+ List<AbstractSmooksGraphicalModel> children = model
+ .getChildrenWithoutDynamic();
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator
+ .next();
cleanValidationMarker(abstractSmooksGraphicalModel);
}
}
@@ -1351,7 +1504,8 @@
public void run() {
cleanValidationMarker();
- for (Iterator<?> iterator = flist.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = flist.iterator(); iterator
+ .hasNext();) {
Diagnostic diagnostic = (Diagnostic) iterator.next();
refreshValidateResult(diagnostic);
}
@@ -1360,18 +1514,20 @@
}
}
-
- protected String getDiagnosticMessage(Diagnostic diagnostic){
+
+ protected String getDiagnosticMessage(Diagnostic diagnostic) {
List<?> datas = diagnostic.getData();
if (datas.size() == 2) {
Object parentObj = datas.get(0);
- if (parentObj instanceof BeanType || parentObj instanceof BindingsType) {
+ if (parentObj instanceof BeanType
+ || parentObj instanceof BindingsType) {
Object obj = datas.get(1);
if (obj == JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID
|| obj == Javabean12Package.Literals.BEAN_TYPE__BEAN_ID) {
String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature")) { //$NON-NLS-1$
+ if (message != null
+ && message.startsWith("The required feature")) { //$NON-NLS-1$
return Messages.SmooksJavaMappingGraphicalEditor_BeanIdEmptyErrormessage;
}
}
@@ -1383,7 +1539,8 @@
if (obj == JavabeanPackage.Literals.VALUE_TYPE__DATA
|| obj == Javabean12Package.Literals.VALUE_TYPE__DATA) {
String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature")) { //$NON-NLS-1$
+ if (message != null
+ && message.startsWith("The required feature")) { //$NON-NLS-1$
return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithSource;
}
}
@@ -1395,7 +1552,8 @@
if (obj == JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF
|| obj == Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF) {
String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature")) { //$NON-NLS-1$
+ if (message != null
+ && message.startsWith("The required feature")) { //$NON-NLS-1$
return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithJavaBean;
}
}
@@ -1414,7 +1572,8 @@
Object object = (Object) iterator2.next();
object = AdapterFactoryEditingDomain.unwrap(object);
if (object instanceof EObject) {
- AbstractSmooksGraphicalModel graphModel = SmooksGraphUtil.findSmooksGraphModel(root, object);
+ AbstractSmooksGraphicalModel graphModel = SmooksGraphUtil
+ .findSmooksGraphModel(root, object);
if (graphModel == null)
continue;
obj = graphModel;
@@ -1425,7 +1584,8 @@
}
}
if (obj != null) {
- for (Iterator<?> iterator2 = datas.iterator(); iterator2.hasNext();) {
+ for (Iterator<?> iterator2 = datas.iterator(); iterator2
+ .hasNext();) {
Object object = (Object) iterator2.next();
object = AdapterFactoryEditingDomain.unwrap(object);
if (object instanceof EAttribute && obj != null) {
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-12-01 07:41:03 UTC (rev 18941)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-12-01 08:16:37 UTC (rev 18942)
@@ -28,11 +28,9 @@
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaMappingActionCreator;
import org.jboss.tools.smooks.model.javabean.BindingsType;
import org.jboss.tools.smooks.model.javabean.ExpressionType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
import org.jboss.tools.smooks.model.javabean.ValueType;
import org.jboss.tools.smooks.model.javabean.WiringType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
Added: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java (rev 0)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java 2009-12-01 08:16:37 UTC (rev 18942)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import org.eclipse.gef.tools.MarqueeDragTracker;
+
+/**
+ * @author Dart
+ *
+ */
+public class RightClickSelectMarqueeDragTraker extends MarqueeDragTracker{
+
+ @Override
+ protected boolean handleButtonUp(int button) {
+ int state = getState();
+ setState(STATE_DRAG_IN_PROGRESS);
+ boolean flag = super.handleButtonUp(button);
+ setState(state);
+ return flag;
+ }
+
+}
Property changes on: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/RightClickSelectMarqueeDragTraker.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-12-01 07:41:03 UTC (rev 18941)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-12-01 08:16:37 UTC (rev 18942)
@@ -11,8 +11,10 @@
package org.jboss.tools.smooks.graphical.editors.editparts;
import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.Request;
import org.eclipse.ui.IEditorPart;
import org.jboss.tools.smooks.gef.tree.editparts.RootEditPart;
import org.jboss.tools.smooks.gef.tree.editpolicy.SmooksRootEditPartLayoutEditPolicy;
@@ -26,7 +28,7 @@
public static final int BEAN_TYPE = 2;
public static final int BINDINGS_TYPE = 1;
-
+
/*
* (non-Javadoc)
*
@@ -43,4 +45,11 @@
return editDomain.getEditorPart();
}
+ @Override
+ public DragTracker getDragTracker(Request request) {
+ return super.getDragTracker(request);
+ }
+
+
+
}
16 years
JBoss Tools SVN: r18941 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-12-01 02:41:03 -0500 (Tue, 01 Dec 2009)
New Revision: 18941
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
Log:
JBIDE-5324: Invalid thread access when refreshing or adding validation markers
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java 2009-12-01 06:19:42 UTC (rev 18940)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java 2009-12-01 07:41:03 UTC (rev 18941)
@@ -1043,7 +1043,17 @@
fDesignViewer.getTrayViewer().setContents(getProcess());
- updateMarkersHard();
+ //Bugzilla 294501 - When markers are added on the BPEL file, the meta-model
+ //objects are notified about the marker change. But the display of the markers
+ //on the diagram fails because of several invalid thread access exceptions.
+ //Thus, encapsulating the marker update into a separate thread
+ //Note: supposedly only happens on Galileo (== Eclipse 3.5)
+ Display.getDefault().asyncExec( new Runnable() {
+ public void run() {
+ updateMarkersHard();
+ }
+ });
+
}
protected void updateMarkersHard () {
16 years
JBoss Tools SVN: r18940 - branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-01 01:19:42 -0500 (Tue, 01 Dec 2009)
New Revision: 18940
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
Log:
JBIDE-5301
Remove the MEDI URI from Smooks config file handle support-namespaces
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2009-12-01 06:13:35 UTC (rev 18939)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2009-12-01 06:19:42 UTC (rev 18940)
@@ -28,7 +28,6 @@
import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
import org.jboss.tools.smooks.model.json.JsonPackage;
-import org.jboss.tools.smooks.model.medi.MEdiPackage;
import org.jboss.tools.smooks.model.xsl.XslPackage;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
@@ -40,7 +39,7 @@
/**
* @author Dart dpeng(a)redhat.com
- *
+ *
*/
public class SmooksConfigFileHandle extends DefaultHandler {
private boolean correctContentFile = false;
@@ -50,40 +49,35 @@
private String[] smooksSpportURI = null;
private SAXParserFactory fFactory;
-
- public SmooksConfigFileHandle(){
+
+ public SmooksConfigFileHandle() {
super();
smooksSpportURI = createSupportURI();
}
-
- protected String[] createSupportURI(){
- return new String[]{
+
+ protected String[] createSupportURI() {
+ return new String[] {
org.jboss.tools.smooks.model.smooks.SmooksPackage.eNS_URI,
- EdiPackage.eNS_URI,
- XslPackage.eNS_URI,
- FreemarkerPackage.eNS_URI,
- GroovyPackage.eNS_URI,
- MEdiPackage.eNS_URI,
- CalcPackage.eNS_URI,
- CsvPackage.eNS_URI,
- DatasourcePackage.eNS_URI,
- FileRoutingPackage.eNS_URI,
- IoroutingPackage.eNS_URI,
- JavabeanPackage.eNS_URI,
- JmsroutingPackage.eNS_URI,
- JsonPackage.eNS_URI,
- };
+ EdiPackage.eNS_URI, XslPackage.eNS_URI,
+ FreemarkerPackage.eNS_URI, GroovyPackage.eNS_URI,
+ CalcPackage.eNS_URI, CsvPackage.eNS_URI,
+ DatasourcePackage.eNS_URI, FileRoutingPackage.eNS_URI,
+ IoroutingPackage.eNS_URI, JavabeanPackage.eNS_URI,
+ JmsroutingPackage.eNS_URI, JsonPackage.eNS_URI, };
}
- private final SAXParser createParser(SAXParserFactory parserFactory) throws ParserConfigurationException,
- SAXException, SAXNotRecognizedException, SAXNotSupportedException {
+ private final SAXParser createParser(SAXParserFactory parserFactory)
+ throws ParserConfigurationException, SAXException,
+ SAXNotRecognizedException, SAXNotSupportedException {
// Initialize the parser.
final SAXParser parser = parserFactory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
// disable DTD validation
try {
reader.setFeature("http://xml.org/sax/features/validation", false); //$NON-NLS-1$
- reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
+ reader
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
} catch (SAXNotRecognizedException e) {
} catch (SAXNotSupportedException e) {
}
@@ -101,7 +95,8 @@
return fFactory;
}
- public boolean parseContents(InputSource contents) throws ParserConfigurationException, IOException {
+ public boolean parseContents(InputSource contents)
+ throws ParserConfigurationException, IOException {
try {
fFactory = getFactory();
if (fFactory == null) {
@@ -117,21 +112,21 @@
}
/*
- * Resolve external entity definitions to an empty string. This is to
- * speed up processing of files with external DTDs. Not resolving the
- * contents of the DTD is ok, as only the System ID of the DTD
- * declaration is used.
+ * Resolve external entity definitions to an empty string. This is to speed
+ * up processing of files with external DTDs. Not resolving the contents of
+ * the DTD is ok, as only the System ID of the DTD declaration is used.
*
- * @see
- * org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
+ * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
* java.lang.String)
*/
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws SAXException {
return new InputSource(new StringReader("")); //$NON-NLS-1$
}
@Override
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
super.startPrefixMapping(prefix, uri);
if (containtSmooksURI(uri)) {
setCorrectContentFile(true);
@@ -156,8 +151,9 @@
* @see org.xml.sax.ContentHandler#startElement(java.lang.String,
* java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
- public final void startElement(final String uri, final String elementName, final String qualifiedName,
- final Attributes attributes) throws SAXException {
+ public final void startElement(final String uri, final String elementName,
+ final String qualifiedName, final Attributes attributes)
+ throws SAXException {
if (isCorrectContentFile()) {
throw new SAXException(Messages.SmooksConfigFileHandle_exception);
}
16 years
JBoss Tools SVN: r18939 - branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-01 01:13:35 -0500 (Tue, 01 Dec 2009)
New Revision: 18939
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
Log:
JBIDE-5301
Synchronize it to CR1
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-01 05:56:16 UTC (rev 18938)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-01 06:13:35 UTC (rev 18939)
@@ -41,14 +41,6 @@
name="Smooks Configuration File"
priority="low">
</content-type>
- <content-type
- base-type="org.eclipse.core.runtime.xml"
- describer="org.jboss.tools.smooks.edimap.editor.EDIMapFileContentDescriber"
- file-extensions="xml"
- id="org.jboss.tools.smooks.ui.edimap.contentType"
- name="EDI Map File"
- priority="low">
- </content-type>
</extension>
<extension
16 years