JBoss Tools SVN: r8492 - trunk/documentation/jboss-tools-docs/index.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-05-31 06:29:50 -0400 (Sat, 31 May 2008)
New Revision: 8492
Modified:
trunk/documentation/jboss-tools-docs/index/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-344 - correcting titles in some links
Modified: trunk/documentation/jboss-tools-docs/index/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/index/master.xml 2008-05-30 18:42:10 UTC (rev 8491)
+++ trunk/documentation/jboss-tools-docs/index/master.xml 2008-05-31 10:29:50 UTC (rev 8492)
@@ -64,9 +64,9 @@
<indexentry>
<primaryie>ESB Editor Reference Guide <ulink
- url="en/esb_ref_Guide/html/index.html">(html)</ulink>
- <ulink url="en/esb_ref_Guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/esb_ref_Guide/pdf/Hibernatetools_Reference_Guide.pdf"
+ url="en/esb_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/esb_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/esb_ref_guide/pdf/Hibernatetools_Reference_Guide.pdf"
>(pdf)</ulink>
</primaryie>
</indexentry>
@@ -74,8 +74,8 @@
<indexentry>
<primaryie>JSF Tools Reference Guide <ulink
url="en/jsf_tools_ref_Guide/html/index.html">(html)</ulink>
- <ulink url="en/jsf_tools_ref_Guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jsf_tools_ref_Guide/pdf/JSF_Tools_Reference_Guide.pdf"
+ <ulink url="en/jsf_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jsf_tools_ref_guide/pdf/JSF_Tools_Reference_Guide.pdf"
>(pdf)</ulink>
</primaryie>
</indexentry>
@@ -90,9 +90,9 @@
<indexentry>
<primaryie>Struts Tools Reference Guide <ulink
- url="en/struts_tools_ref_Guide/html/index.html">(html)</ulink>
- <ulink url="en/struts_tools_ref_Guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/struts_tools_ref_Guide/pdf/Struts_Tools_Reference_Guide.pdf"
+ url="en/struts_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/struts_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/struts_tools_ref_guide/pdf/Struts_Tools_Reference_Guide.pdf"
>(pdf)</ulink>
</primaryie>
</indexentry>
16 years, 6 months
JBoss Tools SVN: r8490 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-05-30 12:44:25 -0400 (Fri, 30 May 2008)
New Revision: 8490
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java 2008-05-30 16:39:26 UTC (rev 8489)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java 2008-05-30 16:44:25 UTC (rev 8490)
@@ -25,7 +25,7 @@
private HBMInfoExtractorStub sourceLocator = new HBMInfoExtractorStub();
public void executeJavaTypeHandlerTest(String start, String attributeName) {
- sourceLocator.setPackageName("org");
+ sourceLocator.setPackageName("org"); //$NON-NLS-1$
MappingTestProject testProj = MappingTestProject.getTestProject();
IJavaProject project = testProj.getIJavaProject();
JavaTypeHandler javaTypeHandler = new JavaTypeHandler(sourceLocator);
@@ -37,23 +37,23 @@
}
public void testJavaTypeHandler1() {
- executeJavaTypeHandlerTest("a", "name");
+ executeJavaTypeHandlerTest("a", "name"); //$NON-NLS-1$//$NON-NLS-2$
}
public void testJavaTypeHandler2() {
- executeJavaTypeHandlerTest("", "name");
+ executeJavaTypeHandlerTest("", "name"); //$NON-NLS-1$//$NON-NLS-2$
}
public void testJavaTypeHandler3() {
- executeJavaTypeHandlerTest("a", "class");
+ executeJavaTypeHandlerTest("a", "class"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testJavaTypeHandler4() {
- executeJavaTypeHandlerTest("", "class");
+ executeJavaTypeHandlerTest("", "class"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void executePackageHandlerTest(String start, String attributeName) {
- sourceLocator.setPackageName("org");
+ sourceLocator.setPackageName("org"); //$NON-NLS-1$
MappingTestProject testProj = MappingTestProject.getTestProject();
IJavaProject project = testProj.getIJavaProject();
PackageHandler packageHandler = new PackageHandler(sourceLocator);
@@ -65,11 +65,11 @@
}
public void testPackageHandler1() {
- executePackageHandlerTest("o", "package");
+ executePackageHandlerTest("o", "package"); //$NON-NLS-1$//$NON-NLS-2$
}
public void testPackageHandler2() {
- executePackageHandlerTest("", "package");
+ executePackageHandlerTest("", "package"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
16 years, 6 months
JBoss Tools SVN: r8489 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test: mappingproject and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-05-30 12:39:26 -0400 (Fri, 30 May 2008)
New Revision: 8489
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/Messages.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Messages.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/messages.properties
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/messages.properties
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/BeanShellIntegrationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ContentAssistTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTestPlugin.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/JavaFormattingTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/BeanShellIntegrationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/BeanShellIntegrationTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/BeanShellIntegrationTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -8,7 +8,7 @@
public static class CallBack {
public void line(int number) {
- System.out.println(number + ":");
+ System.out.println(number + ":"); //$NON-NLS-1$
}
}
@@ -17,18 +17,18 @@
Interpreter bsh = new Interpreter();
try {
- bsh.set("callback", new CallBack());
+ bsh.set("callback", new CallBack()); //$NON-NLS-1$
StringBuffer buf = new StringBuffer();
- buf.append( "int i = 25;\r\n" );
- buf.append( "callback.line(1);\r\n" );
- buf.append( "int j = 23;\r\n" );
- buf.append( "callback.line(2);\r\n" );
- buf.append( "i+j;" );
- buf.append( "callback.line(3);" );
+ buf.append( "int i = 25;\r\n" ); //$NON-NLS-1$
+ buf.append( "callback.line(1);\r\n" ); //$NON-NLS-1$
+ buf.append( "int j = 23;\r\n" ); //$NON-NLS-1$
+ buf.append( "callback.line(2);\r\n" ); //$NON-NLS-1$
+ buf.append( "i+j;" ); //$NON-NLS-1$
+ buf.append( "callback.line(3);" ); //$NON-NLS-1$
Object object = bsh.eval( buf.toString() );
- System.out.println("Result: " + object);
+ System.out.println(Messages.BEANSHELLINTEGRATIONTEST_RESULT + object);
}
catch (EvalError e) {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -8,7 +8,6 @@
import junit.framework.TestCase;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ConsoleConfigurationListener;
@@ -61,17 +60,17 @@
File xmlConfig = null;
Bundle bundle = HibernateConsoleTestPlugin.getDefault().getBundle();
try {
- URL url = FileLocator.resolve(bundle.getEntry("/res/project/hibernate.cfg.xml"));
+ URL url = FileLocator.resolve(bundle.getEntry("/res/project/hibernate.cfg.xml")); //$NON-NLS-1$
xmlConfig = new File(url.getFile());
} catch (IOException e) {
- fail("Cannot find /res/project/hibernate.cfg.xml file");
+ fail("Cannot find /res/project/hibernate.cfg.xml file"); //$NON-NLS-1$
}
return xmlConfig;
}
public Properties getProperties() {
Properties p = new Properties();
- p.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
+ p.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect"); //$NON-NLS-1$ //$NON-NLS-2$
return p;
}
@@ -84,13 +83,13 @@
}
public String getName() {
- return "fake prefs";
+ return Messages.CONSOLECONFIGTEST_FAKE_PREFS;
}
public String getEntityResolverName() {
- return "";
+ return ""; //$NON-NLS-1$
}
public ConfigurationMode getConfigurationMode() {
@@ -147,12 +146,12 @@
try {
consoleCfg.buildSessionFactory();
- fail("Should throw an exception because a factory already exists!");
+ fail(Messages.CONSOLECONFIGTEST_FACTORY_ALREADY_EXISTS);
} catch (HibernateConsoleRuntimeException hcre) {
}
- QueryPage qp = consoleCfg.executeHQLQuery("from java.lang.Object");
+ QueryPage qp = consoleCfg.executeHQLQuery("from java.lang.Object"); //$NON-NLS-1$
assertEquals(1, listener.queryCreated);
consoleCfg.closeSessionFactory();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -11,7 +11,7 @@
public static Test suite() throws IOException {
TestSuite suite = new TestSuite(
- "Test for org.hibernate.eclipse.console.test" );
+ Messages.CONSOLEPLUGINALLTESTS_TEST_FOR );
suite.addTestSuite( KnownConfigurationsTest.class );
suite.addTestSuite( QueryParametersTest.class );
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ContentAssistTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ContentAssistTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ContentAssistTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -21,14 +21,14 @@
IScopeContext scope = new ProjectScope(prj.getProject() );
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
+ Preferences node = scope.getNode("org.hibernate.eclipse.console"); //$NON-NLS-1$
- node.putBoolean("hibernate3.enabled", true );
- node.put("default.configuration", "testcfg" );
+ node.putBoolean("hibernate3.enabled", true ); //$NON-NLS-1$
+ node.put("default.configuration", "testcfg" ); //$NON-NLS-1$ //$NON-NLS-2$
node.flush();
- ProjectUtils.addProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
- ProjectUtils.removeProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+ ProjectUtils.addProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); //$NON-NLS-1$
+ ProjectUtils.removeProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -22,10 +22,10 @@
super.setUp();
map = new HashMap();
- map.put("ejb3", new ExporterProperty("ejb3", "Use ejb3 syntax", "true", true));
- definition = new ExporterDefinition("exporterClass",
- "exporterDescription",
- "exporterId",
+ map.put("ejb3", new ExporterProperty("ejb3", "Use ejb3 syntax", "true", true)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ definition = new ExporterDefinition("exporterClass", //$NON-NLS-1$
+ "exporterDescription", //$NON-NLS-1$
+ "exporterId", //$NON-NLS-1$
map,
null);
@@ -45,27 +45,27 @@
// pure local manipulation
- assertNull(factory.setProperty("localValue", "true"));
- assertEquals("true", factory.getPropertyValue("localValue"));
- assertTrue(factory.hasLocalValueFor("localValue"));
- factory.removeProperty( "localValue" );
- assertNull(factory.getPropertyValue( "localValue" ));
- assertFalse(factory.hasLocalValueFor("localValue"));
+ assertNull(factory.setProperty("localValue", "true")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("true", factory.getPropertyValue("localValue")); //$NON-NLS-1$//$NON-NLS-2$
+ assertTrue(factory.hasLocalValueFor("localValue")); //$NON-NLS-1$
+ factory.removeProperty( "localValue" ); //$NON-NLS-1$
+ assertNull(factory.getPropertyValue( "localValue" )); //$NON-NLS-1$
+ assertFalse(factory.hasLocalValueFor("localValue")); //$NON-NLS-1$
}
public void testDefaultValues() {
- assertEquals("true", factory.getPropertyValue( "ejb3" ));
+ assertEquals("true", factory.getPropertyValue( "ejb3" )); //$NON-NLS-1$//$NON-NLS-2$
- assertFalse(factory.hasLocalValueFor("ejb3"));
+ assertFalse(factory.hasLocalValueFor("ejb3")); //$NON-NLS-1$
- factory.setProperty( "ejb3", "false");
- assertEquals("false", factory.getPropertyValue( "ejb3" ));
+ factory.setProperty( "ejb3", "false"); //$NON-NLS-1$//$NON-NLS-2$
+ assertEquals("false", factory.getPropertyValue( "ejb3" )); //$NON-NLS-1$//$NON-NLS-2$
- factory.removeProperty( "ejb3" );
+ factory.removeProperty( "ejb3" ); //$NON-NLS-1$
- assertEquals("true", factory.getPropertyValue( "ejb3" ));
+ assertEquals("true", factory.getPropertyValue( "ejb3" )); //$NON-NLS-1$//$NON-NLS-2$
}
public void testExporterEnablement() {
@@ -87,7 +87,7 @@
assertEquals(0, propertyDescriptors.length);
- factory.setProperty( "something", "true" );
+ factory.setProperty( "something", "true" ); //$NON-NLS-1$ //$NON-NLS-2$
propertyDescriptors = ips.getPropertyDescriptors();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -69,7 +69,7 @@
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(editorPart, false);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
- PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective"));
+ PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective")); //$NON-NLS-1$
this.project.deleteIProject();
@@ -121,7 +121,7 @@
while (!Job.getJobManager().isIdle()) {
delay(500);
if ( (System.currentTimeMillis()-start) > MAX_IDLE )
- throw new RuntimeException("A long running task detected");
+ throw new RuntimeException(Messages.HIBERNATECONSOLETEST_LONG_RUNNING_TASK_DETECTED);
}
delay(1000);
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTestPlugin.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTestPlugin.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTestPlugin.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -73,7 +73,7 @@
public ResourceBundle getResourceBundle() {
try {
if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.hibernate.eclipse.console.test.test.HibernateConsoleTestPluginResources");
+ resourceBundle = ResourceBundle.getBundle("org.hibernate.eclipse.console.test.test.HibernateConsoleTestPluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
resourceBundle = null;
}
@@ -88,16 +88,16 @@
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.hibernate.eclipse.console.test.test", path);
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.hibernate.eclipse.console.test.test", path); //$NON-NLS-1$
}
public File getFileInPlugin(IPath path) throws CoreException {
try {
- URL installURL= new URL(getBundle().getEntry("/"), path.toString());
+ URL installURL= new URL(getBundle().getEntry("/"), path.toString()); //$NON-NLS-1$
URL localURL= FileLocator.toFileURL(installURL);
return new File(localURL.getFile());
} catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, "org.hibernate.eclipse.console.test", IStatus.ERROR, e.getMessage(), e));
+ throw new CoreException(new Status(IStatus.ERROR, "org.hibernate.eclipse.console.test", IStatus.ERROR, e.getMessage(), e)); //$NON-NLS-1$
}
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/JavaFormattingTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/JavaFormattingTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/JavaFormattingTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -45,7 +45,7 @@
Map codeFormatterOptions = null;
CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(codeFormatterOptions);
- String contents = "java.lang.String str; System.out.println();";
+ String contents = "java.lang.String str; System.out.println();"; //$NON-NLS-1$
IDocument doc = new Document(contents);
TextEdit edit = codeFormatter.format(CodeFormatter.K_UNKNOWN, doc.get(), 0, doc.get().length(), 0, null);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -30,16 +30,16 @@
}
public void sessionFactoryBuilt(ConsoleConfiguration ccfg, SessionFactory builtFactory) {
- fail("no sf should be built!");
+ fail(Messages.KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_BUILD);
}
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory closingFactory) {
- fail("no sf should be closed!");
+ fail(Messages.KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_CLOSED);
}
public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
if(!added.remove(root)) {
- fail("trying to remove a non existing console");
+ fail(Messages.KNOWNCONFIGURATIONSTEST_TRYING_REMOVE_NON_EXISTING_CONSOLE);
}
}
}
@@ -101,7 +101,7 @@
}
public String getName() {
- return "fake prefs";
+ return Messages.KNOWNCONFIGURATIONSTEST_FAKE_PREFS;
}
public boolean useAnnotations() {
@@ -133,7 +133,7 @@
ConsoleConfigurationPreferences preferences2 = new ConsoleConfigurationPreferences() {
- String name = "new test";
+ String name = Messages.KNOWNCONFIGURATIONSTEST_NEW_TEST;
public void setName(String name) {
this.name = name;
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/Messages.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/Messages.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/Messages.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -0,0 +1,35 @@
+package org.hibernate.eclipse.console.test;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.eclipse.console.test.messages"; //$NON-NLS-1$
+ public static String BEANSHELLINTEGRATIONTEST_RESULT;
+ public static String CONSOLECONFIGTEST_FACTORY_ALREADY_EXISTS;
+ public static String CONSOLECONFIGTEST_FAKE_PREFS;
+ public static String CONSOLEPLUGINALLTESTS_TEST_FOR;
+ public static String HIBERNATECONSOLETEST_LONG_RUNNING_TASK_DETECTED;
+ public static String KNOWNCONFIGURATIONSTEST_FAKE_PREFS;
+ public static String KNOWNCONFIGURATIONSTEST_NEW_TEST;
+ public static String KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_BUILD;
+ public static String KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_CLOSED;
+ public static String KNOWNCONFIGURATIONSTEST_TRYING_REMOVE_NON_EXISTING_CONSOLE;
+ public static String PERSPECTIVETEST_HIBERNATE;
+ public static String REFACTORINGTEST_CATEGORY;
+ public static String REFACTORINGTEST_COREEXCEPTION_OCCURED_WORK_WITH_MEMENTO;
+ public static String REFACTORINGTEST_EXCEPTION_WHILE_FILENAMECHANGE_REFACTOR;
+ public static String REFACTORINGTEST_EXCEPTION_WHILE_FINDCHANGE_LAUNCH_CONFIG_PROCESSING;
+ public static String REFACTORINGTEST_EXCEPTION_WHILE_PACKNAMECHANGE_REFACTOR;
+ public static String REFACTORINGTEST_EXCEPTION_WHILE_PROJNAMECHANGE_REFACTOR;
+ public static String REFACTORINGTEST_EXCEPTION_WHILE_SRCNAMECHANGE_REFACTOR;
+ public static String REFACTORINGTEST_METHOD_NOT_TESTED;
+ public static String REFACTORINGTEST_SEGMENTNUM_TOO_MATCH;
+ public static String REFACTORINGTEST_TEST_LAUNCH_CONFIG;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -14,7 +14,7 @@
IPerspectiveDescriptor perspective = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getPerspective();
- assertEquals(perspective.getLabel(), "Hibernate");
+ assertEquals(perspective.getLabel(), Messages.PERSPECTIVETEST_HIBERNATE);
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -57,10 +57,10 @@
QueryInputModel model = new QueryInputModel();
- ConsoleQueryParameter parameter = model.createUniqueParameter("param");
+ ConsoleQueryParameter parameter = model.createUniqueParameter("param"); //$NON-NLS-1$
model.addParameter(parameter);
- assertFalse(model.createUniqueParameter("param").getName().equals(parameter.getName()));
+ assertFalse(model.createUniqueParameter("param").getName().equals(parameter.getName())); //$NON-NLS-1$
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -45,8 +45,8 @@
*/
public class RefactoringTest extends TestCase {
- private final String[] oldPathElements = new String[]{"oldPrj","oldSrc", "oldPack", "oldHibernate.cfg.xml"};
- private final String[] newPathElements = new String[]{"newPrj","newSrc", "newPack", "newHibernate.cfg.xml"};
+ private final String[] oldPathElements = new String[]{"oldPrj","oldSrc", "oldPack", "oldHibernate.cfg.xml"}; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ private final String[] newPathElements = new String[]{"newPrj","newSrc", "newPack", "newHibernate.cfg.xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
SimpleTestProject project = null;
@@ -65,8 +65,8 @@
oldPathStr = oldPathElements[0];
String notChangedPathStr = oldPathElements[0] + 1;
for (int i = 1; i < oldPathElements.length; i++) {
- oldPathStr += "/" + oldPathElements[i];
- notChangedPathStr += "/" + oldPathElements[i] + 1;
+ oldPathStr += "/" + oldPathElements[i]; //$NON-NLS-1$
+ notChangedPathStr += "/" + oldPathElements[i] + 1; //$NON-NLS-1$
}
Map<String, Object> testStrAttr = new HashMap<String, Object>();
Map<String, Object> testStrListAttr = new HashMap<String, Object>();
@@ -110,7 +110,7 @@
assertTrue(HibernateRefactoringUtil.isConfigurationAffected(testStrListConfig, oldPathPart));
assertFalse(HibernateRefactoringUtil.isConfigurationAffected(testNotChangedConfig, oldPathPart));
} catch (CoreException e) {
- fail("Exception while FindChanged launch configurations processing!" + e.getMessage());
+ fail(Messages.REFACTORINGTEST_EXCEPTION_WHILE_FINDCHANGE_LAUNCH_CONFIG_PROCESSING + e.getMessage());
}
}
}
@@ -132,7 +132,7 @@
String newMemento = newMementos.get(0);
checkMementoChanged(oldMemento, newMemento, oldPathPart, newPath);
} catch (CoreException e) {
- fail("CoreException occured when try to work with memento." + e.getMessage());
+ fail(Messages.REFACTORINGTEST_COREEXCEPTION_OCCURED_WORK_WITH_MEMENTO + e.getMessage());
}
} else {
assertFalse(HibernateRefactoringUtil.isRuntimeClassPathEntriesAffected(new IRuntimeClasspathEntry[]{runtimeClasspathEntries[j]}, oldPathPart));
@@ -147,7 +147,7 @@
updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
- fail("Exception while ProjectNameChange refactor processing!");
+ fail(Messages.REFACTORINGTEST_EXCEPTION_WHILE_PROJNAMECHANGE_REFACTOR);
}
}
@@ -157,7 +157,7 @@
updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
- fail("Exception while SrcNameChange refactor processing!");
+ fail(Messages.REFACTORINGTEST_EXCEPTION_WHILE_SRCNAMECHANGE_REFACTOR);
}
}
@@ -167,7 +167,7 @@
updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
- fail("Exception while PackNameChange refactor processing!");
+ fail(Messages.REFACTORINGTEST_EXCEPTION_WHILE_PACKNAMECHANGE_REFACTOR);
}
}
@@ -177,7 +177,7 @@
updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
- fail("Exception while FileNameChange refactor processing!");
+ fail(Messages.REFACTORINGTEST_EXCEPTION_WHILE_FILENAMECHANGE_REFACTOR);
}
}
@@ -199,14 +199,14 @@
* /myProj/mySrc, \myProj\mySrc, myProj/mySrc, myProj\mySrc, myProj/mySrc/, myProj\mySrc\
* mean the same path and should be represented as myProj[\\\\,/]mySrc regular expression
*/
- String oldPathStr = oldPathPart.toOSString().replaceAll("\\\\", "/"); //replace all "\" on "/"
- String newPathStr = newPath.toOSString().replaceAll("\\\\", "/");
+ String oldPathStr = oldPathPart.toOSString().replaceAll("\\\\", "/"); //replace all "\" on "/" //$NON-NLS-1$ //$NON-NLS-2$
+ String newPathStr = newPath.toOSString().replaceAll("\\\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
if (oldPathStr.charAt(0) == '/') oldPathStr = oldPathStr.substring(1); //remove first slash
if (newPathStr.charAt(0) == '/') newPathStr = newPathStr.substring(1);
if (oldPathStr.charAt(oldPathStr.length() - 1) == '/') oldPathStr = oldPathStr.substring(0, oldPathStr.length() - 1); //remove last slash
if (newPathStr.charAt(newPathStr.length() - 1) == '/') newPathStr = newPathStr.substring(0 , newPathStr.length() - 1);
- oldPathStr = oldPathStr.replaceAll("/", "[\\\\,/]?");
- newPathStr = newPathStr.replaceAll("/", "[\\\\,/]?");
+ oldPathStr = oldPathStr.replaceAll("/", "[\\\\,/]?"); //$NON-NLS-1$ //$NON-NLS-2$
+ newPathStr = newPathStr.replaceAll("/", "[\\\\,/]?"); //$NON-NLS-1$//$NON-NLS-2$
int count_old = 0;
int count_new = 0;
@@ -237,32 +237,32 @@
}
private Path generateNewPathForSegment(int segmentNum){
- assertTrue("SegmentNum is too mach.", segmentNum < oldPathElements.length);
- String newPath = "";
+ assertTrue(Messages.REFACTORINGTEST_SEGMENTNUM_TOO_MATCH, segmentNum < oldPathElements.length);
+ String newPath = ""; //$NON-NLS-1$
for (int i = 0; i < segmentNum; i++) {
- newPath += oldPathElements[i] + "/";
+ newPath += oldPathElements[i] + "/"; //$NON-NLS-1$
}
newPath += newPathElements[segmentNum];
return new Path(newPath);
}
private Path generateOldPathForSegment(int segmentNum){
- assertTrue("SegmentNum is too mach.", segmentNum < oldPathElements.length);
- String oldPathPart = "";
+ assertTrue(Messages.REFACTORINGTEST_SEGMENTNUM_TOO_MATCH, segmentNum < oldPathElements.length);
+ String oldPathPart = ""; //$NON-NLS-1$
for (int i = 0; i <= segmentNum; i++) {
- oldPathPart += oldPathElements[i] + "/";
+ oldPathPart += oldPathElements[i] + "/"; //$NON-NLS-1$
}
return new Path(oldPathPart);
}
private Path generateTruePathForSegment(int segmentNum){
- assertTrue("SegmentNum is too mach.", segmentNum < oldPathElements.length);
- String newPath = "";
+ assertTrue(Messages.REFACTORINGTEST_SEGMENTNUM_TOO_MATCH, segmentNum < oldPathElements.length);
+ String newPath = ""; //$NON-NLS-1$
for (int i = 0; i < oldPathElements.length; i++) {
if (i != segmentNum){
- newPath += oldPathElements[i] + "/";
+ newPath += oldPathElements[i] + "/"; //$NON-NLS-1$
} else
- newPath += newPathElements[i] + "/";
+ newPath += newPathElements[i] + "/"; //$NON-NLS-1$
}
return new Path(newPath);
}
@@ -287,12 +287,12 @@
public boolean hasAttribute(String attributeName)
throws CoreException {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return false;
}
public Object removeAttribute(String attributeName) {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return null;
}
public ILaunchConfiguration getOriginal() {
@@ -321,19 +321,19 @@
attributes.put(attributeName, value);
}
- public void setAttribute(String attributeName, Map value) {fail("Method doesn't tested");}
+ public void setAttribute(String attributeName, Map value) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setAttribute(String attributeName, boolean value) {fail("Method doesn't tested");}
+ public void setAttribute(String attributeName, boolean value) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setAttributes(Map attributes) { fail("Method doesn't tested");}
+ public void setAttributes(Map attributes) { fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setContainer(IContainer container) {fail("Method doesn't tested");}
+ public void setContainer(IContainer container) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setMappedResources(IResource[] resources) {fail("Method doesn't tested");}
+ public void setMappedResources(IResource[] resources) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setModes(Set modes) {fail("Method doesn't tested");}
+ public void setModes(Set modes) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
- public void setPreferredLaunchDelegate(Set modes, String delegateId) {fail("Method doesn't tested");}
+ public void setPreferredLaunchDelegate(Set modes, String delegateId) {fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);}
public boolean contentsEqual(ILaunchConfiguration configuration) {
return false;
@@ -341,7 +341,7 @@
public ILaunchConfigurationWorkingCopy copy(String name)
throws CoreException {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return null;
}
@@ -358,7 +358,7 @@
public int getAttribute(String attributeName, int defaultValue)
throws CoreException {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return 0;
}
@@ -369,13 +369,13 @@
public Set getAttribute(String attributeName, Set defaultValue)
throws CoreException {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return null;
}
public Map getAttribute(String attributeName, Map defaultValue)
throws CoreException {
- fail("Method doesn't tested");
+ fail(Messages.REFACTORINGTEST_METHOD_NOT_TESTED);
return null;
}
@@ -563,7 +563,7 @@
}
public String getCategory() throws CoreException {
- return "Categiry";
+ return Messages.REFACTORINGTEST_CATEGORY;
}
public IFile getFile() {
@@ -587,7 +587,7 @@
}
public String getName() {
- return "Test Launch Config";
+ return Messages.REFACTORINGTEST_TEST_LAUNCH_CONFIG;
}
public ILaunchDelegate getPreferredDelegate(Set modes)
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -26,9 +26,9 @@
final private String projectName;
- public static String PACKAGE_NAME = "test";
- public static String TYPE_NAME = "TestClass";
- public static String FILE_NAME = "TestClass.java";
+ public static String PACKAGE_NAME = "test"; //$NON-NLS-1$
+ public static String TYPE_NAME = "TestClass"; //$NON-NLS-1$
+ public static String FILE_NAME = "TestClass.java"; //$NON-NLS-1$
public SimpleTestProject(String projectName) {
@@ -37,7 +37,7 @@
}
public SimpleTestProject() {
- projectName = "HibernateToolsTestProject";
+ projectName = "HibernateToolsTestProject"; //$NON-NLS-1$
initialize();
}
@@ -58,7 +58,7 @@
}
public String getFullyQualifiedTestClassName(){
- return PACKAGE_NAME + "." + TYPE_NAME;
+ return PACKAGE_NAME + "." + TYPE_NAME; //$NON-NLS-1$
}
public IType getTestClassType() {
@@ -73,7 +73,7 @@
}
public IField getTestClassField() {
- return getTestClassType().getField("testField");
+ return getTestClassType().getField("testField"); //$NON-NLS-1$
}
public void deleteIProject() {
@@ -144,7 +144,7 @@
private IPackageFragmentRoot buildSourceFolder(IProject project,
IJavaProject javaProject) throws CoreException {
- IFolder folder = project.getFolder("src");
+ IFolder folder = project.getFolder("src"); //$NON-NLS-1$
folder.create(false, true, null);
IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
IClasspathEntry[] newEntries = { JavaCore
@@ -166,13 +166,13 @@
//create empty ICompilationUnit
ICompilationUnit cu = pack.createCompilationUnit(cuName,
- "", false, null);
+ "", false, null); //$NON-NLS-1$
cu.createPackageDeclaration(pack.getElementName(),null);
- IType type = cu.createType("public class " + TYPE_NAME + " {}",null,false,null);
- type.createField("private String testField;",null,false,null);
- type.createMethod("public String getTestField() {return this.testField;}",null,false,null);
- type.createMethod("public void setTestField(String testField) {this.testField = testField;}",null,false,null);
+ IType type = cu.createType("public class " + TYPE_NAME + " {}",null,false,null); //$NON-NLS-1$//$NON-NLS-2$
+ type.createField("private String testField;",null,false,null); //$NON-NLS-1$
+ type.createMethod("public String getTestField() {return this.testField;}",null,false,null); //$NON-NLS-1$
+ type.createMethod("public void setTestField(String testField) {this.testField = testField;}",null,false,null); //$NON-NLS-1$
return type;
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -25,7 +25,7 @@
/**
* packages name pattern
*/
- public static final String TEST_PACKS_PATTERN = ".*\\.bidi";
+ public static final String TEST_PACKS_PATTERN = ".*\\.bidi"; //$NON-NLS-1$
/**
* is stop after missing package or run further
@@ -55,7 +55,7 @@
/**
* Hibernate Dialect
*/
- public static final String HIBERNATE_DIALECT = "org.hibernate.dialect.HSQLDialect";
+ public static final String HIBERNATE_DIALECT = "org.hibernate.dialect.HSQLDialect"; //$NON-NLS-1$
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -47,7 +47,7 @@
this.project = MappingTestProject.getTestProject();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
- PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective"));
+ PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective")); //$NON-NLS-1$
IPackagesViewPart packageExplorer = null;
try {
@@ -184,11 +184,11 @@
//==============================
pack_count++;
if (Customization.USE_CONSOLE_OUTPUT){
- System.out.print( result.errorCount() - prev_errCount + " errors. \t");
- System.out.print( result.failureCount() - prev_failCount + " fails.\t");
+ System.out.print( result.errorCount() - prev_errCount + Messages.HIBERNATEALLMAPPINGTESTS_ERRORS + " \t"); //$NON-NLS-1$
+ System.out.print( result.failureCount() - prev_failCount + Messages.HIBERNATEALLMAPPINGTESTS_FAILS + "\t"); //$NON-NLS-1$
long period = System.currentTimeMillis() - st_pack_time;
- String time = period / 1000 + "." + (period % 1000) / 100;
- System.out.println( time +" sec. " + javaElement.getElementName());
+ String time = period / 1000 + "." + (period % 1000) / 100; //$NON-NLS-1$
+ System.out.println( time +Messages.HIBERNATEALLMAPPINGTESTS_SECONDS + javaElement.getElementName());
}
waitForJobs();
delay(Customization.EACTH_PACK_TEST_DELAY);
@@ -202,11 +202,11 @@
}
}
if (Customization.USE_CONSOLE_OUTPUT){
- System.out.println( "=====================================================");
- System.out.print( result.errorCount() + " errors. \t");
- System.out.print( result.failureCount() + " fails.\t");
- System.out.print(( System.currentTimeMillis() - start_time ) / 1000 + " seconds.\t" );
- System.out.println( pack_count + " packages tested." );
+ System.out.println( "====================================================="); //$NON-NLS-1$
+ System.out.print( result.errorCount() + Messages.HIBERNATEALLMAPPINGTESTS_ERRORS + " \t"); //$NON-NLS-1$
+ System.out.print( result.failureCount() + Messages.HIBERNATEALLMAPPINGTESTS_FAILS + "\t"); //$NON-NLS-1$
+ System.out.print(( System.currentTimeMillis() - start_time ) / 1000 + Messages.HIBERNATEALLMAPPINGTESTS_SECONDS + "\t" ); //$NON-NLS-1$
+ System.out.println( pack_count + Messages.HIBERNATEALLMAPPINGTESTS_PACKAGES_TESTED );
}
waitForJobs();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -26,6 +26,6 @@
MappingTestProject project = MappingTestProject.getTestProject();
IJavaProject prj = project.getIJavaProject();
- ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg");
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg"); //$NON-NLS-1$
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -23,6 +23,6 @@
public class HibernateNatureRemoveTest extends TestCase {
public void testHibernateNatureRemove() throws BackingStoreException, CoreException {
MappingTestProject project = MappingTestProject.getTestProject();
- ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg");
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg"); //$NON-NLS-1$
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -50,16 +50,16 @@
*/
public class MappingTestProject{
- public static final String SRC_FOLDER = "src";
+ public static final String SRC_FOLDER = "src"; //$NON-NLS-1$
- public static final String LIB_FOLDER = "lib";
+ public static final String LIB_FOLDER = "lib"; //$NON-NLS-1$
private static MappingTestProject singleton= null;
- private static final Path JRE_CONTAINER = new Path("org.eclipse.jdt.launching.JRE_CONTAINER");
+ private static final Path JRE_CONTAINER = new Path("org.eclipse.jdt.launching.JRE_CONTAINER"); //$NON-NLS-1$
- public static String PROJECT_NAME = "MappingTestProject";
- public static String RESOURCE_PATH = "res/project/";
+ public static String PROJECT_NAME = "MappingTestProject"; //$NON-NLS-1$
+ public static String RESOURCE_PATH = "res/project/"; //$NON-NLS-1$
private static FileFilter fileFilter = new FileFilter(){
public boolean accept(File pathname) {
@@ -76,7 +76,7 @@
private static FileFilter jarFilter = new FileFilter(){
public boolean accept(File pathname) {
- return !pathname.isDirectory() || pathname.getName().endsWith(".jar");
+ return !pathname.isDirectory() || pathname.getName().endsWith(".jar"); //$NON-NLS-1$
}};
private IProject project;
@@ -124,7 +124,7 @@
String tplPrjLcStr= FileLocator.resolve(resProject).getFile();
resourceFolder = new File(tplPrjLcStr);
if (!resourceFolder.exists())
- throw new RuntimeException("Folder " + RESOURCE_PATH + " not found!");
+ throw new RuntimeException(Messages.MAPPINGTESTPROJECT_FOLDER + RESOURCE_PATH + Messages.MAPPINGTESTPROJECT_NOT_FOUND);
IPackageFragmentRoot sourceFolder = createSourceFolder(project, javaProject);
recursiveCopyFiles(resourceFolder, (IFolder) sourceFolder.getResource());
@@ -172,9 +172,9 @@
javaProject.getPackageFragmentRoot(dst);
}
- File libFolder = new File(res.getAbsolutePath()+"/" + LIB_FOLDER);
+ File libFolder = new File(res.getAbsolutePath()+"/" + LIB_FOLDER); //$NON-NLS-1$
if ( !libFolder.exists() )
- throw new RuntimeException("Folder " + RESOURCE_PATH + "/" + LIB_FOLDER + " not found!");
+ throw new RuntimeException(Messages.MAPPINGTESTPROJECT_FOLDER + RESOURCE_PATH + "/" + LIB_FOLDER + Messages.MAPPINGTESTPROJECT_NOT_FOUND); //$NON-NLS-1$
List<IPath> libs = new ArrayList<IPath>();
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Messages.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Messages.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Messages.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -0,0 +1,44 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.eclipse.console.test.mappingproject.messages"; //$NON-NLS-1$
+ public static String HIBERNATEALLMAPPINGTESTS_ERRORS;
+ public static String HIBERNATEALLMAPPINGTESTS_FAILS;
+ public static String HIBERNATEALLMAPPINGTESTS_PACKAGES_TESTED;
+ public static String HIBERNATEALLMAPPINGTESTS_SECONDS;
+ public static String MAPPINGTESTPROJECT_FOLDER;
+ public static String MAPPINGTESTPROJECT_NOT_FOUND;
+ public static String OPENJAVAEDITORS_ERROR_OPENNING_COMPILATIONUNIT;
+ public static String OPENMAPPINGDIAGRAMTEST_CANNOT_BE_OPENED;
+ public static String OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMM_FOR;
+ public static String OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMMS_FOR_PACKAGE;
+ public static String OPENMAPPINGDIAGRAMTEST_NOT_OPENED;
+ public static String OPENMAPPINGFILETEST_CANNOT_BE_OPENED;
+ public static String OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR;
+ public static String OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR_PROPERTY;
+ public static String OPENMAPPINGFILETEST_IS_EMPTY_PACKAGE;
+ public static String OPENMAPPINGFILETEST_MAPPING_FILE_FOR;
+ public static String OPENMAPPINGFILETEST_MAPPING_FILE_FOR_PROPERTY;
+ public static String OPENMAPPINGFILETEST_MAPPING_FILES_FOR_PACKAGE;
+ public static String OPENMAPPINGFILETEST_NOT_OPENED_PACKAGE;
+ public static String OPENSOURCEFILETEST_CANNOT_BE_OPENED;
+ public static String OPENSOURCEFILETEST_HIGHLIGHTED_REGION_FOR;
+ public static String OPENSOURCEFILETEST_IS_EMPTY;
+ public static String OPENSOURCEFILETEST_MAPPING_FILE_FOR;
+ public static String OPENSOURCEFILETEST_NOT_OPENED;
+ public static String OPENSOURCEFILETEST_SOURCE_FILES_FOR_PACKAGE;
+ public static String PROJECTUTIL_CANNOT_GET_ERROR_FIELD_FROM_ERROREDITORPART;
+ public static String PROJECTUTIL_CANNOT_GET_EXCEPTION_FROM_ERROREDITORPART;
+ public static String TESTSET_TEST_FOR_MAPPINGTESTPROJECT;
+ public static String UPDATECONFIGURATIONTEST_ERROR_CUSTOMISING;
+ public static String UPDATECONFIGURATIONTEST_FILE_FOR_PACKAGE;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -50,7 +50,7 @@
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, JavaUI.ID_CU_EDITOR );
} catch (PartInitException e) {
- fail("Error opening CompilationUnit: " + e.getMessage());
+ fail(Messages.OPENJAVAEDITORS_ERROR_OPENNING_COMPILATIONUNIT + e.getMessage());
}
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -41,8 +41,8 @@
assertTrue(configs[0] instanceof Configuration);
persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
} catch (InvalidMappingException ex){
- fail("Mapping Diagramms for package " + HibernateAllMappingTests.getActivePackage().getElementName()
- + " can't be opened:\n " + ex.getMessage());
+ fail(Messages.OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMMS_FOR_PACKAGE + HibernateAllMappingTests.getActivePackage().getElementName()
+ + Messages.OPENMAPPINGDIAGRAMTEST_CANNOT_BE_OPENED + ex.getMessage());
}
if (persClasses.length > 0){
@@ -58,8 +58,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping Diagramm for " + persClass.getClassName()
- + " not opened:\n" + ex.getMessage());
+ if (ex != null) fail(Messages.OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMM_FOR + persClass.getClassName()
+ + Messages.OPENMAPPINGDIAGRAMTEST_NOT_OPENED + ex.getMessage());
}
}
//close all editors
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -54,8 +54,8 @@
assertTrue(configs[0] instanceof Configuration);
persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
} catch (InvalidMappingException ex){
- fail("Mapping Files for package " + HibernateAllMappingTests.getActivePackage().getElementName()
- + " can't be opened:\n " + ex.getMessage());
+ fail(Messages.OPENMAPPINGFILETEST_MAPPING_FILES_FOR_PACKAGE + HibernateAllMappingTests.getActivePackage().getElementName()
+ + Messages.OPENMAPPINGFILETEST_CANNOT_BE_OPENED + ex.getMessage());
}
if (persClasses.length > 0){
for (int i = 0; i < persClasses.length; i++) {
@@ -85,8 +85,8 @@
editor = OpenMappingAction.run(compositeProperty, parentProperty, consCFG);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
if (!highlighted)
- fail("Highlighted region for property" + compositeProperty.getNodeName() + " is empty. (package "
- + HibernateAllMappingTests.getActivePackage().getElementName() + ")");
+ fail(Messages.OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR_PROPERTY + compositeProperty.getNodeName() + Messages.OPENMAPPINGFILETEST_IS_EMPTY_PACKAGE
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")"); //$NON-NLS-1$
Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(compositeProperty);
for (int k = 0; k < compProperties.length; k++) {
//test Composite properties
@@ -102,8 +102,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for property" + compositeProperty.getNodeName() + " not opened: (package "
- + HibernateAllMappingTests.getActivePackage().getElementName() + ")\n" + ex.getMessage());
+ if (ex != null) fail(Messages.OPENMAPPINGFILETEST_MAPPING_FILE_FOR_PROPERTY + compositeProperty.getNodeName() + Messages.OPENMAPPINGFILETEST_NOT_OPENED_PACKAGE
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")\n" + ex.getMessage()); //$NON-NLS-1$
}
private void openTest(Object selection, ConsoleConfiguration consCFG){
@@ -113,8 +113,8 @@
editor = OpenMappingAction.run(selection, consCFG);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
if (!highlighted)
- fail("Highlighted region for " + selection + " is empty. (package "
- + HibernateAllMappingTests.getActivePackage().getElementName() + ")");
+ fail(Messages.OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR + selection + Messages.OPENMAPPINGFILETEST_IS_EMPTY_PACKAGE
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")"); //$NON-NLS-1$
} catch (PartInitException e) {
ex = e;
} catch (JavaModelException e) {
@@ -123,8 +123,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for " + selection + " not opened (package "
- + HibernateAllMappingTests.getActivePackage().getElementName() + ") :\n" + ex.getMessage());
+ if (ex != null) fail(Messages.OPENMAPPINGFILETEST_MAPPING_FILE_FOR + selection + Messages.OPENMAPPINGFILETEST_NOT_OPENED_PACKAGE
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ") :\n" + ex.getMessage()); //$NON-NLS-1$
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -50,8 +50,8 @@
assertTrue(configs[0] instanceof Configuration);
persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
} catch (InvalidMappingException ex){
- fail("Source files for package " + HibernateAllMappingTests.getActivePackage().getElementName()
- + " can't be opened:\n " + ex.getMessage());
+ fail(Messages.OPENSOURCEFILETEST_SOURCE_FILES_FOR_PACKAGE + HibernateAllMappingTests.getActivePackage().getElementName()
+ + Messages.OPENSOURCEFILETEST_CANNOT_BE_OPENED + ex.getMessage());
}
if (persClasses.length > 0){
for (int i = 0; i < persClasses.length; i++) {
@@ -91,7 +91,7 @@
editor = new OpenSourceAction().run(selection, MappingTestProject.getTestProject().getIJavaProject(),
fullyQualifiedName);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
- if (!highlighted) fail("Highlighted region for " + selection + " is empty.");
+ if (!highlighted) fail(Messages.OPENSOURCEFILETEST_HIGHLIGHTED_REGION_FOR + selection + Messages.OPENSOURCEFILETEST_IS_EMPTY);
} catch (PartInitException e) {
ex = e;
} catch (JavaModelException e) {
@@ -100,8 +100,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for " + fullyQualifiedName/*.getClassName()*/
- + " not opened:\n" + ex.getMessage());
+ if (ex != null) fail(Messages.OPENSOURCEFILETEST_MAPPING_FILE_FOR + fullyQualifiedName/*.getClassName()*/
+ + Messages.OPENSOURCEFILETEST_NOT_OPENED + ex.getMessage());
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -40,24 +40,24 @@
*/
public class ProjectUtil {
- private static final StringBuilder XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
- .append("<!DOCTYPE hibernate-configuration PUBLIC\n")
- .append("\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n")
- .append("\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n");
+ private static final StringBuilder XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") //$NON-NLS-1$
+ .append("<!DOCTYPE hibernate-configuration PUBLIC\n") //$NON-NLS-1$
+ .append("\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n") //$NON-NLS-1$
+ .append("\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n"); //$NON-NLS-1$
- private static final StringBuilder XML_CFG_START = new StringBuilder("<hibernate-configuration>\n")
- .append("<session-factory>\n")
- .append("<property name=\"hibernate.dialect\">")
+ private static final StringBuilder XML_CFG_START = new StringBuilder("<hibernate-configuration>\n") //$NON-NLS-1$
+ .append("<session-factory>\n") //$NON-NLS-1$
+ .append("<property name=\"hibernate.dialect\">") //$NON-NLS-1$
.append(Customization.HIBERNATE_DIALECT)
- .append("</property>");
+ .append("</property>"); //$NON-NLS-1$
- private static final StringBuilder XML_CFG_END = new StringBuilder("</session-factory>\n")
- .append("</hibernate-configuration>\n");
+ private static final StringBuilder XML_CFG_END = new StringBuilder("</session-factory>\n") //$NON-NLS-1$
+ .append("</hibernate-configuration>\n"); //$NON-NLS-1$
- public static final String CFG_FILE_NAME = "hibernate.cfg.xml";
+ public static final String CFG_FILE_NAME = "hibernate.cfg.xml"; //$NON-NLS-1$
- public static final String ConsoleCFGName = "testConfigName";
+ public static final String ConsoleCFGName = "testConfigName"; //$NON-NLS-1$
public static void customizeCFGFileForPack(IPackageFragment pack) throws CoreException{
IFolder srcFolder = (IFolder) pack.getParent().getResource();
@@ -65,14 +65,14 @@
if (iFile.exists()) {
iFile.delete(true, null);
}
- String file_boby = XML_HEADER.toString() + XML_CFG_START.toString();
+ String file_body = XML_HEADER.toString() + XML_CFG_START.toString();
if (pack.getNonJavaResources().length > 0){
Object[] ress = pack.getNonJavaResources();
for (int i = 0; i < ress.length; i++) {
if (ress[i] instanceof IFile){
IFile res = (IFile)ress[i];
- if (res.getName().endsWith(".hbm.xml")){
- file_boby += "<mapping resource=\"" + pack.getElementName().replace('.', '/') + '/' + res.getName() + "\"/>\n";
+ if (res.getName().endsWith(".hbm.xml")){ //$NON-NLS-1$
+ file_body += "<mapping resource=\"" + pack.getElementName().replace('.', '/') + '/' + res.getName() + "\"/>\n"; //$NON-NLS-1$//$NON-NLS-2$
}
}
}
@@ -91,14 +91,14 @@
}
}*/
- file_boby += XML_CFG_END.toString();
- iFile.create(new StringInputStream(file_boby),
+ file_body += XML_CFG_END.toString();
+ iFile.create(new StringInputStream(file_body),
true, null);
}
public static String getPersistentClassName(PersistentClass persClass) {
if (persClass == null) {
- return "";
+ return ""; //$NON-NLS-1$
} else {
return persClass.getEntityName() != null ? persClass.getEntityName() : persClass.getClassName();
}
@@ -111,11 +111,11 @@
private static class ConsoleConfigurationCreationWizard2 extends ConsoleConfigurationCreationWizard{
public void run() throws CoreException {
- IPath cfgFilePath = new Path(MappingTestProject.PROJECT_NAME + "/" +
- MappingTestProject.SRC_FOLDER + "/" + ProjectUtil.CFG_FILE_NAME);
+ IPath cfgFilePath = new Path(MappingTestProject.PROJECT_NAME + "/" + //$NON-NLS-1$
+ MappingTestProject.SRC_FOLDER + "/" + ProjectUtil.CFG_FILE_NAME); //$NON-NLS-1$
createConsoleConfiguration(null, null, ConsoleCFGName, ConsoleConfigurationPreferences.ConfigurationMode.CORE,
- MappingTestProject.PROJECT_NAME, true, "",
- null, cfgFilePath, new Path[0], new Path[0], "", "", new NullProgressMonitor());
+ MappingTestProject.PROJECT_NAME, true, "", //$NON-NLS-1$
+ null, cfgFilePath, new Path[0], new Path[0], "", "", new NullProgressMonitor()); //$NON-NLS-1$//$NON-NLS-2$
}
}
@@ -134,7 +134,7 @@
Class<ErrorEditorPart> clazz = ErrorEditorPart.class;
Field field;
try {
- field = clazz.getDeclaredField("error");
+ field = clazz.getDeclaredField("error"); //$NON-NLS-1$
field.setAccessible(true);
@@ -147,13 +147,13 @@
}
// catch close means that exception occurred but we can't get it
} catch (SecurityException e) {
- return new RuntimeException("Can't get exception from ErrorEditorPart. " + e.getMessage());
+ return new RuntimeException(Messages.PROJECTUTIL_CANNOT_GET_EXCEPTION_FROM_ERROREDITORPART + e.getMessage());
} catch (NoSuchFieldException e) {
- return new RuntimeException("Can't get error field from ErrorEditorPart. " + e.getMessage());
+ return new RuntimeException(Messages.PROJECTUTIL_CANNOT_GET_ERROR_FIELD_FROM_ERROREDITORPART + e.getMessage());
} catch (IllegalArgumentException e) {
- return new RuntimeException("Can't get error field from ErrorEditorPart. " + e.getMessage());
+ return new RuntimeException(Messages.PROJECTUTIL_CANNOT_GET_ERROR_FIELD_FROM_ERROREDITORPART + e.getMessage()); //$NON-NLS-1$
} catch (IllegalAccessException e) {
- return new RuntimeException("Can't get error field from ErrorEditorPart. " + e.getMessage());
+ return new RuntimeException(Messages.PROJECTUTIL_CANNOT_GET_ERROR_FIELD_FROM_ERROREDITORPART + e.getMessage()); //$NON-NLS-1$
}
}
return null;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -23,7 +23,7 @@
* @return
*/
public static TestSuite getTests(){
- TestSuite suite = new TestSuite("Test for MappingTestProject" );
+ TestSuite suite = new TestSuite(Messages.TESTSET_TEST_FOR_MAPPINGTESTPROJECT );
addTestsPackSetUp( suite );
addPackTests( suite );
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -19,7 +19,7 @@
*/
public class TestSetAfterSetup {
public static TestSuite getTests(){
- TestSuite suite = new TestSuite("Test for MappingTestProject" );
+ TestSuite suite = new TestSuite(Messages.TESTSET_TEST_FOR_MAPPINGTESTPROJECT );
suite.addTestSuite( HibernateNatureAddTest.class );
//suite.addTestSuite( CreateConsoleConfigTest.class );
return suite;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -18,7 +18,7 @@
*/
public class TestSetBeforeTearDown {
public static TestSuite getTests(){
- TestSuite suite = new TestSuite("Test for MappingTestProject" );
+ TestSuite suite = new TestSuite(Messages.TESTSET_TEST_FOR_MAPPINGTESTPROJECT );
suite.addTestSuite( HibernateNatureRemoveTest.class );
return suite;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -29,8 +29,8 @@
try {
ProjectUtil.customizeCFGFileForPack(pack);
} catch (CoreException e) {
- fail("Error customising " + ProjectUtil.CFG_FILE_NAME + " file for package "
- + pack.getPath() + ".\n" + e.getMessage());
+ fail(Messages.UPDATECONFIGURATIONTEST_ERROR_CUSTOMISING + ProjectUtil.CFG_FILE_NAME + Messages.UPDATECONFIGURATIONTEST_FILE_FOR_PACKAGE
+ + pack.getPath() + ".\n" + e.getMessage()); //$NON-NLS-1$
}
}
}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/messages.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/messages.properties (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/messages.properties 2008-05-30 16:39:26 UTC (rev 8489)
@@ -0,0 +1,30 @@
+HIBERNATEALLMAPPINGTESTS_ERRORS=\ errors.
+HIBERNATEALLMAPPINGTESTS_FAILS=\ fails.
+HIBERNATEALLMAPPINGTESTS_PACKAGES_TESTED=\ packages tested.
+HIBERNATEALLMAPPINGTESTS_SECONDS=\ sec.
+MAPPINGTESTPROJECT_FOLDER=Folder
+MAPPINGTESTPROJECT_NOT_FOUND=\ not found\!
+OPENJAVAEDITORS_ERROR_OPENNING_COMPILATIONUNIT=Error opening CompilationUnit:
+OPENMAPPINGDIAGRAMTEST_CANNOT_BE_OPENED=\ can't be opened:\n
+OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMM_FOR=Mapping Diagramm for
+OPENMAPPINGDIAGRAMTEST_MAPPING_DIAGRAMMS_FOR_PACKAGE=Mapping Diagramms for package
+OPENMAPPINGDIAGRAMTEST_NOT_OPENED=\ not opened:\n
+OPENMAPPINGFILETEST_CANNOT_BE_OPENED=\ can't be opened:\n
+OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR=Highlighted region for
+OPENMAPPINGFILETEST_HIGHLIGHTED_REGION_FOR_PROPERTY=Highlighted region for property
+OPENMAPPINGFILETEST_IS_EMPTY_PACKAGE=\ is empty. (package
+OPENMAPPINGFILETEST_MAPPING_FILE_FOR=Mapping file for
+OPENMAPPINGFILETEST_MAPPING_FILE_FOR_PROPERTY=Mapping file for property
+OPENMAPPINGFILETEST_MAPPING_FILES_FOR_PACKAGE=Mapping Files for package
+OPENMAPPINGFILETEST_NOT_OPENED_PACKAGE=\ not opened: (package
+OPENSOURCEFILETEST_CANNOT_BE_OPENED=\ can't be opened:\n
+OPENSOURCEFILETEST_HIGHLIGHTED_REGION_FOR=Highlighted region for
+OPENSOURCEFILETEST_IS_EMPTY=\ is empty.
+OPENSOURCEFILETEST_MAPPING_FILE_FOR=Mapping file for
+OPENSOURCEFILETEST_NOT_OPENED=\ not opened:\n
+OPENSOURCEFILETEST_SOURCE_FILES_FOR_PACKAGE=Source files for package
+PROJECTUTIL_CANNOT_GET_ERROR_FIELD_FROM_ERROREDITORPART=Can't get error field from ErrorEditorPart.
+PROJECTUTIL_CANNOT_GET_EXCEPTION_FROM_ERROREDITORPART=Can't get exception from ErrorEditorPart.
+TESTSET_TEST_FOR_MAPPINGTESTPROJECT=Test for MappingTestProject
+UPDATECONFIGURATIONTEST_ERROR_CUSTOMISING=Error customising
+UPDATECONFIGURATIONTEST_FILE_FOR_PACKAGE=\ file for package
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/messages.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/messages.properties (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/messages.properties 2008-05-30 16:39:26 UTC (rev 8489)
@@ -0,0 +1,21 @@
+BEANSHELLINTEGRATIONTEST_RESULT=Result:
+CONSOLECONFIGTEST_FACTORY_ALREADY_EXISTS=Should throw an exception because a factory already exists\!
+CONSOLECONFIGTEST_FAKE_PREFS=fake prefs
+CONSOLEPLUGINALLTESTS_TEST_FOR=Test for org.hibernate.eclipse.console.test
+HIBERNATECONSOLETEST_LONG_RUNNING_TASK_DETECTED=A long running task detected
+KNOWNCONFIGURATIONSTEST_FAKE_PREFS=fake prefs
+KNOWNCONFIGURATIONSTEST_NEW_TEST=new test
+KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_BUILD=no sf should be built\!
+KNOWNCONFIGURATIONSTEST_NO_SF_SHOULD_BE_CLOSED=no sf should be closed\!
+KNOWNCONFIGURATIONSTEST_TRYING_REMOVE_NON_EXISTING_CONSOLE=trying to remove a non existing console
+PERSPECTIVETEST_HIBERNATE=Hibernate
+REFACTORINGTEST_CATEGORY=Category
+REFACTORINGTEST_COREEXCEPTION_OCCURED_WORK_WITH_MEMENTO=CoreException occured when try to work with memento.
+REFACTORINGTEST_EXCEPTION_WHILE_FILENAMECHANGE_REFACTOR=Exception while FileNameChange refactor processing\!
+REFACTORINGTEST_EXCEPTION_WHILE_FINDCHANGE_LAUNCH_CONFIG_PROCESSING=Exception while FindChanged launch configurations processing\!
+REFACTORINGTEST_EXCEPTION_WHILE_PACKNAMECHANGE_REFACTOR=Exception while PackNameChange refactor processing\!
+REFACTORINGTEST_EXCEPTION_WHILE_PROJNAMECHANGE_REFACTOR=Exception while ProjectNameChange refactor processing\!
+REFACTORINGTEST_EXCEPTION_WHILE_SRCNAMECHANGE_REFACTOR=Exception while SrcNameChange refactor processing\!
+REFACTORINGTEST_METHOD_NOT_TESTED=Method doesn't tested
+REFACTORINGTEST_SEGMENTNUM_TOO_MATCH=SegmentNum is too mach.
+REFACTORINGTEST_TEST_LAUNCH_CONFIG=Test Launch Config
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2008-05-30 16:27:14 UTC (rev 8488)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2008-05-30 16:39:26 UTC (rev 8489)
@@ -217,7 +217,7 @@
IResource[] resources= jproject.getProject().members();
for (int i= 0; i < resources.length; i++) {
- if (!resources[i].getName().startsWith(".")) {
+ if (!resources[i].getName().startsWith(".")) { //$NON-NLS-1$
resources[i].delete(true, null);
}
}
@@ -231,7 +231,7 @@
new SearchEngine().searchAllTypeNames(
null,
SearchPattern.R_EXACT_MATCH,
- "XXXXXXXXX".toCharArray(), // make sure we search a concrete name. This is faster according to Kent
+ "XXXXXXXXX".toCharArray(), //$NON-NLS-1$ // make sure we search a concrete name. This is faster according to Kent
SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.CLASS,
SearchEngine.createJavaSearchScope(new IJavaElement[0]),
@@ -582,7 +582,7 @@
while (entryPaths.hasMoreElements()) {
String path= (String) entryPaths.nextElement();
IPath name= new Path(path.substring(bundleSourcePath.length()));
- if (path.endsWith("/")) {
+ if (path.endsWith("/")) { //$NON-NLS-1$
IFolder folder= importTarget.getFolder(name);
folder.create(false, true, null);
importResources(folder, path);
16 years, 6 months
JBoss Tools SVN: r8488 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: edit and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 12:27:14 -0400 (Fri, 30 May 2008)
New Revision: 8488
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-05-30 16:27:04 UTC (rev 8487)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-05-30 16:27:14 UTC (rev 8488)
@@ -495,6 +495,9 @@
return;
}
SeamPagesProcessStructureHelper h = SeamPagesProcessStructureHelper.getInstance();
+ setName(h.getItemOutputPresentation(object));
+ setShortcut(h.isShortcut(object));
+
XModelObject t = h.getItemOutputTarget(object);
if(t != null) {
PagesElement to = pagesModel.findElement(t);
@@ -502,8 +505,6 @@
setToElement(to);
}
}
- setName(h.getItemOutputPresentation(object));
- setShortcut(h.isShortcut(object));
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-05-30 16:27:04 UTC (rev 8487)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-05-30 16:27:14 UTC (rev 8488)
@@ -15,6 +15,9 @@
import org.eclipse.draw2d.*;
import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPart;
@@ -56,6 +59,9 @@
private GEFLabel pathLabel;
public void activate() {
+ if (!isActive()) {
+ ((Notifier) getModel()).eAdapters().add(adapter);
+ }
super.activate();
addEditPartListener(this);
}
@@ -138,6 +144,9 @@
public void deactivate() {
removeEditPartListener(this);
//getLink().removePropertyChangeListener(this);
+ if (isActive()) {
+ ((Notifier) getModel()).eAdapters().remove(this);
+ }
super.deactivate();
}
@@ -244,4 +253,43 @@
}
}
+ Adapter adapter = new AdapterImpl();
+
+ class AdapterImpl implements Adapter {
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ public void notifyChanged(Notification notification) {
+ pathLabel.setText(getLinkModel().getName());
+ //TODO for shortCut
+ refresh();
+ refreshVisuals();
+ }
+
+ /**
+ * )
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ */
+ public Notifier getTarget() {
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
+ */
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ */
+ public void setTarget(Notifier newTarget) {
+ }
+
+ }
+
}
16 years, 6 months
JBoss Tools SVN: r8487 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 12:27:04 -0400 (Fri, 30 May 2008)
New Revision: 8487
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-05-30 15:50:36 UTC (rev 8486)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-05-30 16:27:04 UTC (rev 8487)
@@ -2925,7 +2925,7 @@
<XActionItem
HandlerClassName="org.jboss.tools.jsf.model.handlers.JSFItemRegirectHandler"
ICON="action.new.jsf.case"
- PROPERTIES="actionpath=CreateActions/CreateCase"
+ PROPERTIES="actionpath=CreateActions/AddNavigationRule"
WizardClassName="%Default%" displayName="Rule..." kind="action" name="CreateRule"/>
<XActionItem HIDE="always"
HandlerClassName="org.jboss.tools.struts.model.handlers.CreateCommentForItemHandler"
16 years, 6 months
JBoss Tools SVN: r8486 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: figures and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 11:50:36 -0400 (Fri, 30 May 2008)
New Revision: 8486
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/print/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/print/PrintIconHelper.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
Log:
JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-05-30 15:45:23 UTC (rev 8485)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-05-30 15:50:36 UTC (rev 8486)
@@ -25,6 +25,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
import org.jboss.tools.seam.ui.pages.editor.edit.ExceptionEditPart;
import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
+import org.jboss.tools.seam.ui.pages.editor.print.PrintIconHelper;
public class ExceptionFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
@@ -44,10 +45,9 @@
}
public void setIcon(Image i) {
- //icon = PrintIconHelper.getPrintImage(i);
+ icon = PrintIconHelper.getPrintImage(i);
}
-
public void init(int number) {
FixedConnectionAnchor c;
if (number == 0)
@@ -86,6 +86,10 @@
public ExceptionFigure(PgException group) {
this.exc = group;
+ if (group != null) {
+ setIcon(group.getImage());
+ }
+
setOpaque(false);
setLayoutManager(new XYLayout());
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-30 15:45:23 UTC (rev 8485)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-30 15:50:36 UTC (rev 8486)
@@ -22,6 +22,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.edit.PageEditPart;
import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
+import org.jboss.tools.seam.ui.pages.editor.print.PrintIconHelper;
public class PageFigure extends NodeFigure implements HandleBounds,
FigureListener {
@@ -70,7 +71,7 @@
}
public void setIcon(Image i) {
- //icon = PrintIconHelper.getPrintImage(i);
+ icon = PrintIconHelper.getPrintImage(i);
}
public void addNotify() {
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/print/PrintIconHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/print/PrintIconHelper.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/print/PrintIconHelper.java 2008-05-30 15:50:36 UTC (rev 8486)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor.print;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+
+public class PrintIconHelper {
+ private static Map<Image,Image> iconCashe = new HashMap<Image,Image>();
+
+ public static Image getPrintImage(Image image, Color bgColor) {
+ Image newImage = (Image)iconCashe.get(image);
+ if (newImage == null) {
+ ImageData imageData = image.getImageData();
+ ImageData imgData = (ImageData)imageData.clone();
+ ImageData mask = imgData.getTransparencyMask();
+ int bgPixelValue = imgData.palette.getPixel(bgColor.getRGB());
+
+ for (int x = 0; x < mask.width; x++) {
+ for (int y = 0; y < mask.height; y++) {
+ int pixelValue = mask.getPixel(x, y);
+ if (pixelValue == 0) {
+ imgData.setPixel(x, y, bgPixelValue);
+ }
+ }
+ }
+ imgData.maskData = null;
+
+ newImage = new Image(null, imgData);
+ iconCashe.put(image, newImage);
+ }
+
+ return newImage;
+ }
+
+ public static Image getPrintImage(Image image) {
+ return getPrintImage(image, ColorConstants.white);
+ }
+}
16 years, 6 months
JBoss Tools SVN: r8485 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: ecore/pages/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 11:45:23 -0400 (Fri, 30 May 2008)
New Revision: 8485
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/PagesElement.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
Log:
JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/PagesElement.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/PagesElement.java 2008-05-30 15:43:40 UTC (rev 8484)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/PagesElement.java 2008-05-30 15:45:23 UTC (rev 8485)
@@ -6,6 +6,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.graphics.Image;
/**
* @author daniel
@@ -95,6 +96,8 @@
* @model type="Link" opposite ="fromElement"
*/
public EList<Link> getOutputLinks();
+
+ public Image getImage();
/**
* returns data of element
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java 2008-05-30 15:43:40 UTC (rev 8484)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java 2008-05-30 15:45:23 UTC (rev 8485)
@@ -24,9 +24,11 @@
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesProcessStructureHelper;
import org.jboss.tools.seam.ui.pages.SeamUiPagesPlugin;
@@ -243,6 +245,15 @@
* <!-- end-user-doc -->
* @generated NOT
*/
+ public Image getImage() {
+ return EclipseResourceUtil.getImage(getModelObject());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
public void changeLocationAndSize(Point location, Dimension size) {
setLocation(location);
setSize(size);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-30 15:43:40 UTC (rev 8484)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-30 15:45:23 UTC (rev 8485)
@@ -140,7 +140,7 @@
this.page = group;
if (group != null) {
-// setIcon(group.getImage());
+ setIcon(group.getImage());
setPath(group.getName());
init(group.getOutputLinks().size());
}
16 years, 6 months
JBoss Tools SVN: r8484 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-30 11:43:40 -0400 (Fri, 30 May 2008)
New Revision: 8484
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-05-30 15:25:55 UTC (rev 8483)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-05-30 15:43:40 UTC (rev 8484)
@@ -22,10 +22,8 @@
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.gef.GEFGraphicalViewer;
-import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
import org.jboss.tools.seam.ui.pages.editor.edit.PageWrapper;
import org.jboss.tools.seam.ui.pages.editor.edit.ParamListEditPart;
-import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
public class ParamListFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
@@ -49,41 +47,7 @@
}
- public void init(int number) {
- FixedConnectionAnchor c;
- if (number == 0)
- number = 1;
- for (int i = 0; i < number; i++) {
- c = new FixedConnectionAnchor(this);
- c.offsetV = 32 + LINK_HEIGHT * i;
- c.leftToRight = false;
- connectionAnchors.put((i + 1) + "_OUT", c);
- outputConnectionAnchors.addElement(c);
- }
- }
- public void addConnectionAnchor(int number) {
- FixedConnectionAnchor c;
- if (number == 1)
- return;
- c = new FixedConnectionAnchor(this);
- c.offsetV = 32 + LINK_HEIGHT * (number - 1);
- // c.offsetH = -1;
- c.leftToRight = false;
- connectionAnchors.put(number + "_OUT", c);
- outputConnectionAnchors.addElement(c);
- }
-
- public void removeConnectionAnchor() {
- if (outputConnectionAnchors.size() == 1)
- return;
- outputConnectionAnchors.remove(outputConnectionAnchors.size() - 1);
- }
-
- public void removeAllConnectionAnchor() {
- outputConnectionAnchors.removeAllElements();
- }
-
public ParamListFigure(PageWrapper paramList) {
this.paramList = paramList;
@@ -116,21 +80,11 @@
Rectangle r = getBounds().getCopy();
g.translate(r.getLocation());
- if (paramList != null) {
- g.setBackgroundColor(exceptionBackgroundColor);
- g.setForegroundColor(exceptionForegroundColor);
- } else {
- g.setBackgroundColor(lightGrayColor);
- }
+ g.setXORMode(true);
+ g.setBackgroundColor(lightGrayColor);
+
g.fillRectangle(1, 1, r.width-2, r.height-2);
-
- g.setBackgroundColor(whiteColor);
-
- g.fillRectangle(1, 1, 22, 19);
-
- if (icon != null)
- g.drawImage(icon, 4, 2);
}
class GroupBorder extends LineBorder {
@@ -144,18 +98,12 @@
int width = r.width - 1;
int height = r.height - 1;
- if (paramList != null)
- graphics.setForegroundColor(blackColor);
- else
- graphics.setForegroundColor(darkGrayColor);
+ graphics.setForegroundColor(darkGrayColor);
graphics.drawLine(1, 0, width-1, 0);
graphics.drawLine(0, 1, 0, height - 1);
graphics.drawLine(1, height, width-1, height);
graphics.drawLine(width, 1, width, height - 1);
- graphics.drawLine(23 , 0, 23, height);
-
-
}
public void mouseDoubleClicked(MouseEvent me) {
16 years, 6 months
JBoss Tools SVN: r8483 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 11:25:55 -0400 (Fri, 30 May 2008)
New Revision: 8483
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java
Log:
JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java 2008-05-30 15:24:41 UTC (rev 8482)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java 2008-05-30 15:25:55 UTC (rev 8483)
@@ -13,6 +13,9 @@
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.seam.ui.pages.editor.ExceptionTemplate;
+import org.jboss.tools.seam.ui.pages.editor.PageTemplate;
+import org.jboss.tools.seam.ui.pages.editor.TemplateConstants;
public class PagesTemplateTransferDropTargetListener extends TemplateTransferDropTargetListener {
@@ -21,16 +24,26 @@
}
protected CreationFactory getFactory(Object template) {
- return new JSFTemplateFactory();
+ return new JSFTemplateFactory((String)template);
}
class JSFTemplateFactory implements CreationFactory {
+ String template;
+
+ JSFTemplateFactory(String template) {
+ this.template = template;
+ }
+
public Object getNewObject() {
return "view";
}
public Object getObjectType() {
- return String.class;
+ if(TemplateConstants.TEMPLATE_EXCEPTION.equals(template))
+ return ExceptionTemplate.class;
+ else if(TemplateConstants.TEMPLATE_PAGE.equals(template))
+ return PageTemplate.class;
+ else return String.class;
}
}
16 years, 6 months
JBoss Tools SVN: r8482 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages: editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-30 11:24:41 -0400 (Fri, 30 May 2008)
New Revision: 8482
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ExceptionTemplate.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PageTemplate.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/TemplateConstants.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPolicy.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUIPagesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/messages.properties
Log:
JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUIPagesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUIPagesMessages.java 2008-05-30 15:08:10 UTC (rev 8481)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUIPagesMessages.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -19,6 +19,9 @@
public static String PAGESDIAGRAM_MARQUEE;
public static String PAGESDIAGRAM_CREATE_NEW_CONNECTION;
public static String SEAM_UI_PAGES_PLUGIN_NO_MESSAGES;
+
+ public static String PAGES_DIAGRAM_VIEW_TEMPLATE;
+ public static String PAGES_DIAGRAM_EXCEPTION_TEMPLATE;
public static ResourceBundle getResourceBundle() {
try {
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ExceptionTemplate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ExceptionTemplate.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ExceptionTemplate.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.ui.pages.editor;
+
+public class ExceptionTemplate {
+
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PageTemplate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PageTemplate.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PageTemplate.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.ui.pages.editor;
+
+public class PageTemplate {
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-05-30 15:08:10 UTC (rev 8481)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -48,6 +48,7 @@
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.gef.editparts.ZoomListener;
import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
import org.eclipse.gef.palette.MarqueeToolEntry;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteEntry;
@@ -394,19 +395,30 @@
entries.add(sep);
-// CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
-// FacesConfigEditorMessages.JSFDIAGRAM_VIEW_TEMPLATE,
-// FacesConfigEditorMessages.JSFDIAGRAM_VIEW_TEMPLATE,
-// TemplateConstants.TEMPLATE_VIEW,
-// new SimpleFactory(String.class), ImageDescriptor
-// .createFromFile(PagesEditor.class, "icons/view.gif"),
-// null//$NON-NLS-1$
-// );
-// entries.add(combined);
-//
+ CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
+ SeamUIPagesMessages.PAGES_DIAGRAM_VIEW_TEMPLATE,
+ SeamUIPagesMessages.PAGES_DIAGRAM_VIEW_TEMPLATE,
+ TemplateConstants.TEMPLATE_PAGE,
+ new SimpleFactory(PageTemplate.class), ImageDescriptor
+ .createFromFile(PagesEditor.class, "icons/view.gif"),
+ null//$NON-NLS-1$
+ );
+ entries.add(combined);
+
+ combined = new CombinedTemplateCreationEntry(
+ SeamUIPagesMessages.PAGES_DIAGRAM_EXCEPTION_TEMPLATE,
+ SeamUIPagesMessages.PAGES_DIAGRAM_EXCEPTION_TEMPLATE,
+ TemplateConstants.TEMPLATE_EXCEPTION,
+ new SimpleFactory(ExceptionTemplate.class), ImageDescriptor
+ .createFromFile(PagesEditor.class, "icons/exception.gif"),
+ null//$NON-NLS-1$
+ );
+ entries.add(combined);
+
controlGroup.addAll(entries);
return controlGroup;
}
+
public void gotoMarker(IMarker marker) {
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/TemplateConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/TemplateConstants.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/TemplateConstants.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor;
+
+/**
+ * @author hudsonr
+ * @since 2.1
+ */
+public class TemplateConstants {
+
+ public static final String TEMPLATE_PAGE = "page template";
+ public static final String TEMPLATE_EXCEPTION = "exception template";
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2008-05-30 15:08:10 UTC (rev 8481)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -129,7 +129,7 @@
installEditPolicy(EditPolicy.NODE_ROLE, null);
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
- //installEditPolicy(EditPolicy.COMPONENT_ROLE, new JSFDiagramEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new PagesDiagramEditPolicy());
}
/**
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPolicy.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPolicy.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPolicy.java 2008-05-30 15:24:41 UTC (rev 8482)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor.edit;
+
+import java.util.Properties;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.seam.ui.pages.editor.ExceptionTemplate;
+import org.jboss.tools.seam.ui.pages.editor.PageTemplate;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
+
+public class PagesDiagramEditPolicy extends RootComponentEditPolicy{
+
+ public PagesDiagramEditPolicy() {
+ super();
+ }
+
+ public PagesDiagramEditPart getDiagramEditPart(){
+ return (PagesDiagramEditPart)getHost();
+ }
+
+ public Command getCommand(Request request) {
+ if (RequestConstants.REQ_CREATE.equals(request.getType())){
+ CreateRequest req = (CreateRequest)request;
+ if(req.getNewObjectType().equals(ExceptionTemplate.class))
+ return getCreateExceptionCommand((CreateRequest)request);
+ else if(req.getNewObjectType().equals(PageTemplate.class))
+ return getCreatePageCommand((CreateRequest)request);
+ }
+ return super.getCommand(request);
+ }
+
+ public Command getCreateExceptionCommand(CreateRequest request){
+ CreateExceptionCommand comm = new CreateExceptionCommand();
+ comm.setLocation(request.getLocation());
+ return comm;
+ }
+
+ public Command getCreatePageCommand(CreateRequest request){
+ CreatePageCommand comm = new CreatePageCommand();
+ comm.setLocation(request.getLocation());
+ return comm;
+ }
+
+ class CreateExceptionCommand extends org.eclipse.gef.commands.Command{
+ Point location;
+
+ public void setLocation(Point point){
+ PagesDiagramEditPolicy.this.getDiagramEditPart().getFigure().translateToRelative(point);
+ location = point;
+ }
+
+
+ public CreateExceptionCommand(){
+ super("CreateExceptionCommand");
+ }
+
+ public boolean canExecute(){
+ return true;
+ }
+
+ public void execute(){
+ Properties properties = new Properties();
+ if(location != null){
+ properties.put("process.mouse.x","" + location.x);
+ properties.put("process.mouse.y","" + location.y);
+ }
+
+ XActionInvoker.invoke("CreateActions.AddException", (XModelObject)((PagesModel)getDiagramEditPart().getModel()).getData(),properties);
+ }
+
+ public boolean canUndo() {
+ return false;
+ }
+ }
+
+ class CreatePageCommand extends org.eclipse.gef.commands.Command{
+ Point location;
+
+ public void setLocation(Point point){
+ PagesDiagramEditPolicy.this.getDiagramEditPart().getFigure().translateToRelative(point);
+ location = point;
+ }
+
+
+ public CreatePageCommand(){
+ super("CreatePageCommand");
+ }
+
+ public boolean canExecute(){
+ return true;
+ }
+
+ public void execute(){
+ Properties properties = new Properties();
+ if(location != null) {
+ properties.put("process.mouse.x","" + location.x);
+ properties.put("process.mouse.y","" + location.y);
+ }
+
+ XActionInvoker.invoke("CreateActions.AddPage", (XModelObject)((PagesModel)getDiagramEditPart().getModel()).getData(),properties);
+ }
+
+ public boolean canUndo() {
+ return false;
+ }
+ }
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/messages.properties 2008-05-30 15:08:10 UTC (rev 8481)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/messages.properties 2008-05-30 15:24:41 UTC (rev 8482)
@@ -1,2 +1,4 @@
SEAM_PAGES_EDITOR_SOURCE_TAB=Source
SEAM_PAGES_EDITOR_DIAGRAM_TAB=Graphical
+PAGES_DIAGRAM_VIEW_TEMPLATE=Add Page
+PAGES_DIAGRAM_EXCEPTION_TEMPLATE=Add Exception
\ No newline at end of file
16 years, 6 months