JBoss Tools SVN: r16244 - workspace/yzhishko/org.jboss.tools.ui.auto.test/resources.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-06-29 09:08:01 -0400 (Mon, 29 Jun 2009)
New Revision: 16244
Modified:
workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties
Log:
Timeout between tests was increased
Modified: workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties 2009-06-29 11:50:33 UTC (rev 16243)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties 2009-06-29 13:08:01 UTC (rev 16244)
@@ -1,2 +1,2 @@
SWTBotPreferences.PLAYBACK_DELAY=25
-SWTBotPreferences.TIMEOUT=1000
+SWTBotPreferences.TIMEOUT=3000
15 years, 5 months
JBoss Tools SVN: r16243 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-06-29 07:50:33 -0400 (Mon, 29 Jun 2009)
New Revision: 16243
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-3504, popup menu structure for inserting tags from palette was changed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2009-06-29 07:10:56 UTC (rev 16242)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2009-06-29 11:50:33 UTC (rev 16243)
@@ -80,30 +80,59 @@
@Override
public void fill(Menu menu, int index) {
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3504
+ * Adding 'Insert tag from Palette' menu item.
+ */
+ final MenuItem fromPaletteItem;
+ if (index < 0) {
+ fromPaletteItem = new MenuItem(menu, SWT.CASCADE);
+ } else {
+ fromPaletteItem = new MenuItem(menu, SWT.CASCADE, index);
+ }
+ /*
+ * Increasing parent menu item index.
+ */
+ index++;
+ fromPaletteItem.setText(VpeUIMessages.FROM_PALETTE);
+ /*
+ * Creating menu for 'Insert tag from Palette' item.
+ */
+ final Menu fromPaletteMenu = new Menu(menu);
+ /*
+ * Tie menu with the item.
+ */
+ fromPaletteItem.setMenu(fromPaletteMenu);
+ /*
+ * Setting each InsertType to correct position in the menu
+ */
for (final InsertType insertItem : InsertType.values()) {
- final MenuItem item;
- if (index < 0) {
- item = new MenuItem(menu, SWT.CASCADE);
- } else {
- item = new MenuItem(menu, SWT.CASCADE,
- index + insertItem.ordinal());
- }
-
- final String itemName = insertItem.getMessage();
- item.setText(itemName);
-
- final Menu paletteManu = new Menu(menu);
- item.setMenu(paletteManu);
-
+ /*
+ * Use MenuManager to create submenu.
+ */
final MenuManager paletteManuManager = new MenuManager(
- VpeUIMessages.FROM_PALETTE);
+ insertItem.getMessage());
final XModelObject model = ModelUtilities.getPreferenceModel()
- .getByPath("%Palette%"); //$NON-NLS-1$
-
- paletteManuManager.addMenuListener(
- new InsertMenuListener(model, insertItem));
+ .getByPath("%Palette%"); //$NON-NLS-1$
+ paletteManuManager.addMenuListener(new InsertMenuListener(
+ model, insertItem));
paletteManuManager.setRemoveAllWhenShown(true);
- paletteManuManager.fill(paletteManu, -1);
+ /*
+ * Place menu items to the correct menu.
+ */
+ if (insertItem.equals(InsertType.REPLACE_WITH)) {
+ /*
+ * Replace item will be placed in the parent menu.
+ * Because of this its position index is required.
+ */
+ paletteManuManager.fill(menu, index);
+ index++;
+ } else {
+ /*
+ * Fill 'Insert tag from palette' menu with insert items.
+ */
+ paletteManuManager.fill(fromPaletteMenu, -1);
+ }
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-06-29 07:10:56 UTC (rev 16242)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-06-29 11:50:33 UTC (rev 16243)
@@ -64,12 +64,12 @@
RESTORE_PREVIOUS_LOCATION=Restore Previous Location
BACKGROUND_COLOR_TIP=Choose background color
SETUP_TEMPLATE_FOR_MENU=Setup Template for <{0}>...
-INSERT_AROUND=Insert Around
-INSERT_BEFORE=Insert Before
-INSERT_AFTER=Insert After
-REPLACE_WITH=Replace With
-INSERT_INTO=Insert Into
-FROM_PALETTE=From Palette
+INSERT_AROUND=Around
+INSERT_BEFORE=Before
+INSERT_AFTER=After
+REPLACE_WITH=Replace with Palette tag
+INSERT_INTO=Into
+FROM_PALETTE=Insert tag from Palette
PAGE_DESIGN_OPTIONS_ABOUT=Here you can configure Visual Page Editor options, which will be used for generating a preview
ACTUAL_RUN_TIME_FOLDERS_ABOUT=These options will be used by Visual Page Editor for replacing absolute and relative path values when generating a preview
INCLUDED_CSS_FILES_ABOUT=These CSS files will be linked by Visual Page Editor when generating a preview
15 years, 5 months
JBoss Tools SVN: r16242 - trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-29 03:10:56 -0400 (Mon, 29 Jun 2009)
New Revision: 16242
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java
Log:
JBIDE-4350: fix the build failed
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java 2009-06-29 07:06:00 UTC (rev 16241)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java 2009-06-29 07:10:56 UTC (rev 16242)
@@ -84,8 +84,13 @@
// create jbossws web project
fproject = createJBossWSProject("JavaFirstTestProject",
isServerSupplied());
- clientProject = createProject("ClientTest");
- this.addResourceToCleanup(clientProject);
+
+ if (!ResourcesPlugin.getWorkspace().getRoot().getProject("ClientTest")
+ .exists()) {
+ createProject("ClientTest");
+ // this.addResourceToCleanup(clientProject);
+ }
+
}
protected void tearDown() throws Exception {
@@ -135,18 +140,17 @@
model.addServiceClasses("org.example.www.helloworld.HelloWorld");
model.setGenWSDL(true);
IProject project = fproject.getProject();
-
+
fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
Java2WSCommand command = new Java2WSCommand(model);
IStatus status = command.execute(null, null);
assertFalse(status.getMessage(), Status.ERROR == status.getSeverity());
assertTrue(project.getFile(
"src/org/example/www/helloworld/jaxws/SayHello.java").exists());
- assertTrue(project.getFile("wsdl/HelloWorldService.wsdl")
- .exists());
+ assertTrue(project.getFile("wsdl/HelloWorldService.wsdl").exists());
}
public void testDeployResult() throws ExecutionException, CoreException,
@@ -164,10 +168,10 @@
WebServiceScenario.BOTTOMUP);
IStatus status = cmd.execute(null, null);
assertTrue(status.getMessage(), status.isOK());
-
+
fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
+
cmd = new Java2WSCommand(model);
status = cmd.execute(null, null);
assertTrue(status.getMessage(), status.isOK());
@@ -191,9 +195,9 @@
currentServer.getServerState());
conn.connect();
- assertFalse("The url connection's status is "+((HttpURLConnection)conn).getResponseMessage(),"Ok".equals(((HttpURLConnection)conn).getResponseMessage()));
-
-
+ assertFalse("The url connection's status is "
+ + ((HttpURLConnection) conn).getResponseMessage(), "Ok"
+ .equals(((HttpURLConnection) conn).getResponseMessage()));
model = new ServiceModel();
model.setWebProjectName("ClientTest");
@@ -202,6 +206,8 @@
status = cmd.execute(null, null);
assertTrue(status.getMessage(), status.isOK());
+ clientProject = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ "ClientTest");
clientProject.open(null);
clientProject.refreshLocal(IResource.DEPTH_INFINITE, null);
@@ -234,8 +240,11 @@
delay(1000);
i++;
}
- assertTrue(((TextConsole) console).getDocument().get(), isContainString(console,
- JBossWSCreationCoreMessages.Client_Sample_Run_Over));
+ assertTrue(
+ ((TextConsole) console).getDocument().get(),
+ isContainString(
+ console,
+ JBossWSCreationCoreMessages.Client_Sample_Run_Over));
}
}
}
15 years, 5 months
JBoss Tools SVN: r16241 - workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-06-29 03:06:00 -0400 (Mon, 29 Jun 2009)
New Revision: 16241
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java
Log:
Test commit.
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java 2009-06-29 06:55:55 UTC (rev 16240)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java 2009-06-29 07:06:00 UTC (rev 16241)
@@ -27,7 +27,6 @@
suite.addTestSuite(JBIDE3577Test.class);
suite.addTestSuite(JBIDE3579Test.class);
suite.addTestSuite(JBIDE3920Test.class);
- suite.addTestSuite(JBIDE3890Test.class);
return new TestSetup(suite);
}
}
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r16240 - in workspace/yzhishko: org.jboss.tools.vpe.ui.auto.test and 21 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-06-29 02:55:55 -0400 (Mon, 29 Jun 2009)
New Revision: 16240
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/editor/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/editor/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java
Log:
VPE UI tests. Some of this tests are only experimental and can work not fine. It'll be fixed soon.
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.vpe.ui.auto.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,8 @@
+#Fri Jun 12 15:16:42 EEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,34 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SWTBotTests
+Bundle-SymbolicName: org.jboss.tools.vpe.ui.auto.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.vpe.ui.auto.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.ui.auto.test;bundle-version="1.0.0",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.eclipse.core.resources;bundle-version="3.5.0",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.jboss.tools.vpe;bundle-version="2.1.0",
+ org.jboss.tools.jst.jsp;bundle-version="2.0.0",
+ org.jboss.tools.common.text.ext;bundle-version="2.0.0",
+ org.jboss.tools.jst.web;bundle-version="2.0.0",
+ org.hamcrest;bundle-version="1.1.0",
+ org.mozilla.xpcom;bundle-version="1.8.1",
+ org.jboss.tools.vpe.xulrunner;bundle-version="2.1.0",
+ org.eclipse.jface.text;bundle-version="3.5.0"
+Eclipse-RegisterBuddy: org.apache.log4j
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: junit.framework
+Export-Package: org.jboss.tools.vpe.ui.auto.test,
+ org.jboss.tools.vpe.ui.auto.test.jbide
+
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,3 @@
+JSFProjectName=JBIDETestProject
+Apachev6.0=D\:/Java/apache-tomcat-6.0.18
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,5 @@
+source.. = src/,\
+ resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,3 @@
+JSFProjectName=JBIDETestProject
+Apachev6.0=D\:/Java/apache-tomcat-6.0.18
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,50 @@
+package org.jboss.tools.vpe.ui.auto.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.vpe.ui.auto.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class ComparisonException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7127064462771778364L;
+
+ public ComparisonException() {
+ super();
+ }
+
+ public ComparisonException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ComparisonException(String message) {
+ super(message);
+ }
+
+ public ComparisonException(Throwable cause) {
+ super(cause);
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.jboss.tools.common.model.util.XMLUtil;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.mozilla.interfaces.nsIDOMAttr;
+import org.mozilla.interfaces.nsIDOMNamedNodeMap;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class TestDomUtil {
+ /**
+ * Attributes names that will be skipped in attribute comparison.
+ */
+ public static final Set<String> skippedAtributes = new HashSet<String>();
+ static {
+ // Add here all attributes names to be skipped (IN UPPER CASE!)
+ skippedAtributes.addAll(Arrays.asList("DIR"));//$NON-NLS-1$
+ }
+
+ final public static String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
+
+ final public static String ILLEGAL_ATTRIBUTES = "illegalAttributes"; //$NON-NLS-1$
+
+ final public static String ILLEGAL_ATTRIBUTES_SEPARATOR = Constants.COMMA;
+
+ final public static String START_REGEX = "/"; //$NON-NLS-1$
+
+ final public static String END_REGEX = "/"; //$NON-NLS-1$
+
+ public static Document getDocument(File file) throws FileNotFoundException {
+ // create reader
+ FileReader reader = new FileReader(file);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ public static Document getDocument(String content)
+ throws FileNotFoundException {
+ // create reader
+ StringReader reader = new StringReader(content);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ /**
+ *
+ * @param document
+ * @param elementId
+ * @return
+ */
+ public static Element getElemenById(Document document, String elementId) {
+
+ Element element = document.getDocumentElement();
+
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if ((child.getNodeType() == Node.ELEMENT_NODE)
+ && elementId.equals(((Element) child)
+ .getAttribute(ID_ATTRIBUTE)))
+ return (Element) child;
+
+ }
+
+ return null;
+
+ }
+
+ /**
+ *
+ * @param element
+ * @return
+ */
+ public static Element getFirstChildElement(Element element) {
+
+ if (element != null) {
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ return (Element) child;
+
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ *
+ * @param vpeNode
+ * @param schemeNode
+ * @return
+ * @throws ComparisonException
+ */
+ public static void compareNodes(nsIDOMNode vpeNode, Node modelNode)
+ throws ComparisonException {
+
+ if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
+ throw new ComparisonException("name of tag is \"" //$NON-NLS-1$
+ + vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ + modelNode.getNodeName() + "\""); //$NON-NLS-1$
+ }
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))) {
+ throw new ComparisonException("value of " + vpeNode.getNodeName() //$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
+ }
+ // compare node's attributes
+ if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
+
+ compareAttributes(modelNode.getAttributes(), vpeNode
+ .getAttributes());
+ }
+
+ // compare children
+ nsIDOMNodeList vpeChildren = vpeNode.getChildNodes();
+ NodeList schemeChildren = modelNode.getChildNodes();
+ int realCount = 0;
+ for (int i = 0; i < schemeChildren.getLength(); i++) {
+
+ Node schemeChild = schemeChildren.item(i);
+
+ // leave out empty text nodes in test dom model
+ if ((schemeChild.getNodeType() == Node.TEXT_NODE)
+ && ((schemeChild.getNodeValue() == null) || (schemeChild
+ .getNodeValue().trim().length() == 0)))
+ continue;
+
+ nsIDOMNode vpeChild = vpeChildren.item(realCount++);
+
+ if (null == vpeChild) {
+ throw new ComparisonException(
+ "Child of node \"" //$NON-NLS-1$
+ + vpeNode.getNodeName()
+ + "\" is \"null\", but should be \"" + schemeChild.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // leave out empty text nodes in vpe dom model
+ while (((vpeChild.getNodeType() == Node.TEXT_NODE) && ((vpeChild
+ .getNodeValue() == null) || (vpeChild.getNodeValue().trim()
+ .length() == 0)))) {
+ vpeChild = vpeChildren.item(realCount++);
+ if (null == vpeChild) {
+ throw new ComparisonException(
+ "Child of node \"" //$NON-NLS-1$
+ + vpeNode.getNodeName()
+ + "\" is \"null\", but should be \"" + schemeChild.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ compareNodes(vpeChild, schemeChild);
+
+ }
+
+ }
+
+ /**
+ * get ids of tests
+ *
+ * @param testDocument
+ * @return
+ */
+ public static List<String> getTestIds(Document testDocument) {
+ Element rootElement = testDocument.getDocumentElement();
+ List<String> ids = new ArrayList<String>();
+ NodeList children = rootElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ ids.add(((Element) child).getAttribute(ID_ATTRIBUTE));
+
+ }
+ return ids;
+ }
+
+ private static void compareAttributes(NamedNodeMap modelAttributes,
+ nsIDOMNamedNodeMap vpeAttributes) throws ComparisonException {
+
+ for (int i = 0; i < modelAttributes.getLength(); i++) {
+ Attr modelAttr = (Attr) modelAttributes.item(i);
+ String name = modelAttr.getName();
+
+ // if the attribute has to be skipped, then do it
+ if ( name != null
+ && skippedAtributes.contains(name.toUpperCase()) ) {
+ continue;
+ }
+
+ // if there are limitation of attributes
+ if (ILLEGAL_ATTRIBUTES.equals(name)) {
+
+ String[] illegalAttributes = modelAttr.getNodeValue().split(
+ ILLEGAL_ATTRIBUTES_SEPARATOR);
+
+ for (String illegalAttributeName : illegalAttributes) {
+ if (vpeAttributes.getNamedItem(illegalAttributeName.trim()) != null)
+ throw new ComparisonException("illegal attribute :" //$NON-NLS-1$
+ + illegalAttributeName);
+ }
+
+ } else {
+
+
+ if (vpeAttributes.getNamedItem(
+ name) == null)
+ throw new ComparisonException("there is not : \"" + name //$NON-NLS-1$
+ + "\" attribute"); //$NON-NLS-1$
+
+ nsIDOMAttr vpeAttr = (nsIDOMAttr) vpeAttributes.getNamedItem(
+ name).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
+
+ compareComplexStrings(modelAttr.getNodeValue().trim(),
+ vpeAttr.getNodeValue().trim());
+
+ }
+ }
+ }
+
+ static private void compareComplexStrings(String modelString,
+ String vpeString) throws ComparisonException {
+
+ if (modelString.startsWith(START_REGEX)
+ && modelString.endsWith(END_REGEX)) {
+
+ String regex = modelString.substring(START_REGEX.length(),
+ modelString.length() - END_REGEX.length());
+
+ Matcher matcher = Pattern.compile(regex).matcher(vpeString);
+ if (!matcher.find()) {
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but pattern is \"" + regex + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ } else if (!modelString.equals(vpeString)) {
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but must be \"" + modelString + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+import junit.framework.Assert;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.VpeEditorPart;
+
+/**
+ * Class for importing project from jar file.
+ *
+ * @author sdzmitrovich
+ */
+public class TestUtil {
+
+ /**
+ * Gets visual page editor controller.
+ *
+ * @param part the part
+ *
+ * @return {@link VpeController}
+ */
+ public static VpeController getVpeController(JSPMultiPageEditor part) {
+
+ VpeEditorPart visualEditor = (VpeEditorPart) part.getVisualEditor();
+ while(visualEditor.getController()==null) {
+ if (!Display.getCurrent().readAndDispatch()) {
+ Display.getCurrent().sleep();
+ }
+ }
+ return visualEditor.getController();
+ }
+
+ /**
+ * Fail.
+ *
+ * @param t the t
+ */
+ public static void fail(Throwable t){
+ Assert.fail("Test case was fail "+t.getMessage()+":"+t);
+ }
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,176 @@
+package org.jboss.tools.vpe.ui.auto.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.ui.auto.test.JBTSWTBotTestCase;
+import org.jboss.tools.ui.auto.test.SWTBotMultiPageEditor;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public abstract class VPEAutoTestCase extends JBTSWTBotTestCase{
+
+ protected static Properties projectProperties;
+ public static String PROJECT_PROPERTIES = "projectProperties.properties";
+ public static String JBOSS_EAP_HOME;
+ static {
+ try {
+ InputStream is = Platform.getBundle(Activator.PLUGIN_ID).getResource(PROJECT_PROPERTIES).openStream();
+ projectProperties = new Properties();
+ projectProperties.load(is);
+ } catch (IOException e) {
+ fail("Can't load properties from " + PROJECT_PROPERTIES + " file");
+ } catch (IllegalStateException e) {
+ fail("Property file " + PROJECT_PROPERTIES + " was not found");
+ }
+ JBOSS_EAP_HOME = System.getProperty("jbosstools.test.jboss.home.eap",projectProperties.getProperty("JBossEap4.3"));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName"));
+ } catch (WidgetNotFoundException e) {
+ createJSFProject(projectProperties.getProperty("JSFProjectName"));
+ }
+ }
+
+ protected void createJSFProject(String jsfProjectName){
+ bot.menu("File").menu("New").menu("Other...").click();
+ bot.tree().expandNode("JBoss Tools Web").expandNode("JSF").select("JSF Project");
+ bot.button("Next >").click();
+ bot.textWithLabel("Project Name*").setText(jsfProjectName);
+ bot.comboBoxWithLabel("Template*").setSelection("JSFKickStartWithoutLibs");
+ bot.button("Next >").click();
+ try {
+ bot.comboBoxWithLabel("Runtime*").setSelection("jboss-eap Runtime");
+ delay();
+ bot.button("Finish").click();
+ try {
+ bot.button("Yes").click();
+ openErrorLog();
+ openPackageExplorer();
+ openProgressStatus();
+ } catch (Exception e) {
+ }
+ } catch (Exception e) {
+ bot.button(0).click();
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("JBoss Enterprise Middleware").select("JBoss Enterprise Application Platform 4.3 Runtime");
+ bot.button("Next >").click();
+ bot.textWithLabel("Home Directory").setText(JBOSS_EAP_HOME);
+ bot.button("Finish").click();
+ delay();
+ bot.button("Finish").click();
+ try {
+ bot.button("Yes").click();
+ openErrorLog();
+ openPackageExplorer();
+ openProgressStatus();
+ } catch (Exception e2) {
+ }
+ }
+
+ }
+
+ protected void performContentTest(String expectedVPEContent, SWTBotMultiPageEditor editor) throws Throwable{
+
+ JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
+ assertNotNull(multiPageEditor);
+
+ VpeController controller = TestUtil.getVpeController(multiPageEditor);
+
+ String expectedVPEContentFilePath = getPathToResources()+expectedVPEContent;
+ expectedVPEContentFilePath = expectedVPEContentFilePath.substring(16);
+
+ File xmlTestFile = new File (expectedVPEContentFilePath);
+
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull("Can't get test file, possibly file not exists "+xmlTestFile,xmlTestDocument); //$NON-NLS-1$
+
+ List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
+
+ for (String id : ids) {
+
+ compareElements(controller, xmlTestDocument, id, id);
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ private void compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId, String xmlTestId)
+ throws ComparisonException {
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull("Cann't find element with id="+elementId,vpeElement); //$NON-NLS-1$
+
+ // get test element by id - get <test id="..." > element and get his
+ // first child
+ Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
+ .getElemenById(xmlTestDocument, xmlTestId));
+
+ assertNotNull(xmlModelElement);
+
+ // compare DOMs
+ try {
+ TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+ } catch (ComparisonException e) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ private nsIDOMElement findElementById(VpeController controller,
+ String elementId) {
+
+ Element sourceElement = findSourceElementById(controller, elementId);
+
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
+ sourceElement);
+
+ if (nodeMapping == null)
+ return null;
+
+ return (nsIDOMElement) nodeMapping.getVisualNode();
+ }
+
+ private Element findSourceElementById(VpeController controller,
+ String elementId) {
+
+ return getSourceDocument(controller).getElementById(elementId);
+ }
+
+ private Document getSourceDocument(VpeController controller) {
+ return controller.getSourceBuilder().getSourceDocument();
+ }
+
+ protected String getPathToResources() {
+ return Platform.getBundle(Activator.PLUGIN_ID).getLocation()+"resources/";
+ }
+
+ @Override
+ protected void activePerspective() {
+ if (!bot.perspectiveByLabel("Web Development").isActive()) {
+ bot.perspectiveByLabel("Web Development").activate();
+ }
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,34 @@
+package org.jboss.tools.vpe.ui.auto.test.jbide;
+
+import java.util.List;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.auto.test.VPEAutoTestCase;
+
+public class JBIDE3197Test extends VPEAutoTestCase {
+
+ public void testOpenPage(){
+
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ List<? extends SWTBotEditor> editors = bot.editors();
+ for (int i = 0; i < editors.size(); i++) {
+ editors.get(i).close();
+ }
+
+ } catch (Exception e) {
+ }
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+
+
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java 2009-06-29 06:55:55 UTC (rev 16240)
@@ -0,0 +1,53 @@
+package org.jboss.tools.vpe.ui.auto.test.jbide;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.auto.test.VPEAutoTestCase;
+
+public class JBIDE4306Test extends VPEAutoTestCase{
+
+ public void testOpenPageOnVisualSourceTab(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ }
+
+ public void testSetDefaultTabSource(){
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.comboBoxWithLabel("Default Editor Tab:").setSelection("Source");
+ bot.button("OK").click();
+ try {
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ bot.editorByTitle("hello.jsp").close();
+ }
+
+ public void testSetDefaultTabVisualSource(){
+ bot.editorByTitle("inputUserName.jsp").setFocus();
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.comboBoxWithLabel("Default Editor Tab:").setSelection("Visual/Source");
+ bot.button("OK").click();
+ bot.editorByTitle("inputUserName.jsp").close();
+ }
+
+}
15 years, 5 months
JBoss Tools SVN: r16239 - in workspace/yzhishko: org.jboss.tools.ui.runtime.auto.test and 21 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-06-29 02:51:59 -0400 (Mon, 29 Jun 2009)
New Revision: 16239
Added:
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.classpath
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.project
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.settings/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.settings/org.eclipse.jdt.core.prefs
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/META-INF/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/META-INF/MANIFEST.MF
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Activator.class
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.class
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Messages.class
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/messages.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/preferences/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.class
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/runtimePaths.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/build.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.xml
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/resources/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/resources/runtimePaths.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Activator.java
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.java
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Messages.java
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/messages.properties
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/preferences/
workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.java
Log:
These settings will be preloaded before tests launch. We need them to create and run Seam tests
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.classpath
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.classpath (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.classpath 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.project
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.project (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.project 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.ui.runtime.auto.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/.settings/org.eclipse.jdt.core.prefs 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,7 @@
+#Thu Dec 04 23:27:23 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/META-INF/MANIFEST.MF 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.ui.runtime.auto.test;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.ui.runtime.auto.test.Activator
+Bundle-Vendor: %BundleVendor
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.jboss.tools.seam.core,
+ org.eclipse.ui,
+ org.eclipse.wst.server.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.ui.workbench,
+ org.eclipse.datatools.connectivity;visibility:=reexport,
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common,
+ org.jboss.tools.ui.auto.test;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Activator.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Messages.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/Messages.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/messages.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/messages.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/messages.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,11 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
+JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/runtimePaths.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/runtimePaths.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/bin/runtimePaths.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1 @@
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/build.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/build.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/build.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,6 @@
+source.. = src/,resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss, a divison of Red Hat
+BundleName = JBoss Runtime Initializer
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/plugin.xml 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.jboss.tools.ui.runtime.auto.test.JBossRuntimeStartup">
+ </startup>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.jboss.tools.ui.runtime.auto.test.preferences.JBossRuntimePreferencesInitializer"/>
+ </extension>
+
+</plugin>
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/resources/runtimePaths.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/resources/runtimePaths.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/resources/runtimePaths.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1 @@
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Activator.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Activator.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Activator.java 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,52 @@
+package org.jboss.tools.ui.runtime.auto.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ui.runtime.auto.test"; //$NON-NLS-1$
+
+ public static final String FIRST_START = "firstStart"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/JBossRuntimeStartup.java 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,320 @@
+package org.jboss.tools.ui.runtime.auto.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ConnectionProfileException;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
+import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
+import org.eclipse.datatools.connectivity.drivers.IPropertySet;
+import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.ui.IStartup;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+
+@SuppressWarnings("restriction")
+public class JBossRuntimeStartup implements IStartup {
+
+ private static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
+
+ public static String JBOSS_EAP_HOME; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+
+ private static final String RUNTIME_PROPERTIES = "runtimePaths.properties";
+
+ static{
+ try {
+ InputStream inputStream = Platform.getBundle(Activator.PLUGIN_ID).getResource(RUNTIME_PROPERTIES).openStream();
+ Properties properties = new Properties();
+ properties.load(inputStream);
+ JBOSS_EAP_HOME = System.getProperty("jbosstools.test.jboss.home.eap", properties.getProperty("JBossEap4.3"));
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Can't load properties from " + RUNTIME_PROPERTIES + " file", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ } catch (IllegalStateException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Property file " + RUNTIME_PROPERTIES + " was not found", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ }
+ }
+
+ // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+ public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.eap.43" //$NON-NLS-1$
+ };
+
+ public static final String JBOSS_AS_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.eap.43" //$NON-NLS-1$
+ };
+
+ public static final String JBOSS_AS_NAME[] = {
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0,
+ Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3
+ };
+
+ public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default"; //$NON-NLS-1$
+
+ //public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
+
+ public static final String HSQL_DRIVER_DEFINITION_ID
+ = "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_TEMPLATE_ID
+ = "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
+
+ public static final String DTP_DB_URL_PROPERTY_ID
+ = "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
+
+
+ public void earlyStartup() {
+ boolean firstStart = Activator.getDefault().getPreferenceStore().getBoolean(Activator.FIRST_START);
+ if (!firstStart) {
+ return;
+ }
+ Activator.getDefault().getPreferenceStore().setValue(Activator.FIRST_START, false);
+ File jbossASDir = new File(JBOSS_EAP_HOME);
+ createJBossServer(jbossASDir,4, "jboss-eap", "jboss-eap " + RUNTIME); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ private void createJBossServer(File asLocation, int index, String name, String runtimeName) {
+ if (!asLocation.isDirectory()) {
+ return;
+ }
+ IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
+
+ IServer[] servers = ServerCore.getServers();
+ for (int i = 0; i < servers.length; i++) {
+ IRuntime runtime = servers[i].getRuntime();
+ if(runtime != null && runtime.getLocation().equals(jbossAsLocationPath)) {
+ return;
+ }
+ }
+
+ IRuntime runtime = null;
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for (int i = 0; i < runtimes.length; i++) {
+ if (runtimes[0].getLocation().equals(jbossAsLocationPath)) {
+ runtime = runtimes[0].createWorkingCopy();
+ break;
+ }
+ }
+
+ IProgressMonitor progressMonitor = new NullProgressMonitor();
+ try {
+ if (runtime == null) {
+ runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor, index);
+ }
+ if (runtime != null) {
+ createServer(progressMonitor, runtime, index, name);
+ }
+
+ createDriver(asLocation.getAbsolutePath());
+ } catch (CoreException e) {
+ log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
+ } catch (ConnectionProfileException e) {
+ log(e,Messages.JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile);
+ }
+ }
+
+ private static void log(Throwable e, String message) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, e);
+ Activator.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Creates new JBoss AS Runtime, Server and hsqldb driver
+ * @param jbossASLocation location of JBoss Server
+ * @param progressMonitor to report progress
+ * @return server working copy
+ * @throws CoreException
+ * @throws ConnectionProfileException
+ */
+ public static IServerWorkingCopy initJBossAS(String jbossASLocation, IProgressMonitor progressMonitor) throws CoreException, ConnectionProfileException {
+ IRuntime runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ IServerWorkingCopy server = null;
+ if (runtime != null) {
+ server = createServer(progressMonitor, runtime, 2, null);
+ }
+ createDriver(jbossASLocation);
+ return server;
+ }
+
+ /**
+ * Creates new JBoss AS Runtime
+ * @param jbossASLocation location of JBoss AS
+ * @param progressMonitor
+ * @return runtime working copy
+ * @throws CoreException
+ */
+ private static IRuntime createRuntime(String runtimeName, String jbossASLocation, IProgressMonitor progressMonitor, int index) throws CoreException {
+ IRuntimeWorkingCopy runtime = null;
+ String type = null;
+ String version = null;
+ String runtimeId = null;
+ IPath jbossAsLocationPath = new Path(jbossASLocation);
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, JBOSS_AS_RUNTIME_TYPE_ID[index]);
+ if (runtimeTypes.length > 0) {
+ runtime = runtimeTypes[0].createRuntime(runtimeId, progressMonitor);
+ runtime.setLocation(jbossAsLocationPath);
+ if(runtimeName!=null) {
+ runtime.setName(runtimeName);
+ }
+ IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
+ // IJBossServerRuntime.PROPERTY_VM_ID
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID", defaultVM.getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_VM_TYPE_ID
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID", defaultVM.getVMInstallType().getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME
+ ((RuntimeWorkingCopy) runtime).setAttribute("org.jboss.ide.eclipse.as.core.runtime.configurationName", JBOSS_AS_DEFAULT_CONFIGURATION_NAME); //$NON-NLS-1$
+
+ return runtime.save(false, progressMonitor);
+ }
+ return runtime;
+ }
+
+ /**
+ * Creates new JBoss Server
+ * @param progressMonitor
+ * @param runtime parent JBoss AS Runtime
+ * @return server working copy
+ * @throws CoreException
+ */
+ private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
+ IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
+ IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
+
+ server.setHost(JBOSS_AS_HOST);
+ if(name != null)
+ server.setName(name);
+ else
+ server.setName(JBOSS_AS_NAME[index]);
+
+ // JBossServer.DEPLOY_DIRECTORY
+ String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+ ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
+
+ // IDeployableServer.TEMP_DEPLOY_DIRECTORY
+ String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal); //$NON-NLS-1$
+
+ // If we'd need to set up a username / pw for JMX, do it here.
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+
+ server.save(false, progressMonitor);
+ return server;
+ }
+
+ private static boolean driverIsCreated = false;
+
+ /**
+ * Creates HSQL DB Driver
+ * @param jbossASLocation location of JBoss AS
+ * @throws ConnectionProfileException
+ * @return driver instance
+ */
+ private static void createDriver(String jbossASLocation) throws ConnectionProfileException {
+ if(driverIsCreated) {
+ // Don't create the driver a few times
+ return;
+ }
+ String driverPath;
+ try {
+ driverPath = new File(jbossASLocation + "/server/default/lib/hsqldb.jar").getCanonicalPath(); //$NON-NLS-1$
+ } catch (IOException e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR,
+ Activator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver, e));
+ return;
+ }
+
+ DriverInstance driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver == null) {
+ TemplateDescriptor descr = TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME, HSQL_DRIVER_DEFINITION_ID);
+ instance.setName(HSQL_DRIVER_NAME);
+ instance.setID(HSQL_DRIVER_DEFINITION_ID);
+ Properties props = new Properties();
+
+ IConfigurationElement[] template = descr.getProperties();
+ for (int i = 0; i < template.length; i++) {
+ IConfigurationElement prop = template[i];
+ String id = prop.getAttribute("id"); //$NON-NLS-1$
+
+ String value = prop.getAttribute("value"); //$NON-NLS-1$
+ props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
+ }
+ props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:."); //$NON-NLS-1$
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+
+ instance.setBaseProperties(props);
+ DriverManager.getInstance().removeDriverInstance(instance.getID());
+ System.gc();
+ DriverManager.getInstance().addDriverInstance(instance);
+ }
+
+ driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver != null && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) { //$NON-NLS-1$
+ // create profile
+ Properties props = new Properties();
+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
+ props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, ""); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, ""); //$NON-NLS-1$
+ props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+
+ ProfileManager.getInstance().createProfile("DefaultDS", Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, IDBConnectionProfileConstants.CONNECTION_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ if(driver!=null) {
+ driverIsCreated = true;
+ }
+ }
+
+}
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Messages.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Messages.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/Messages.java 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,24 @@
+package org.jboss.tools.ui.runtime.auto.test;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.ui.runtime.auto.test.messages"; //$NON-NLS-1$
+ public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
+ public static String JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile;
+ public static String JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
+ public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
+ public static String JBossRuntimeStartup_Runtime;
+ public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/messages.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/messages.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/messages.properties 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,11 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
+JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
Added: workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.runtime.auto.test/src/org/jboss/tools/ui/runtime/auto/test/preferences/JBossRuntimePreferencesInitializer.java 2009-06-29 06:51:59 UTC (rev 16239)
@@ -0,0 +1,19 @@
+package org.jboss.tools.ui.runtime.auto.test.preferences;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.jboss.tools.ui.runtime.auto.test.Activator;
+
+@SuppressWarnings("deprecation")
+public class JBossRuntimePreferencesInitializer extends
+ AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ Preferences preferences = Activator.getDefault().getPluginPreferences();
+ preferences.setDefault(
+ Activator.FIRST_START,
+ true);
+ }
+
+}
15 years, 5 months
JBoss Tools SVN: r16238 - in workspace/yzhishko: org.jboss.tools.ui.auto.test and 17 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-06-29 02:48:06 -0400 (Mon, 29 Jun 2009)
New Revision: 16238
Added:
workspace/yzhishko/org.jboss.tools.ui.auto.test/
workspace/yzhishko/org.jboss.tools.ui.auto.test/.classpath
workspace/yzhishko/org.jboss.tools.ui.auto.test/.project
workspace/yzhishko/org.jboss.tools.ui.auto.test/.settings/
workspace/yzhishko/org.jboss.tools.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
workspace/yzhishko/org.jboss.tools.ui.auto.test/META-INF/
workspace/yzhishko/org.jboss.tools.ui.auto.test/META-INF/MANIFEST.MF
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/SWTBot.properties
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/log4j.xml
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/Activator.class
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.class
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.class
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTJBTBot.class
workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/WidgetVariables.class
workspace/yzhishko/org.jboss.tools.ui.auto.test/build.properties
workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/
workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/log4j.xml
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/Activator.java
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.java
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.java
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTJBTBot.java
workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/WidgetVariables.java
Log:
Base Test Case and settings for SWTBot auto tests
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/.classpath
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/.classpath (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/.classpath 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/.project
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/.project (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/.project 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.ui.auto.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/.settings/org.eclipse.jdt.core.prefs 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,8 @@
+#Tue Jun 16 17:54:08 EEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/META-INF/MANIFEST.MF 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test
+Bundle-SymbolicName: org.jboss.tools.ui.auto.test;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.ui.auto.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.hamcrest;bundle-version="1.1.0",
+ org.jboss.tools.jst.jsp;bundle-version="2.0.0",
+ org.jboss.tools.common.text.ext;bundle-version="2.0.0",
+ org.jboss.tools.jst.web;bundle-version="2.0.0",
+ org.eclipse.ui,
+ org.eclipse.ui.ide;bundle-version="3.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.jboss.tools.ui.auto.test
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/SWTBot.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/SWTBot.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/SWTBot.properties 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,2 @@
+SWTBotPreferences.PLAYBACK_DELAY=25
+SWTBotPreferences.TIMEOUT=1000
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/log4j.xml 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/Activator.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTJBTBot.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/SWTJBTBot.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/WidgetVariables.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.ui.auto.test/bin/org/jboss/tools/ui/auto/test/WidgetVariables.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/build.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/build.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/build.properties 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,5 @@
+source.. = src/,resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/resources/SWTBot.properties 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,2 @@
+SWTBotPreferences.PLAYBACK_DELAY=25
+SWTBotPreferences.TIMEOUT=1000
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/log4j.xml 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/Activator.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/Activator.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/Activator.java 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,55 @@
+package org.jboss.tools.ui.auto.test;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ui.auto.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static ILog getPluginLog() {
+ return plugin.getLog();
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/JBTSWTBotTestCase.java 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,143 @@
+package org.jboss.tools.ui.auto.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+
+public abstract class JBTSWTBotTestCase extends SWTBotTestCase implements
+ ILogListener {
+
+ private Throwable exception;
+ public static final String swtBotProperties = "SWTBot.properties";
+ private static Properties SWT_BOT_PROPERTIES;
+ protected SWTJBTBot bot = new SWTJBTBot();
+
+ static {
+ try {
+ InputStream swtPreferenceIS = Platform.getBundle(Activator.PLUGIN_ID).getResource(swtBotProperties)
+ .openStream();
+ SWT_BOT_PROPERTIES = new Properties();
+ SWT_BOT_PROPERTIES.load(swtPreferenceIS);
+ SWTBotPreferences.PLAYBACK_DELAY = Long
+ .parseLong(SWT_BOT_PROPERTIES
+ .getProperty("SWTBotPreferences.PLAYBACK_DELAY"));
+ SWTBotPreferences.TIMEOUT = Long.parseLong(SWT_BOT_PROPERTIES
+ .getProperty("SWTBotPreferences.TIMEOUT"));
+ swtPreferenceIS.close();
+ } catch (IOException e) {
+ fail("Can't load properties from " + swtBotProperties + " file");
+ } catch (IllegalStateException e) {
+ fail("Property file " + swtBotProperties + " was not found");
+ }
+ }
+
+ public void logging(IStatus status, String plugin) {
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ Throwable throwable = status.getException();
+ if (throwable == null) {
+ throwable = new Throwable(status.getMessage() + " in "
+ + status.getPlugin());
+ }
+ setException(throwable);
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected Throwable getException() {
+ return exception;
+ }
+
+ protected void setException(Throwable e) {
+ this.exception = e;
+ }
+
+ private void deleteLog() {
+ try {
+ Platform.getLogFileLocation().toFile().delete();
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ activePerspective();
+ deleteLog();
+ setException(null);
+ Platform.addLogListener(this);
+ try {
+ bot.viewByTitle(WidgetVariables.WELCOME).close();
+ } catch (WidgetNotFoundException e) {
+ }
+ openErrorLog();
+ openPackageExplorer();
+ openProgressStatus();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (getException() != null) {
+ throw new Exception(getException());
+ }
+ Platform.removeLogListener(this);
+ deleteLog();
+ }
+
+ protected void delay() {
+ bot.sleep(1000);
+ }
+
+ protected void longDelay() {
+ bot.sleep(10000);
+ }
+
+ abstract protected void activePerspective ();
+
+ protected void openErrorLog() {
+ try {
+ bot.viewByTitle(WidgetVariables.ERROR_LOG);
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ delay();
+ viewTree.expandNode("General")
+ .expandNode(WidgetVariables.ERROR_LOG).select();
+ bot.button("OK").click();
+ }
+ }
+
+ protected void openPackageExplorer() {
+ try {
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER);
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ delay();
+ viewTree.expandNode("Java").expandNode(
+ WidgetVariables.PACKAGE_EXPLORER).select();
+ bot.button("OK").click();
+ }
+ }
+
+ protected void openProgressStatus() {
+ try {
+ bot.viewByTitle(WidgetVariables.PROGRESS_STATUS);
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ delay();
+ viewTree.expandNode("General").expandNode(WidgetVariables.PROGRESS_STATUS).select();
+ bot.button("OK").click();
+ }
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTBotMultiPageEditor.java 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,28 @@
+package org.jboss.tools.ui.auto.test;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.ui.IEditorReference;
+import org.hamcrest.SelfDescribing;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+
+public class SWTBotMultiPageEditor extends SWTBotEditor{
+
+ public SWTBotMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot, SelfDescribing description) {
+ super(editorReference, bot, description);
+ }
+
+ public SWTBotMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot) {
+ super(editorReference, bot);
+ }
+
+ public JSPMultiPageEditor getJSPMultiPageEditor(){
+ if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
+ return (JSPMultiPageEditor)partReference.getPart(true);
+ }
+ return null;
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTJBTBot.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTJBTBot.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/SWTJBTBot.java 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,26 @@
+package org.jboss.tools.ui.auto.test;
+
+import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartId;
+import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
+import static org.eclipse.swtbot.eclipse.finder.waits.Conditions.waitForEditor;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.waits.WaitForEditor;
+import org.hamcrest.Matcher;
+
+public class SWTJBTBot extends SWTWorkbenchBot{
+
+ public SWTBotMultiPageEditor multiPageEditor(Matcher<?> matcher) {
+ WaitForEditor waitForEditor = waitForEditor(matcher);
+ waitUntilWidgetAppears(waitForEditor);
+ return new SWTBotMultiPageEditor(waitForEditor.get(0), this);
+ }
+
+ public SWTBotMultiPageEditor multiPageEditorByTitle (String fileName) {
+ return multiPageEditor(withPartName(fileName));
+ }
+
+ public SWTBotMultiPageEditor multiPageEditorById(String id){
+ return multiPageEditor(withPartId(id));
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/WidgetVariables.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/WidgetVariables.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.ui.auto.test/src/org/jboss/tools/ui/auto/test/WidgetVariables.java 2009-06-29 06:48:06 UTC (rev 16238)
@@ -0,0 +1,10 @@
+package org.jboss.tools.ui.auto.test;
+
+public class WidgetVariables {
+
+ public static final String ERROR_LOG = "Error Log";
+ public static final String PACKAGE_EXPLORER = "Package Explorer";
+ public static final String WELCOME = "Welcome";
+ public static final String PROGRESS_STATUS = "Progress";
+
+}
15 years, 5 months
JBoss Tools SVN: r16237 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools: common/ant/parser and 38 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-06-29 02:41:57 -0400 (Mon, 29 Jun 2009)
New Revision: 16237
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/MultistepWizardStep.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl2.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionListImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XAttributeDataImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XEntityDataImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenCopyHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenDeleteHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CopyHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CreateIconHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CutHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultEditHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultOpenHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRemoveHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultSpecialHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenObjectEditorHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithChoiceHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteEnterNewNameSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PropertiesHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceSignificanceMessageImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceWithNewHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SaveAllHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ShowMenuHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SortByNameHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ViewAgentHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/XAdapter.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFolderName.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintInt.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintJavaName.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListAdd.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListTemplates.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintProperties.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintQClassName.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeEditorImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaResourceLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XEntityRendererImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataConstants.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityExtensionImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelMetaDataImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelElement.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelPath.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterProjectsRoot.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidatorHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/KeyLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/WizardKeys.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/ServiceDialog.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelConstants.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/adapter/ModelObjectAdapterExtensionPoint.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/XActionAgentEvent.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFolderSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/InvokingWizardHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/TargetHolder.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileAuxiliary.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FilePathHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileSystemsHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DeleteFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DiscardFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyLongImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemFolderLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HelpOverlappedFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HiddenSystemsHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/LFileObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFolderHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MoveFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SaveFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SelectOverlappedFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SimpleFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFolderHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/FolderPasteHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameEclipseFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenEditorHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenJavaEditorHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/ProjectPropertiesHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RunAntHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/EngineIcon.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ModifiersIcon.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ReferencedIcons.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XIconListImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementPresentationManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/CustomizedObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/EntityComparator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/ExtraRootImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/OpenedProjectsImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/PropertyObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RootImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/BundleItemObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/CountriesHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/AllResourcesTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultFilteredTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSiftedTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSubTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceBundleTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/IconsTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/NavigationTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/PaletteTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/SearchTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/java/handlers/OpenJavaSourceHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/FileRootLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/ResourceMarkers.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/HiddenPaletteTabsHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PaletteAdopt.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PreferenceImportExport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableContainerImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableElementImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdateWizard.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IModelNature.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IPromptingProvider.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/PromptingProviderFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/WatcherLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RefactoringHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintValueImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchDefaultHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeSetUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XCreateUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XMoveUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XProtectedTransaction.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XRemoveUndo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoItem.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoableImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AbstractTableHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleBundles.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleClasses.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleJava.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/BrowserHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ClassLoaderUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseJavaUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/FindObjectHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/IconUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelImages.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/NamespaceMapping.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/OSHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Paths.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionHolder.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLMapper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/IFilePathEncoder.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/URIConstants.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings (just adding NON-NLS comments)
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,6 @@
import org.eclipse.ant.internal.core.contentDescriber.AntBuildfileContentDescriber;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.jboss.tools.common.model.loaders.*;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,14 +12,13 @@
import java.io.*;
import org.w3c.dom.*;
-import org.eclipse.ant.core.TargetInfo;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.util.XMLUtil;
/**
* FIXME switch to TargetInfo[] AntRunner.getAvailableTargets()
- *
+ * @see org.eclipse.ant.core.AntRunner#getAvailableTargets()
*/
public class AntParser {
private String[] targets = null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -124,7 +124,7 @@
protected boolean checkChild(XModelObject parent, String entity, Properties data) {
XModelObject o = support.getTarget().getModel().createModelObject(entity, data);
if(o.getModelEntity().getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null
- && !XModelObjectConstants.TRUE.equals(o.getModelEntity().getProperty("unique"))) return true;
+ && !XModelObjectConstants.TRUE.equals(o.getModelEntity().getProperty("unique"))) return true; //$NON-NLS-1$
if(o != null && parent == support.getTarget().getParent() && o.getPathPart().equals(support.getTarget().getPathPart())) return true;
if(o != null) message = DefaultCreateHandler.getContainsMessage(parent, o);
return message == null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/MultistepWizardStep.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/MultistepWizardStep.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/MultistepWizardStep.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,7 +33,7 @@
}
public String getStepImplementingClass() {
- return "org.jboss.tools.common.model.ui.wizards.special.SpecialWizardStep";
+ return "org.jboss.tools.common.model.ui.wizards.special.SpecialWizardStep"; //$NON-NLS-1$
}
public boolean isFieldEditorEnabled(String name, Properties p) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,12 +18,12 @@
public String getMessage(XAction action, XModelObject object, XModelObject[] objects) {
String d = action.getDisplayName();
- if(d.endsWith("...")) d = d.substring(d.length() - 3);
+ if(d.endsWith("...")) d = d.substring(d.length() - 3); //$NON-NLS-1$
XAttribute e = object.getModelEntity().getAttribute(XModelObjectConstants.ATTR_ELEMENT_TYPE);
- String type = (e == null || !e.isVisible()) ? "" : object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE);
- if(type.length() > 0) type += " ";
+ String type = (e == null || !e.isVisible()) ? "" : object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE); //$NON-NLS-1$
+ if(type.length() > 0) type += " "; //$NON-NLS-1$
String what = (objects != null && objects.length > 1) ? objects.length + " selected objects" :
- type + "'" + object.getPresentationString() + "'";
+ type + "'" + object.getPresentationString() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
return d + " " + what;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl2.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl2.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SignificanceMessageImpl2.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public String getMessage(XAction action, XModelObject object, XModelObject[] objects) {
String d = action.getDisplayName();
- if(d.endsWith("...")) d = d.substring(d.length() - 3);
+ if(d.endsWith("...")) d = d.substring(d.length() - 3); //$NON-NLS-1$
String p = object.getPresentationString();
if(p.length() > 0) p = Character.toTitleCase(p.charAt(0)) + p.substring(1);
String what = (objects != null && objects.length > 1) ? objects.length + " selected objects" : p;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -86,15 +86,15 @@
public String getTitle() {
String title = WizardKeys.getHeader(getHelpKey());
if(title != null) return title;
- String n = (action == null) ? "" : "" + action.getDisplayName();
- if(n.endsWith("...")) n = n.substring(0, n.length() - 3);
+ String n = (action == null) ? "" : "" + action.getDisplayName(); //$NON-NLS-1$ //$NON-NLS-2$
+ if(n.endsWith("...")) n = n.substring(0, n.length() - 3); //$NON-NLS-1$
return n;
}
public String getSubtitle() {
String key = getHelpKey();
String t = WizardKeys.getTitle(key);
- if(t == null && key != null && key.endsWith("_0")) {
+ if(t == null && key != null && key.endsWith("_0")) { //$NON-NLS-1$
String key1 = key.substring(0, key.length() - 2);
t = WizardKeys.getTitle(key1);
}
@@ -204,9 +204,9 @@
public String getHelpKey() {
if(action == null) return null;
- String key = action.getProperty("key");
+ String key = action.getProperty("key"); //$NON-NLS-1$
if(key != null && key.length() > 0) return key;
- return target.getModelEntity().getName() + "_" + action.getName() + "_" + stepId;
+ return target.getModelEntity().getName() + "_" + action.getName() + "_" + stepId; //$NON-NLS-1$ //$NON-NLS-2$
}
public final XModelObject getTarget() {
@@ -233,7 +233,7 @@
return defaultValidator;
}
- static String DEFAULT_IMLEMENTING_CLASS = "org.jboss.tools.common.model.ui.wizards.special.SpecialWizardStep";
+ static String DEFAULT_IMLEMENTING_CLASS = "org.jboss.tools.common.model.ui.wizards.special.SpecialWizardStep"; //$NON-NLS-1$
public String getStepImplementingClass(int stepId) {
return DEFAULT_IMLEMENTING_CLASS;
@@ -260,7 +260,7 @@
String n = ad[i].getAttribute().getName();
String v = object.getAttributeValue(n);
if(v != null) ad[i].setValue(v);
- v = action.getProperty("attribute." + n);
+ v = action.getProperty("attribute." + n); //$NON-NLS-1$
if(v != null) ad[i].setValue(v);
}
}
@@ -334,7 +334,7 @@
public String getHelpContextId() {
if(action == null) return null;
- String s = action.getProperty("helpId");
+ String s = action.getProperty("helpId"); //$NON-NLS-1$
if(s == null || s.length() == 0) return null;
int i = s.indexOf('%');
if(i < 0) return s;
@@ -342,7 +342,7 @@
if(j < 0) return s;
String vr = s.substring(i + 1, j);
String tail = s.substring(j + 1);
- XMapping map = action.getMetaModel().getMapping("HelpPlugins");
+ XMapping map = action.getMetaModel().getMapping("HelpPlugins"); //$NON-NLS-1$
if(map == null) return s;
String varValue = map.getValue(vr);
if(varValue == null) return s;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,7 +33,7 @@
public XActionImpl() {}
public String getWizardClassName() {
- return (wizard = expand(wizard, "Wizards"));
+ return (wizard = expand(wizard, "Wizards")); //$NON-NLS-1$
}
public XRedirect getRedirect() {
@@ -94,22 +94,22 @@
public void load(Element el) {
super.load(el);
- handlerClassName = el.getAttribute("HandlerClassName");
- handlername = new ClassHolder2(this, el.getAttribute("HandlerClassName"), "Handlers");
- wizard = el.getAttribute("WizardClassName");
- baseaction = (!XMetaDataLoader.hasAttribute(el, "BaseActionName")) ? null :
- el.getAttribute("BaseActionName");
- isSave2ModelRequired = XModelObjectConstants.YES.equals(el.getAttribute("SAVE_REQUIRED"));
- hide = el.getAttribute("HIDE");
- Element[] cs = XMetaDataLoader.getChildrenElements(el, "EntityData");
+ handlerClassName = el.getAttribute("HandlerClassName"); //$NON-NLS-1$
+ handlername = new ClassHolder2(this, el.getAttribute("HandlerClassName"), "Handlers"); //$NON-NLS-1$ //$NON-NLS-2$
+ wizard = el.getAttribute("WizardClassName"); //$NON-NLS-1$
+ baseaction = (!XMetaDataLoader.hasAttribute(el, "BaseActionName")) ? null : //$NON-NLS-1$
+ el.getAttribute("BaseActionName"); //$NON-NLS-1$
+ isSave2ModelRequired = XModelObjectConstants.YES.equals(el.getAttribute("SAVE_REQUIRED")); //$NON-NLS-1$
+ hide = el.getAttribute("HIDE"); //$NON-NLS-1$
+ Element[] cs = XMetaDataLoader.getChildrenElements(el, "EntityData"); //$NON-NLS-1$
data = new XEntityDataImpl[cs.length];
for (int i = 0; i < cs.length; i++) {
data[i] = new XEntityDataImpl();
((XEntityDataImpl)data[i]).load(cs[i]);
}
- String callbackname = el.getAttribute("CallBackClassName");
+ String callbackname = el.getAttribute("CallBackClassName"); //$NON-NLS-1$
if(callbackname != null && callbackname.length() > 0) {
- ModelPlugin.getPluginLog().logInfo("Warning: callback=" + callbackname);
+ ModelPlugin.getPluginLog().logInfo("Warning: callback=" + callbackname); //$NON-NLS-1$
}
}
@@ -140,10 +140,10 @@
public static XAction getHelpAction() {
if(help != null) return help;
XActionImpl a = new XActionImpl();
- a.handlername = new ClassHolder2(a, "org.jboss.tools.common.meta.help.HelpHandler", "Handlers");
- a.setDisplayName("Help");
- a.setName("Help");
- a.iconname = "action.empty";
+ a.handlername = new ClassHolder2(a, "org.jboss.tools.common.meta.help.HelpHandler", "Handlers"); //$NON-NLS-1$ //$NON-NLS-2$
+ a.setDisplayName("Help"); //$NON-NLS-1$
+ a.setName("Help"); //$NON-NLS-1$
+ a.iconname = "action.empty"; //$NON-NLS-1$
a.data = new XEntityDataImpl[0];
return help = a;
}
@@ -157,13 +157,13 @@
if(handlerClassName == null || handlerClassName.trim().length() == 0) {
return null; //"handler is not set";
}
- String cn = expand(handlerClassName, "Handlers");
+ String cn = expand(handlerClassName, "Handlers"); //$NON-NLS-1$
if(cn == null) {
- return "cannot expand handler name " + handlerClassName;
+ return "cannot expand handler name " + handlerClassName; //$NON-NLS-1$
}
Class cls = ModelFeatureFactory.getInstance().getFeatureClass(cn);
if(cls == null) {
- return "cannot load handler class " + cn;
+ return "cannot load handler class " + cn; //$NON-NLS-1$
}
Object h = null;
try {
@@ -172,29 +172,29 @@
//just wrong class path in test plugin
return null;
} catch (InstantiationException e) {
- return "cannot create handler " + cn;
+ return "cannot create handler " + cn; //$NON-NLS-1$
} catch (IllegalAccessException e) {
- return "cannot create handler " + cn;
+ return "cannot create handler " + cn; //$NON-NLS-1$
}
if(!(h instanceof XActionHandler)) {
- return "cannot reduce handler to XActionHandler";
+ return "cannot reduce handler to XActionHandler"; //$NON-NLS-1$
}
if(h instanceof DefaultSpecialHandler) {
- String scn = getProperty("support");
+ String scn = getProperty("support"); //$NON-NLS-1$
Class scls = ModelFeatureFactory.getInstance().getFeatureClass(scn);
if(scls == null) {
- return "cannot load support class " + scn;
+ return "cannot load support class " + scn; //$NON-NLS-1$
}
Object so = null;
try {
so = scls.newInstance();
} catch (IllegalAccessException e) {
- return "cannot create support " + scn;
+ return "cannot create support " + scn; //$NON-NLS-1$
} catch (InstantiationException e) {
- return "cannot create support " + scn;
+ return "cannot create support " + scn; //$NON-NLS-1$
}
if(!(so instanceof SpecialWizardSupport)) {
- return "cannot reduce support " + scn + " to SpecialWizardSupport";
+ return "cannot reduce support " + scn + " to SpecialWizardSupport"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
return null;
@@ -205,13 +205,13 @@
for (int i = 0; i < data.length; i++) {
XEntityDataImpl d = (XEntityDataImpl)data[i];
if(d.getModelEntity() == null) {
- return "cannot find entity " + d.getEntityName();
+ return "cannot find entity " + d.getEntityName(); //$NON-NLS-1$
}
XAttributeData[] ad = d.getAttributeData();
for (int j = 0; j < ad.length; j++) {
XAttributeDataImpl a = (XAttributeDataImpl)ad[j];
if(a.getAttribute() == null) {
- return "cannot find attribute " + d.getEntityName() + ":" + a.getAttributeName();
+ return "cannot find attribute " + d.getEntityName() + ":" + a.getAttributeName(); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionListImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionListImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XActionListImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -51,7 +51,7 @@
for (int i = 0; i < is.length; i++) {
XActionItemImpl item = (XActionItemImpl)is[i];
if(item instanceof XActionListImpl)
- ((XActionListImpl)item).print(off + " ");
+ ((XActionListImpl)item).print(off + " "); //$NON-NLS-1$
}
}
@@ -64,7 +64,7 @@
public XActionItem getItem(String name) {
if(name == null) {
- System.out.println("XActionListImpl.getItem: name=null");
+ System.out.println("XActionListImpl.getItem: name=null"); //$NON-NLS-1$
}
for (int i = 0; i < items.length; i++) {
if(items[i].getName().equals(name)) return items[i];
@@ -74,7 +74,7 @@
public XActionItem findItem(String path) {
if(path == null || path.length() == 0) return null;
- StringTokenizer st = new StringTokenizer(path, "./");
+ StringTokenizer st = new StringTokenizer(path, "./"); //$NON-NLS-1$
XActionItem item = this;
while(st.hasMoreTokens() && item != null) {
String part = st.nextToken();
@@ -90,7 +90,7 @@
public void load(Element el) {
super.load(el);
- groupfactor = (short)XMetaDataLoader.getInt(el, "group", 0);
+ groupfactor = (short)XMetaDataLoader.getInt(el, "group", 0); //$NON-NLS-1$
NodeList ns = el.getChildNodes();
List<XActionItem> list = new ArrayList<XActionItem>();
for (int i = 0; i < ns.getLength(); i++) {
@@ -99,8 +99,8 @@
Element ei = (Element)n;
String tag = ei.getNodeName();
if(XMODEL_ACTION_ITEM.equals(tag)) {
- String kind = ei.getAttribute("kind");
- XActionItemImpl item = (kind.equals("list"))
+ String kind = ei.getAttribute("kind"); //$NON-NLS-1$
+ XActionItemImpl item = (kind.equals("list")) //$NON-NLS-1$
? (XActionItemImpl) new XActionListImpl()
: (XActionItemImpl) new XActionImpl();
item.setParent(this);
@@ -109,8 +109,8 @@
} else if(XMODEL_ACTION_ITEM_REF.equals(tag)) {
String entityName = ei.getAttribute(XMetaDataConstants.ENTITY);
String attrName = ei.getAttribute(NAME);
- String path = ei.hasAttribute("path")
- ? ei.getAttribute("path")
+ String path = ei.hasAttribute("path") //$NON-NLS-1$
+ ? ei.getAttribute("path") //$NON-NLS-1$
: attrName;
XModelEntity entity = getMetaModel().getEntity(entityName);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XAttributeDataImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XAttributeDataImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XAttributeDataImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -65,9 +65,9 @@
attributename = el.getAttribute("AttributeName"); //$NON-NLS-1$
entityname = ((Element)el.getParentNode()).getAttribute("EntityName"); //$NON-NLS-1$
String m = el.getAttribute("Mandatory"); //$NON-NLS-1$
- mandatory = XModelObjectConstants.YES.equals(m) || "".equals(m); //$NON-NLS-1$//$NON-NLS-2$
+ mandatory = XModelObjectConstants.YES.equals(m) || "".equals(m); //$NON-NLS-1$
m = el.getAttribute("Advanced"); //$NON-NLS-1$
- isAdvanced = XModelObjectConstants.YES.equals(m); //$NON-NLS-1$
+ isAdvanced = XModelObjectConstants.YES.equals(m);
}
public String getAttributeName() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XEntityDataImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XEntityDataImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/XEntityDataImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -50,7 +50,7 @@
public void load(Element el) {
entityname = el.getAttribute("EntityName"); //$NON-NLS-1$
- mandatory = XModelObjectConstants.YES.equals(el.getAttribute("Mandatory")); //$NON-NLS-1$ //$NON-NLS-2$
+ mandatory = XModelObjectConstants.YES.equals(el.getAttribute("Mandatory")); //$NON-NLS-1$
Element[] cs = XMetaDataLoader.getChildrenElements(el, "AttributeData"); //$NON-NLS-1$
attributes = new XAttributeDataImpl[cs.length];
for (int i = 0; i < cs.length; i++) {
@@ -66,12 +66,12 @@
public static XEntityDataImpl create(String[][] data) {
XEntityDataImpl impl = new XEntityDataImpl();
impl.entityname = data[0][0];
- impl.mandatory = data[0].length > 1 && XModelObjectConstants.YES.equals(data[0][1]); //$NON-NLS-1$
+ impl.mandatory = data[0].length > 1 && XModelObjectConstants.YES.equals(data[0][1]);
impl.attributes = new XAttributeDataImpl[data.length - 1];
for (int i = 0; i < impl.attributes.length; i++) {
impl.attributes[i] = XAttributeDataImpl.create(impl.entityname,
data[i + 1][0],
- (data[i + 1].length > 1 && XModelObjectConstants.YES.equals(data[i + 1][1]))); //$NON-NLS-1$
+ (data[i + 1].length > 1 && XModelObjectConstants.YES.equals(data[i + 1][1])));
}
return impl;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.action.impl.*;
import org.jboss.tools.common.model.XModelException;
@@ -33,7 +34,7 @@
for (int i = 0; i < as.length; i++) {
attributes.add(as[i][0]);
}
- edit = XModelObjectConstants.TRUE.equals(action.getProperty("edit"));
+ edit = XModelObjectConstants.TRUE.equals(action.getProperty("edit")); //$NON-NLS-1$
initialName = getProperties().getProperty(XModelObjectConstants.ATTR_NAME);
initialValue = null;
if(initialName != null) {
@@ -41,7 +42,7 @@
for (int i = 0; i < as.length; i++) {
if(initialName.equals(as[i][0])) initialValue = as[i][1];
}
- if(initialValue != null) setAttributeValue(0, "value", initialValue);
+ if(initialValue != null) setAttributeValue(0, "value", initialValue); //$NON-NLS-1$
}
}
@@ -59,12 +60,12 @@
protected void finish() throws XModelException {
Properties p = extractStepData(0);
String name = p.getProperty(XModelObjectConstants.ATTR_NAME);
- String value = p.getProperty("value");
- String as = "";
+ String value = p.getProperty("value"); //$NON-NLS-1$
+ String as = ""; //$NON-NLS-1$
if(!edit) {
- as = getTarget().getAttributeValue("attributes");
+ as = getTarget().getAttributeValue("attributes"); //$NON-NLS-1$
if(as.length() > 0) as += AnyElementObjectImpl.SEPARATOR;
- as += name + "=" + value;
+ as += name + "=" + value; //$NON-NLS-1$
} else {
String[][] attrs = ((AnyElementObjectImpl)getTarget()).getAttributes();
StringBuffer sb = new StringBuffer();
@@ -75,7 +76,7 @@
}
as = sb.toString();
}
- getTarget().getModel().editObjectAttribute(getTarget(), "attributes", as);
+ getTarget().getModel().editObjectAttribute(getTarget(), "attributes", as); //$NON-NLS-1$
}
protected DefaultWizardDataValidator validator = new Validator();
@@ -91,11 +92,11 @@
if(message != null) return;
String name = data.getProperty(XModelObjectConstants.ATTR_NAME);
if(!edit && attributes.contains(name)) {
- message = "Attribute " + name + " already exists.";
+ message = MessageFormat.format("Attribute {0} already exists.", name);
}
if(message != null) return;
if(edit && initialValue != null && name.equals(initialName)) {
- if(initialValue.equals(data.getProperty("value"))) {
+ if(initialValue.equals(data.getProperty("value"))) { //$NON-NLS-1$
message = "Please set new value.";
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenCopyHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenCopyHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenCopyHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
XModelObject[] cs = object.getChildren();
- XActionInvoker.invoke("CopyActions.Copy", cs[0], cs, p);
+ XActionInvoker.invoke("CopyActions.Copy", cs[0], cs, p); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenDeleteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenDeleteHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ChildrenDeleteHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
XModelObject[] cs = object.getChildren();
- XActionInvoker.invoke("DeleteActions.Delete", cs[0], cs, p);
+ XActionInvoker.invoke("DeleteActions.Delete", cs[0], cs, p); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CopyHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CopyHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CopyHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -24,7 +24,7 @@
static Transfer modelTransfer;
static {
- modelTransfer = (Transfer)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.dnd.ModelTransfer");
+ modelTransfer = (Transfer)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.dnd.ModelTransfer"); //$NON-NLS-1$
}
public CopyHandler() {}
@@ -32,7 +32,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
object.getModel().getModelBuffer().clear();
object.getModel().getModelBuffer().addSource(object);
- if(p == null || !XModelObjectConstants.TRUE.equals(p.getProperty("isDrag"))) {
+ if(p == null || !XModelObjectConstants.TRUE.equals(p.getProperty("isDrag"))) { //$NON-NLS-1$
setClipboard(object.getModel());
}
}
@@ -50,7 +50,7 @@
XModelBuffer buffer = object.getModel().getModelBuffer();
buffer.clear();
for (int i = 0; i < objects.length; i++) buffer.addSource(objects[i]);
- if(p == null || !XModelObjectConstants.TRUE.equals(p.getProperty("isDrag"))) {
+ if(p == null || !XModelObjectConstants.TRUE.equals(p.getProperty("isDrag"))) { //$NON-NLS-1$
setClipboard(object.getModel());
}
}
@@ -75,7 +75,7 @@
if(resource instanceof IFile) {
files.add(resource.getLocation().toOSString());
}
- paths.add("" + o.getPath());
+ paths.add("" + o.getPath()); //$NON-NLS-1$
}
Clipboard c = new Clipboard(Display.getCurrent());
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CreateIconHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CreateIconHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CreateIconHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -24,9 +24,9 @@
XEntityData[] es = (XEntityData[])data;
String entity = es[0].getModelEntity().getName();
Properties p = extractProperties(es[0]);
- String fn = p.getProperty("path");
+ String fn = p.getProperty("path"); //$NON-NLS-1$
String im = new XStudioIcons().getImageString(fn);
- p.setProperty("image", im);
+ p.setProperty("image", im); //$NON-NLS-1$
XModelObject icon = object.getModel().createModelObject(entity, p);
addCreatedObject(object, icon, p);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CutHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CutHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CutHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -24,8 +24,8 @@
private void load(XModelObject object) {
if(copy != null || object == null) return;
- copy = object.getModelEntity().getActionList().getAction("CopyActions.Copy");
- delete = object.getModelEntity().getActionList().getAction("DeleteActions.Delete");
+ copy = object.getModelEntity().getActionList().getAction("CopyActions.Copy"); //$NON-NLS-1$
+ delete = object.getModelEntity().getActionList().getAction("DeleteActions.Delete"); //$NON-NLS-1$
isDefault = (copy == null || delete == null);
if(copy == null) copy = new CopyHandler();
if(delete == null) delete = new DefaultRemoveHandler();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.Properties;
import org.eclipse.osgi.util.NLS;
@@ -47,12 +48,12 @@
c = modifyCreatedObject(c);
addCreatedObject(object, c, prop);
checkPosition(object, c, prop);
- if(prop != null) prop.put("created", c);
+ if(prop != null) prop.put("created", c); //$NON-NLS-1$
}
private void checkPosition(XModelObject o, XModelObject c, Properties prop) {
- if(prop == null || !(prop.get("insertAfter") instanceof Integer)) return;
- int i = ((Integer)prop.get("insertAfter")).intValue();
+ if(prop == null || !(prop.get("insertAfter") instanceof Integer)) return; //$NON-NLS-1$
+ int i = ((Integer)prop.get("insertAfter")).intValue(); //$NON-NLS-1$
if(i < 0) return;
++i;
RegularObjectImpl impl = (RegularObjectImpl)o;
@@ -85,7 +86,7 @@
XAttribute a = ad.getAttribute();
String pn = a.getName();
String pv = ad.getValue();
- if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim();
+ if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim(); //$NON-NLS-1$
if((pv == null || pv.length() == 0) && ad.getMandatoryFlag())
throw new RuntimeException(getReguiredMessage(pn));
XAttributeConstraint c = ad.getAttribute().getConstraint();
@@ -104,8 +105,8 @@
XAttribute a = ads[i].getAttribute();
String pn = a.getName();
String pv = ads[i].getValue();
- if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim();
- if(pv == null) pv = "";
+ if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim(); //$NON-NLS-1$
+ if(pv == null) pv = ""; //$NON-NLS-1$
p.setProperty(pn, pv);
}
return p;
@@ -114,7 +115,7 @@
public static String validateAttribute(XAttributeData ad, String pv) {
XAttribute a = ad.getAttribute();
String vis = WizardKeys.getAttributeDisplayName(ad, true);
- if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim();
+ if(a.isTrimmable()) pv = (pv == null) ? "" : pv.trim(); //$NON-NLS-1$
if((pv == null || pv.length() == 0) && ad.getMandatoryFlag()) {
return NLS.bind(ModelMessages.ATTRIBUTE_REQUIRED, new Object[]{vis});
}
@@ -151,14 +152,14 @@
XModelObject e = parent.getChildByPath(pathpart);
if(e != null && e != parent && e != parent.getParent()) {
if(child.getModelEntity().getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null) {
- if(!forceUnique || !XModelObjectConstants.TRUE.equals(child.getModelEntity().getProperty("unique"))) {
+ if(!forceUnique || !XModelObjectConstants.TRUE.equals(child.getModelEntity().getProperty("unique"))) { //$NON-NLS-1$
return null;
}
}
String tp = title(parent, true), tc = title(child, false), te = title(e, false);
String mes = (tc.equals(te))
? NLS.bind(ModelMessages.CONTAINS_OBJECT_1, new Object[]{tp, tc})
- : NLS.bind(ModelMessages.CONTAINS_OBJECT_2, new Object[]{tp, te, "\n", tc});
+ : NLS.bind(ModelMessages.CONTAINS_OBJECT_2, new Object[]{tp, te, "\n", tc}); //$NON-NLS-1$
return mes;
}
return null;
@@ -183,10 +184,11 @@
int cur = parent.getChildren(ce).length;
if(cur >= max) {
ServiceDialog d = parent.getModel().getService();
- d.showDialog(ModelMessages.WARNING, "The limit of " + max + " children is achieved.", new String[]{"OK"}, null, ServiceDialog.MESSAGE);
- mes = title(parent, true) + " can contain only " + max +
- ((max == 1) ? " child " : " children ") +
- "with entity " + ce + ".";
+ d.showDialog(ModelMessages.WARNING, MessageFormat.format("The limit of {0} children is achieved.",
+ max), new String[]{"OK"}, null, ServiceDialog.MESSAGE);
+ // i18n: assumes germanic plurals
+ mes = MessageFormat.format("{0} can contain only {1}{2}with entity {3}.",
+ title(parent, true), max, ((max == 1) ? " child " : " children "), ce);
throw new ActionDeclinedException(mes);
}
boolean b = parent.addChild(child);
@@ -194,7 +196,7 @@
int k = 1;
String pp = child.getPathPart();
while(parent.getChildByPath(pp) != null) {
- child.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + k);
+ child.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + k); //$NON-NLS-1$
String ppn = child.getPathPart();
if(ppn.equals(pp)) throw new RuntimeException(ModelMessages.OBJECT_ADDING_FAILURE);
pp = ppn;
@@ -229,7 +231,7 @@
public static String title(XModelObject o, boolean capitalize) {
String elementType = o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE);
String objectTitle = o.getModelEntity().getRenderer().getTitle(o);
- String s = elementType + " " + objectTitle;
+ String s = elementType + " " + objectTitle; //$NON-NLS-1$
if(objectTitle != null && objectTitle.equalsIgnoreCase(elementType)) {
s = objectTitle;
}
@@ -239,10 +241,10 @@
public static int extractWhereSelect(Properties p) {
if(p == null) return FindObjectHelper.EVERY_WHERE;
- String component = p.getProperty("actionSourceGUIComponentID");
- if("navigator".equals(component)) return FindObjectHelper.IN_NAVIGATOR_AND_IN_EDITOR_IF_OPEN;
- if("editor".equals(component)) return FindObjectHelper.IN_EDITOR_ONLY;
- if("dialog".equals(component)) return FindObjectHelper.IN_NAVIGATOR_ONLY;
+ String component = p.getProperty("actionSourceGUIComponentID"); //$NON-NLS-1$
+ if("navigator".equals(component)) return FindObjectHelper.IN_NAVIGATOR_AND_IN_EDITOR_IF_OPEN; //$NON-NLS-1$
+ if("editor".equals(component)) return FindObjectHelper.IN_EDITOR_ONLY; //$NON-NLS-1$
+ if("dialog".equals(component)) return FindObjectHelper.IN_NAVIGATOR_ONLY; //$NON-NLS-1$
return FindObjectHelper.EVERY_WHERE;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.Properties;
import org.jboss.tools.common.meta.*;
import org.jboss.tools.common.meta.action.impl.*;
@@ -36,7 +37,8 @@
int limit = c.getMaxCount();
if(c != null && limit < Integer.MAX_VALUE && cs.length >= limit) {
ServiceDialog d = getTarget().getModel().getService();
- d.showDialog(ModelMessages.WARNING, "The limit of " + limit + " children is achieved.", new String[]{OK}, null, ServiceDialog.MESSAGE);
+ d.showDialog(ModelMessages.WARNING, MessageFormat.format("The limit of {0} children is achieved.",
+ limit), new String[]{OK}, null, ServiceDialog.MESSAGE);
setFinished(true);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultEditHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultEditHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultEditHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.*;
import org.jboss.tools.common.model.*;
@@ -35,7 +36,7 @@
String n = ad[i].getAttribute().getName();
String v = object.getAttributeValue(n);
if(v != null) ad[i].setValue(v);
- v = action.getProperty("attribute." + n);
+ v = action.getProperty("attribute." + n); //$NON-NLS-1$
if(v != null) ad[i].setValue(v);
}
}
@@ -48,7 +49,7 @@
return;
}
XUndoManager undo = object.getModel().getUndoManager();
- XTransactionUndo u = new XTransactionUndo("Edit " + DefaultCreateHandler.title(object, false), XTransactionUndo.EDIT);
+ XTransactionUndo u = new XTransactionUndo(MessageFormat.format("Edit {0}", DefaultCreateHandler.title(object, false)), XTransactionUndo.EDIT);
undo.addUndoable(u);
long stamp = object.getTimeStamp();
try {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultOpenHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultOpenHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultOpenHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
public DefaultOpenHandler() {}
public boolean isEnabled(XModelObject object) {
- boolean abs = "abstract".equals(object.getAttributeValue("override"));
+ boolean abs = "abstract".equals(object.getAttributeValue("override")); //$NON-NLS-1$ //$NON-NLS-2$
return !abs;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -28,14 +28,14 @@
}
protected XModelObject getTrueSource(XModelObject source) {
- String path = action.getProperty("sourcepath");
+ String path = action.getProperty("sourcepath"); //$NON-NLS-1$
return (path == null) ? null : source.getChildByPath(path);
}
protected XAction getTrueAction(XModelObject source) {
XModelObject ts = getTrueSource(source);
if (ts == null) return null;
- String apath = action.getProperty("actionpath");
+ String apath = action.getProperty("actionpath"); //$NON-NLS-1$
if(apath == null) return null;
StringTokenizer st = new StringTokenizer(apath, XModelObjectConstants.SEPARATOR);
XActionItem l = ts.getModelEntity().getActionList();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRemoveHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRemoveHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRemoveHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -34,7 +34,7 @@
public boolean isEnabled(XModelObject object) {
if(object == null || !object.isObjectEditable()) return false;
- if(XModelObjectConstants.YES.equals(object.getAttributeValue("issystem"))) return false;
+ if(XModelObjectConstants.YES.equals(object.getAttributeValue("issystem"))) return false; //$NON-NLS-1$
if(object.getParent() == null) return false;
if(isUniqueRequiredChild(object)) return isUniqueRequiredChildSet(object);
return true;
@@ -68,7 +68,7 @@
if(xml == null || xml.length() == 0) continue;
String n = as[i].getName();
String dv = as[i].getDefaultValue();
- if(dv == null) dv = "";
+ if(dv == null) dv = ""; //$NON-NLS-1$
String v = object.getAttributeValue(n);
if(!dv.equals(v)) return true;
}
@@ -86,7 +86,7 @@
if(xml == null || xml.length() == 0) continue;
String n = as[i].getName();
String v = as[i].getDefaultValue();
- if(v == null) v = "";
+ if(v == null) v = ""; //$NON-NLS-1$
object.getModel().changeObjectAttribute(object, n, v);
}
XModelObject[] cs = object.getChildren();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.meta.action.impl.*;
@@ -49,9 +50,9 @@
}
public String getTitle() {
- String title = getProperties().getProperty("title");
+ String title = getProperties().getProperty("title"); //$NON-NLS-1$
if(title != null) return title;
- return "Rename " + PasteEnterNewNameSupport.getCapitalizedName(getTarget());
+ return MessageFormat.format("Rename {0}", PasteEnterNewNameSupport.getCapitalizedName(getTarget()));
}
public String getSubtitle() {
@@ -64,7 +65,7 @@
public String getMessage(int stepId) {
String displayName = WizardKeys.getAttributeDisplayName(getEntityData()[0].getAttributeData()[0].getAttribute(), true);
- return "Please enter new " + displayName + ".";
+ return MessageFormat.format("Please enter new {0}.", displayName);
}
public String[] getActionNames(int stepId) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultSpecialHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultSpecialHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultSpecialHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -30,7 +30,7 @@
try {
return (SpecialWizardSupport)ModelFeatureFactory.getInstance().createFeatureInstance(id);
} catch (ClassCastException e) {
- ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load special wizard support " + id + ".",e));
+ ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load special wizard support " + id + ".",e)); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
}
@@ -38,8 +38,8 @@
private void validate() {
if(validated) return;
validated = true;
- wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizards.special.DefaultSpecialWizard");
- support = createSpecialWizardSupport(action.getProperty("support"));
+ wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizards.special.DefaultSpecialWizard"); //$NON-NLS-1$
+ support = createSpecialWizardSupport(action.getProperty("support")); //$NON-NLS-1$
if(support != null) support.setAction(action);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenObjectEditorHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenObjectEditorHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenObjectEditorHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,7 +20,7 @@
*
*/
public class OpenObjectEditorHandler extends AbstractHandler {
- private static String wizardname = "XXX";
+ private static String wizardname = "XXX"; //$NON-NLS-1$
protected static SpecialWizard wizard = null;
public OpenObjectEditorHandler() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithChoiceHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithChoiceHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithChoiceHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -35,7 +35,7 @@
ServiceDialog d = object.getModel().getService();
String ext = OpenWithHelper.getLogicalExtension(object, action);
XAttributeData a1 = HUtil.find(data, 0, XModelObjectConstants.ATTR_NAME);
- XAttributeData a2 = HUtil.find(data, 0, "default");
+ XAttributeData a2 = HUtil.find(data, 0, "default"); //$NON-NLS-1$
XModelObject o = OpenWithHelper.getEditorObject(object.getModel(), ext);
String oldname = null;
if(o != null) {
@@ -49,7 +49,7 @@
if(i != 0) return;
DefaultCreateHandler.extractProperties(data[0]);
String en = HUtil.getValue(data, 0, XModelObjectConstants.ATTR_NAME);
- boolean def = XModelObjectConstants.YES.equals(HUtil.getValue(data, 0, "default"));
+ boolean def = XModelObjectConstants.YES.equals(HUtil.getValue(data, 0, "default")); //$NON-NLS-1$
if(def && !en.equals(oldname)) {
changeDefaultEditor(object.getModel(), ext, en);
} else if(!def && en.equals(oldname)) {
@@ -69,28 +69,28 @@
static void changeDefaultEditor(XModel model, String ext, String editor) throws XModelException {
XModelObject o = model.getByPath(OpenWithHelper.EDITORS);
StringBuffer sb = new StringBuffer();
- String ov = o.getAttributeValue("extensions");
+ String ov = o.getAttributeValue("extensions"); //$NON-NLS-1$
String[] es = XModelObjectUtil.asStringArray(ov);
boolean done = false;
for (int i = 0; i < es.length; i++) {
- if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) {
+ if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) { //$NON-NLS-1$
append(sb, es[i]);
} else {
done = true;
- append(sb, ext + ":" + editor);
+ append(sb, ext + ":" + editor); //$NON-NLS-1$
}
}
- if(!done) append(sb, ext + ":" + editor);
+ if(!done) append(sb, ext + ":" + editor); //$NON-NLS-1$
applyChange(o, ov, sb.toString());
}
static void removeDefaultEditor(XModel model, String ext) throws XModelException {
XModelObject o = model.getByPath(OpenWithHelper.EDITORS);
StringBuffer sb = new StringBuffer();
- String ov = o.getAttributeValue("extensions");
+ String ov = o.getAttributeValue("extensions"); //$NON-NLS-1$
String[] es = XModelObjectUtil.asStringArray(ov);
for (int i = 0; i < es.length; i++) {
- if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) {
+ if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) { //$NON-NLS-1$
append(sb, es[i]);
}
}
@@ -104,7 +104,7 @@
private static void applyChange(XModelObject editors, String ov, String nv) throws XModelException {
if(nv.equals(ov)) return;
- editors.getModel().changeObjectAttribute(editors, "extensions", nv);
+ editors.getModel().changeObjectAttribute(editors, "extensions", nv); //$NON-NLS-1$
editors.getModel().saveOptions();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,6 +12,7 @@
import java.io.*;
import java.net.MalformedURLException;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.action.impl.*;
import org.jboss.tools.common.meta.key.WizardKeys;
@@ -31,7 +32,7 @@
if(object == null || object.getFileType() != XFileObject.FILE) return false;
String s = getEditorName(object);
boolean b = (s != null);
- if(!b) s = "?";
+ if(!b) s = "?"; //$NON-NLS-1$
((XActionImpl)action).setDisplayName(s);
return b;
}
@@ -43,15 +44,17 @@
String f = getFileName(object);
String ext = OpenWithHelper.getLogicalExtension(object, action);
XModelObject editor = OpenWithHelper.getEditorObject(object.getModel(), ext);
- if(editor == null) throw new RuntimeException("External editor for file extension '" + ext + "' is not set.");
+ if(editor == null) throw new RuntimeException("External editor for file extension '" + ext + "' is not set."); //$NON-NLS-1$ //$NON-NLS-2$
start(displayName, f, editor);
}
static boolean checkSave(String actionname, XModelObject object) throws XModelException {
if(!object.isModified() || !object.isActive() || !(object.getParent() instanceof FolderImpl)) return true;
ServiceDialog d = object.getModel().getService();
- String mes = DefaultCreateHandler.title(object, true) + " is modified.\n" +
- "Do you want to save it on disk before launching the external program?";
+ String mes = MessageFormat
+ .format(
+ "{0} is modified.\nDo you want to save it on disk before launching the external program?",
+ DefaultCreateHandler.title(object, true));
int i = d.showDialog(actionname, mes, new String[]{ModelMessages.Yes, ModelMessages.No, ModelMessages.Cancel}, null, ServiceDialog.QUESTION);
if(i == 0) {
((FolderImpl)object.getParent()).saveChild(object);
@@ -66,9 +69,9 @@
private String getEditorName(XModelObject object) {
String ext = OpenWithHelper.getLogicalExtension(object, action);
XModelObject o = object.getModel().getByPath(OpenWithHelper.EDITORS);
- String[] es = XModelObjectUtil.asStringArray(o.getAttributeValue("extensions"));
+ String[] es = XModelObjectUtil.asStringArray(o.getAttributeValue("extensions")); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) {
- if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) continue;
+ if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) continue; //$NON-NLS-1$
return es[i].substring(ext.length() + 1);
}
return null;
@@ -77,14 +80,14 @@
public static void start(String actionname, String filename, XModelObject editor) throws XModelException {
int i = filename.indexOf('#');
String fn = (i < 0) ? filename : filename.substring(0, i);
- if(!new File(fn).isFile()) throw new IllegalArgumentException("Cannot find file " + fn + ".");
+ if(!new File(fn).isFile()) throw new IllegalArgumentException("Cannot find file " + fn + "."); //$NON-NLS-1$ //$NON-NLS-2$
if(OpenWithHelper.validatePath(actionname, editor)) new OWEProcess(editor, filename).start();
}
public static void startExplorer(XModel model, String url) throws XModelException {
- XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser");
+ XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser"); //$NON-NLS-1$
if(editor == null) throw new XModelException("External Program 'Internet Browser' is not set in Options.");
- if(OpenWithHelper.validatePath("Open", editor)) new OWEProcess(editor, url, true).start();
+ if(OpenWithHelper.validatePath("Open", editor)) new OWEProcess(editor, url, true).start(); //$NON-NLS-1$
}
}
@@ -105,7 +108,7 @@
}
protected String getRoot() {
- return ".";
+ return "."; //$NON-NLS-1$
}
protected void write(String s) {
@@ -113,12 +116,12 @@
}
protected void buildCommandLine(ArrayList<String> l) {
- String program = o.getAttributeValue("path");
+ String program = o.getAttributeValue("path"); //$NON-NLS-1$
l.add(program);
- if("Internet Browser".equals(o.getAttributeValue(XModelObjectConstants.ATTR_NAME)) && !isUrl) {
+ if("Internet Browser".equals(o.getAttributeValue(XModelObjectConstants.ATTR_NAME)) && !isUrl) { //$NON-NLS-1$
try {
java.net.URL u = new File(file).toURL();
- file = u.getProtocol() + "://" + u.getFile();
+ file = u.getProtocol() + "://" + u.getFile(); //$NON-NLS-1$
} catch (MalformedURLException e) {
ModelPlugin.getPluginLog().logError(e);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.meta.action.impl.handlers;
import java.io.File;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.meta.action.*;
@@ -21,7 +22,7 @@
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
public class OpenWithHelper {
- static String EDITORS = "%Options%/External Programs";
+ static String EDITORS = "%Options%/External Programs"; //$NON-NLS-1$
static String getFileName(XModelObject object) {
ArrayList<String> l = new ArrayList<String>();
@@ -50,9 +51,9 @@
static XModelObject getEditorObject(XModel model, String ext) {
XModelObject o = model.getByPath(EDITORS);
- String[] es = XModelObjectUtil.asStringArray(o.getAttributeValue("extensions"));
+ String[] es = XModelObjectUtil.asStringArray(o.getAttributeValue("extensions")); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) {
- if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) continue;
+ if(!es[i].toLowerCase().startsWith(ext.toLowerCase() + ":")) continue; //$NON-NLS-1$
return o.getChildByPath(es[i].substring(ext.length() + 1));
}
return null;
@@ -70,9 +71,9 @@
String[] paths = getEnvironmentPaths();
XModel model = o.getModel();
String en = o.getModelEntity().getName();
- XEntityData[] dt = new XEntityData[]{XEntityDataImpl.create(new String[][]{{en, XModelObjectConstants.YES}, {"path", XModelObjectConstants.YES}})};
- String path = o.getAttributeValue("path").replace('\\','/');
- XAttributeData ad = HUtil.find(dt, 0, "path");
+ XEntityData[] dt = new XEntityData[]{XEntityDataImpl.create(new String[][]{{en, XModelObjectConstants.YES}, {"path", XModelObjectConstants.YES}})}; //$NON-NLS-1$
+ String path = o.getAttributeValue("path").replace('\\','/'); //$NON-NLS-1$
+ XAttributeData ad = HUtil.find(dt, 0, "path"); //$NON-NLS-1$
ad.setValue(path);
ServiceDialog d = model.getService();
while(true) {
@@ -80,12 +81,12 @@
if(b != null && b.length() > 0)
if(fileExists(b, paths)) {
if(!b.equals(path)) {
- model.changeObjectAttribute(o, "path", b);
+ model.changeObjectAttribute(o, "path", b); //$NON-NLS-1$
model.saveOptions();
}
return true;
}
- int i = d.showDialog(actionname, "Enter valid path for " + o.getPresentationString(),
+ int i = d.showDialog(actionname, MessageFormat.format("Enter valid path for {0}", o.getPresentationString()),
new String[]{ModelMessages.OK, ModelMessages.Cancel}, dt[0], ServiceDialog.QUESTION);
if(i != 0) return false;
}
@@ -102,7 +103,7 @@
}
static String[] getEnvironmentPaths() {
- String jlp = OSHelper.getProperty("PATH", "");
+ String jlp = OSHelper.getProperty("PATH", ""); //$NON-NLS-1$ //$NON-NLS-2$
StringTokenizer st = new StringTokenizer(jlp, File.pathSeparator);
String[] ps = new String[st.countTokens()];
for (int i = 0; i < ps.length; i++) ps[i] = st.nextToken();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteEnterNewNameSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteEnterNewNameSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteEnterNewNameSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.meta.action.impl.*;
@@ -21,8 +22,8 @@
public static int run(XModelObject parent, XModelObject source, XModelObject copy, XEntityData data) {
PasteEnterNewNameSupport support = new PasteEnterNewNameSupport();
Properties p = new Properties();
- p.put("source", source);
- p.put("copy", copy);
+ p.put("source", source); //$NON-NLS-1$
+ p.put("copy", copy); //$NON-NLS-1$
support.setActionData(null, new XEntityData[]{data}, parent, p);
parent.getModel().getService().showDialog(support);
return support.getReturnCode();
@@ -33,17 +34,16 @@
public void reset() {
returnCode = -1;
- source = (XModelObject)getProperties().get("source");
- copy = (XModelObject)getProperties().get("copy");
+ source = (XModelObject)getProperties().get("source"); //$NON-NLS-1$
+ copy = (XModelObject)getProperties().get("copy"); //$NON-NLS-1$
}
public String getTitle() {
- return "Paste " + getCapitalizedName(copy) + " to "
- + getCapitalizedName(getTarget());
+ return MessageFormat.format("Paste {0} to {1}", getCapitalizedName(copy), getCapitalizedName(getTarget()));
}
public String getSubtitle() {
- return "" + getCapitalizedName(copy);
+ return "" + getCapitalizedName(copy); //$NON-NLS-1$
}
static String getCapitalizedName(XModelObject o) {
@@ -55,7 +55,7 @@
public String getMessage(int stepId) {
String displayName = WizardKeys.getAttributeDisplayName(getEntityData()[0].getAttributeData()[0].getAttribute(), true);
- return "Please enter new " + displayName + ".";
+ return MessageFormat.format("Please enter new {0}.", displayName);
}
public String[] getActionNames(int stepId) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Properties;
@@ -41,15 +42,15 @@
* subsequent objects, wizard should set this context property
* to 'true'.
*/
- public static String IS_CANCELLED = "isCancelled";
+ public static String IS_CANCELLED = "isCancelled"; //$NON-NLS-1$
public PasteHandler() {
data = new XEntityDataImpl[1];
}
- private static String[] attrs = {"attribute name", XModelObjectConstants.YES,
- "entity name", XModelObjectConstants.YES,
- "parameters", XModelObjectConstants.NO};
+ private static String[] attrs = {"attribute name", XModelObjectConstants.YES, //$NON-NLS-1$
+ "entity name", XModelObjectConstants.YES, //$NON-NLS-1$
+ "parameters", XModelObjectConstants.NO}; //$NON-NLS-1$
public XEntityData[] getEntityData(XModelObject object) {
return getEntityData(object, 0);
@@ -76,7 +77,7 @@
public void executeHandler(XModelObject object, Properties prop) throws XModelException {
if(!isEnabled(object)) return;
- boolean isDrop = (prop != null) && XModelObjectConstants.TRUE.equals(prop.getProperty("isDrop"));
+ boolean isDrop = (prop != null) && XModelObjectConstants.TRUE.equals(prop.getProperty("isDrop")); //$NON-NLS-1$
int bs = object.getModel().getModelBuffer().getSize();
for (int i = 0; i < bs; i++) {
execute(object, i, isDrop, prop);
@@ -140,9 +141,8 @@
if(sourceIndex == 0) showUniqueMessae(parent, source);
return false;
}
- String message = "Replace existing element ";
- String n = "<" + co.getModelEntity().getXMLSubPath() + ">";
- message += n + "?";
+ String n = "<" + co.getModelEntity().getXMLSubPath() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+ String message = MessageFormat.format("Replace existing element {0}?", n);
ServiceDialog d = parent.getModel().getService();
int q = d.showDialog("Paste", message, new String[]{ModelMessages.OK, ModelMessages.Cancel}, null, ServiceDialog.QUESTION);
if(q != 0) return false;
@@ -151,9 +151,9 @@
}
private void showUniqueMessae(XModelObject parent, XModelObject source) {
ServiceDialog d = parent.getModel().getService();
- String message = DefaultCreateHandler.title(parent, true) +
- " may have only one " + source.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + "." +
- " You cannot add its copy.";
+ String message = MessageFormat.format(
+ "{0} may have only one {1}. You cannot add its copy.",
+ DefaultCreateHandler.title(parent, true), source.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE));
d.showDialog(ModelMessages.WARNING, message, new String[]{SpecialWizardSupport.OK}, null, ServiceDialog.WARNING);
}
@@ -205,7 +205,7 @@
if(e.getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null) return XModelObjectLoaderUtil.ATTR_ID_NAME;
XAttribute[] as = e.getAttributes();
for (int i = 0; i < as.length; i++)
- if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id"))) return as[i].getName();
+ if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id"))) return as[i].getName(); //$NON-NLS-1$
if(e.getAttribute(XModelObjectConstants.ATTR_NAME) != null) return XModelObjectConstants.ATTR_NAME;
return null;
}
@@ -215,8 +215,8 @@
if(e.getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null) return true;
XAttribute[] as = e.getAttributes();
for (int i = 0; i < as.length; i++)
- if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id")) &&
- XModelObjectConstants.TRUE.equals(as[i].getProperty("generate"))) return true;
+ if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id")) && //$NON-NLS-1$
+ XModelObjectConstants.TRUE.equals(as[i].getProperty("generate"))) return true; //$NON-NLS-1$
return false;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PropertiesHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PropertiesHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PropertiesHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
public class PropertiesHandler extends AbstractHandler {
- private static String wizardname = "org.jboss.tools.common.model.ui.objecteditor.PropertiesWizard";
+ private static String wizardname = "org.jboss.tools.common.model.ui.objecteditor.PropertiesWizard"; //$NON-NLS-1$
public PropertiesHandler() {}
@@ -27,9 +27,9 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
- String viewMode = action.getProperty("viewMode");
+ String viewMode = action.getProperty("viewMode"); //$NON-NLS-1$
p = HelpUtil.createKey(object, action, p);
- if(viewMode != null) p.put("viewMode", viewMode);
+ if(viewMode != null) p.put("viewMode", viewMode); //$NON-NLS-1$
SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard(wizardname);
wizard.setObject(new Object[]{object, p});
wizard.execute();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceSignificanceMessageImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceSignificanceMessageImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceSignificanceMessageImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,16 +10,16 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
+import java.text.MessageFormat;
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.model.XModelObject;
public class ReplaceSignificanceMessageImpl implements SignificanceMessage {
public String getMessage(XAction action, XModelObject object, XModelObject[] objects) {
- String message = "Replace existing element ";
XModelObject child = ReplaceWithNewHandler.findExistingChild(object, action);
- String n = (child == null) ? "<>" : "<" + child.getModelEntity().getXMLSubPath() + ">";
- message += n;
+ String n = (child == null) ? "<>" : "<" + child.getModelEntity().getXMLSubPath() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String message = MessageFormat.format("Replace existing element {0}", n);
return message;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceWithNewHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceWithNewHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReplaceWithNewHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -45,12 +45,12 @@
public static XModelObject findExistingChild(XModelObject object, XAction action) {
XModelObject child = null;
- String childEntity = action.getProperty("childEntity");
+ String childEntity = action.getProperty("childEntity"); //$NON-NLS-1$
if(childEntity != null) {
XModelObject[] os = object.getChildren(childEntity);
if(os.length > 0) child = os[0];
} else {
- String childName = action.getProperty("child");
+ String childName = action.getProperty("child"); //$NON-NLS-1$
child = object.getChildByPath(childName);
}
return child;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SaveAllHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SaveAllHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SaveAllHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
public class SaveAllHandler extends AbstractHandler {
- SpecialWizard saveEditors = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveEditorsSpecialWizard");
+ SpecialWizard saveEditors = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveEditorsSpecialWizard"); //$NON-NLS-1$
public SaveAllHandler() {}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ShowMenuHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ShowMenuHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ShowMenuHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
import org.jboss.tools.common.model.XModelObject;
public class ShowMenuHandler extends AbstractHandler {
- SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.action.XMenuInvokerWizard");
+ SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.action.XMenuInvokerWizard"); //$NON-NLS-1$
public boolean isEnabled(XModelObject object) {
return wizard != null;
@@ -27,14 +27,14 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
XActionList list = getActionList(object);
if(list == null) return;
- p.put("object", object);
- p.put("actionList", list);
+ p.put("object", object); //$NON-NLS-1$
+ p.put("actionList", list); //$NON-NLS-1$
wizard.setObject(p);
wizard.execute();
}
XActionList getActionList(XModelObject object) {
- String listName = action.getProperty("actionList");
+ String listName = action.getProperty("actionList"); //$NON-NLS-1$
if(listName != null) {
XActionList l = object.getModelEntity().getActionList();
if(!(l instanceof XActionListImpl)) return (XActionList)l.getItem(listName);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SortByNameHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SortByNameHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/SortByNameHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
if(!isEnabled(object)) return;
OrderedObjectImpl ordered = (OrderedObjectImpl)object;
NameComparator c = new NameComparator();
- c.attribute = action.getProperty("attribute");
+ c.attribute = action.getProperty("attribute"); //$NON-NLS-1$
ordered.sort(c);
ordered.setModified(true);
}
@@ -37,8 +37,8 @@
if(attribute == null) return 0;
String s1 = o1.getAttributeValue(attribute);
String s2 = o2.getAttributeValue(attribute);
- s1 = (s1 == null) ? "" : s1.toLowerCase();
- s2 = (s2 == null) ? "" : s2.toLowerCase();
+ s1 = (s1 == null) ? "" : s1.toLowerCase(); //$NON-NLS-1$
+ s2 = (s2 == null) ? "" : s2.toLowerCase(); //$NON-NLS-1$
return s1.compareTo(s2);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ViewAgentHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ViewAgentHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ViewAgentHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
//TODO check if this class is still needed
public abstract class ViewAgentHandler extends AbstractHandler {
- static String wizardname = "XXX.XActionSilentAgentWizard";
+ static String wizardname = "XXX.XActionSilentAgentWizard"; //$NON-NLS-1$
static SpecialWizard wizard = null;
static SpecialWizard wizard() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/XAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/XAdapter.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/XAdapter.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public class XAdapter extends XMetaElementImpl {
protected XAttributeConstraint constraint = null;
protected boolean visibility = true;
- protected String defaultvalue = "";
+ protected String defaultvalue = ""; //$NON-NLS-1$
public XAdapter() {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFolderName.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFolderName.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFolderName.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.jboss.tools.common.meta.constraint.impl;
+import java.text.MessageFormat;
+
public class XAttributeConstraintFolderName extends XAttributeConstraintImpl {
- private static String forbid = "\\/:*\"";
+ private static String forbid = "\\/:*\""; //$NON-NLS-1$
public XAttributeConstraintFolderName() {}
@@ -20,8 +22,8 @@
int l = value.length();
for (int i = 0; i < l; i++)
if(forbid.indexOf(value.charAt(i)) >= 0) return false;
- if(value.startsWith(".")) {
- return !value.equals(".") && !value.equals("..");
+ if(value.startsWith(".")) { //$NON-NLS-1$
+ return !value.equals(".") && !value.equals(".."); //$NON-NLS-1$ //$NON-NLS-2$
}
return true;
}
@@ -31,9 +33,9 @@
int l = value.length();
for (int i = 0; i < l; i++) {
char c = value.charAt(i);
- if(forbid.indexOf(c) >= 0) return "contains illegal symbol " + c;
+ if(forbid.indexOf(c) >= 0) return MessageFormat.format("contains illegal symbol {0}", c);
}
- if(value.equals(".") || value.equals("..")) {
+ if(value.equals(".") || value.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
return "cannot be equal to a path reserved for navigation";
}
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintInt.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintInt.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintInt.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.constraint.impl;
+import java.text.MessageFormat;
import org.w3c.dom.*;
public class XAttributeConstraintInt extends XAttributeConstraintProperties {
@@ -22,9 +23,9 @@
public void load(Element element) {
super.load(element);
- mandatory = getBoolean("mandatory", true);
- min = getInt("minimum", Integer.MIN_VALUE);
- max = getInt("maximum", Integer.MAX_VALUE);
+ mandatory = getBoolean("mandatory", true); //$NON-NLS-1$
+ min = getInt("minimum", Integer.MIN_VALUE); //$NON-NLS-1$
+ max = getInt("maximum", Integer.MAX_VALUE); //$NON-NLS-1$
}
public boolean accepts(String value) {
@@ -45,11 +46,13 @@
} else if(min == 0 && max == Integer.MAX_VALUE) {
return "must be a non-negative integer.";
} else if(min > Integer.MIN_VALUE && max == Integer.MAX_VALUE) {
- return "must be an integer greater than " + min + ".";
+ return MessageFormat.format("must be an integer greater than {0}.",
+ min);
} else if(min == Integer.MIN_VALUE && max < Integer.MAX_VALUE) {
- return "must be an integer less than " + max + ".";
+ return MessageFormat.format("must be an integer less than {0}.", max);
} else {
- return "must be an integer from " + min + " to " + max + ".";
+ return MessageFormat.format("must be an integer from {0} to {1}.",
+ min, max);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintJavaName.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintJavaName.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintJavaName.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,15 +18,15 @@
public class XAttributeConstraintJavaName extends XAttributeConstraintProperties {
- private static final String[] keywords = {"break", "case",
- "catch", "class", "const", "continue", "default",
- "else", "extends", XModelObjectConstants.FALSE, "final", "finally", "for", "if",
- "implements", "import", "instanceof", "interface", "new",
- "null", "package", "protected", "private", "public", "return",
- "static", "switch", "synchronized", "throw", "throws", "transient",
- XModelObjectConstants.TRUE, "try", "void", "volatile", "while"};
+ private static final String[] keywords = {"break", "case", //$NON-NLS-1$ //$NON-NLS-2$
+ "catch", "class", "const", "continue", "default", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ "else", "extends", XModelObjectConstants.FALSE, "final", "finally", "for", "if", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ "implements", "import", "instanceof", "interface", "new", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ "null", "package", "protected", "private", "public", "return", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ "static", "switch", "synchronized", "throw", "throws", "transient", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ XModelObjectConstants.TRUE, "try", "void", "volatile", "while"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private static final String[] primitives = {
- "boolean", "byte", "char", "double", "float", "int", "long", "short"
+ "boolean", "byte", "char", "double", "float", "int", "long", "short" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
};
private static final Set<String> keytable = new HashSet<String>();
@@ -42,9 +42,9 @@
public void load(Element element) {
super.load(element);
- String k = p.getProperty("keywords");
+ String k = p.getProperty("keywords"); //$NON-NLS-1$
if(k == null) return;
- StringTokenizer st = new StringTokenizer(k, ";,");
+ StringTokenizer st = new StringTokenizer(k, ";,"); //$NON-NLS-1$
custom = new HashSet<String>();
while(st.hasMoreTokens()) custom.add(st.nextToken());
}
@@ -55,7 +55,7 @@
if(value == null) return false;
if(value.length() == 0) return true;
if(!Character.isJavaIdentifierStart(value.charAt(0))) return false;
- if(keytable.contains(value) && !XModelObjectConstants.TRUE.equals(p.getProperty("acceptKeyWord"))) return false;
+ if(keytable.contains(value) && !XModelObjectConstants.TRUE.equals(p.getProperty("acceptKeyWord"))) return false; //$NON-NLS-1$
if(!allowPrimitiveTypes && primitiveSet.contains(value)) return false;
if(custom != null && custom.contains(value)) return false;
for (int i = 1; i < value.length(); i++) {
@@ -75,7 +75,7 @@
public String getCorrectedValue(String value) {
if(value == null || value.length() == 0) return null;
- if(XModelObjectConstants.TRUE.equals(getProperties().getProperty("acceptIncorrect"))) return value;
+ if(XModelObjectConstants.TRUE.equals(getProperties().getProperty("acceptIncorrect"))) return value; //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
boolean first = true;
for (int i = 0; i < value.length(); i++) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListAdd.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListAdd.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListAdd.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public XAttributeConstraintListAdd() {}
public boolean accepts(String value) {
- StringTokenizer st = new StringTokenizer(value, ",;");
+ StringTokenizer st = new StringTokenizer(value, ",;"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String t = st.nextToken().trim();
if(!values.contains(t)) return false;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListTemplates.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListTemplates.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintListTemplates.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -26,7 +26,7 @@
protected void refresh() {
values.clear();
- String tr = System.getProperty("global.ECOM_HOME") + XModelObjectConstants.SEPARATOR + "Templates";
+ String tr = System.getProperty("global.ECOM_HOME") + XModelObjectConstants.SEPARATOR + "Templates"; //$NON-NLS-1$ //$NON-NLS-2$
File f = new File(tr);
File[] fs = f.listFiles();
if(fs == null) return;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintProperties.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintProperties.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintProperties.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
Element c = (Element)nl.item(i);
String vs = c.getAttribute(NAME);
int n = vs.indexOf('=');
- String k = (n < 0) ? "" : vs.substring(0, n).trim();
+ String k = (n < 0) ? "" : vs.substring(0, n).trim(); //$NON-NLS-1$
String v = vs.substring(n + 1).trim();
p.setProperty(k, v);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintQClassName.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintQClassName.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintQClassName.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.constraint.impl;
+import java.text.MessageFormat;
import java.util.*;
public class XAttributeConstraintQClassName extends XAttributeConstraintImpl {
@@ -22,7 +23,7 @@
public boolean accepts(String value) {
if(value == null) return false;
if(value.length() == 0) return true;
- StringTokenizer st = new StringTokenizer(value, ".");
+ StringTokenizer st = new StringTokenizer(value, "."); //$NON-NLS-1$
////if(st.countTokens() < 2) return false;
while(st.hasMoreTokens()) {
String t = st.nextToken();
@@ -33,19 +34,19 @@
public String getError(String value) {
if(accepts(value)) return null;
- StringTokenizer st = new StringTokenizer(value, ".");
+ StringTokenizer st = new StringTokenizer(value, "."); //$NON-NLS-1$
////if(st.countTokens() < 2) return "must be a qualified name of class in a package";
while(st.hasMoreTokens()) {
String err = x.getError(st.nextToken());
- if(err != null) return "contains part that " + err;
+ if(err != null) return MessageFormat.format("contains part that {0}", err);
}
return null;
}
public String getCorrectedValue(String value) {
- if(value == null) return "";
+ if(value == null) return ""; //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
- StringTokenizer st = new StringTokenizer(value, ".");
+ StringTokenizer st = new StringTokenizer(value, "."); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String cor = x.getCorrectedValue(st.nextToken());
if(cor == null) continue;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,7 +15,7 @@
public class XAttributeConstraintTree extends XAttributeConstraintProperties
implements XAttributeConstraintT {
- private String filteredTreeName = "";
+ private String filteredTreeName = ""; //$NON-NLS-1$
public XAttributeConstraintTree() {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeEditorImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeEditorImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeEditorImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -32,19 +32,19 @@
}
public String getViewerClassName() {
- if(viewer != null && viewer.startsWith("%")) findViewerName();
+ if(viewer != null && viewer.startsWith("%")) findViewerName(); //$NON-NLS-1$
return viewer;
}
private void findViewerName() {
if(viewer == null || viewer.length() < 2) return;
viewer = viewer.substring(1, viewer.length() - 1);
- viewer = getMetaModel().getMapping("AttributeEditor").getValue(viewer);
+ viewer = getMetaModel().getMapping("AttributeEditor").getValue(viewer); //$NON-NLS-1$
}
protected void setDefaultClassName() {
- editor = getMetaModel().getMapping("AttributeEditor").getValue(getName());
+ editor = getMetaModel().getMapping("AttributeEditor").getValue(getName()); //$NON-NLS-1$
}
public void load(Element element) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpPaletteHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,7 +20,7 @@
public void executeHandler(XModelObject object, Properties prop) throws XModelException {
if(!isEnabled(object)) return;
XModelObject tab = getTabObject(object);
- String key = (tab == null) ? null : tab.getModelEntity().getName() + "_" + tab.getPathPart().replace(' ', '_');
+ String key = (tab == null) ? null : tab.getModelEntity().getName() + "_" + tab.getPathPart().replace(' ', '_'); //$NON-NLS-1$
if(key == null || !HelpUtil.hasHelp(key)) {
super.executeHandler(object, prop);
} else {
@@ -30,7 +30,7 @@
private XModelObject getTabObject(XModelObject object) {
XModelObject tab = object;
- while(tab != null && !tab.getModelEntity().getName().startsWith("SharablePageTab"))
+ while(tab != null && !tab.getModelEntity().getName().startsWith("SharablePageTab")) //$NON-NLS-1$
tab = tab.getParent();
return tab;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/help/HelpUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.meta.help;
import java.io.*;
+import java.text.MessageFormat;
import java.util.*;
import java.net.URL;
import java.util.zip.*;
@@ -27,11 +28,11 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class HelpUtil {
- private static final String HELP_PLUGIN_ID = "org.jboss.tools.struts.doc.ui";
- private static final String JSF_HELP_PLUGIN_ID = "org.jboss.tools.jsf.doc.ui";
+ private static final String HELP_PLUGIN_ID = "org.jboss.tools.struts.doc.ui"; //$NON-NLS-1$
+ private static final String JSF_HELP_PLUGIN_ID = "org.jboss.tools.jsf.doc.ui"; //$NON-NLS-1$
static String[] PLUGINS = new String[]{HELP_PLUGIN_ID, JSF_HELP_PLUGIN_ID};
- static Properties keys = KeyLoader.load("help/keys");
+ static Properties keys = KeyLoader.load("help/keys"); //$NON-NLS-1$
public static boolean hasHelp(String key) {
String path = (key == null) ? null : keys.getProperty(key);
@@ -42,10 +43,10 @@
String u = (key == null) ? null : keys.getProperty(key);
if(u == null) return;
//if(u.endsWith("noHelpYet.html")) ModelPlugin.log("Help for key " + key + " is not available.");
- XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser");
+ XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser"); //$NON-NLS-1$
if(editor == null) throw new XModelException("External Program 'Internet Browser' is not set in Options.");
- String f = "" + model.getProperties().getProperty(XModelConstants.HOME) + "/doc/help" + u;
- OpenWithExternalHandler.start("Help", f, editor);
+ String f = "" + model.getProperties().getProperty(XModelConstants.HOME) + "/doc/help" + u; //$NON-NLS-1$
+ OpenWithExternalHandler.start("Help", f, editor); //$NON-NLS-1$
}
public static boolean isHelpPluginInstalled() {
@@ -60,30 +61,33 @@
}
public static void callExternalBrowser(XModel model, String url) throws XModelException {
- XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser");
+ XModelObject editor = model.getByPath("%Options%/External Programs/Internet Browser"); //$NON-NLS-1$
if(editor == null) throw new XModelException("External Program 'Internet Browser' is not set in Options.");
- OpenWithExternalBrowserHandler.start("Help", url, editor);
+ OpenWithExternalBrowserHandler.start("Help", url, editor); //$NON-NLS-1$
}
public static String createKey(XModelObject object, XAction action) {
- return object.getModelEntity().getName() + "_" + action.getName();
+ return object.getModelEntity().getName() + "_" + action.getName(); //$NON-NLS-1$
}
public static Properties createKey(XModelObject object, XAction action, Properties p) {
if(p == null) p = new Properties();
- p.setProperty("help", createKey(object, action));
+ p.setProperty("help", createKey(object, action)); //$NON-NLS-1$
return p;
}
public static void help(XModel model, String key) {
ServiceDialog d = model.getService();
if(!hasHelp(key)) {
- d.showDialog(ModelMessages.WARNING, "Help for key " + key + " is not available.", new String[]{"Close"}, null, ServiceDialog.WARNING);
+ d.showDialog(ModelMessages.WARNING,
+ MessageFormat.format("Help for key {0} is not available.", key),
+ new String[]{"Close"}, null, ServiceDialog.WARNING);
} else {
try {
HelpUtil.callHelp(model, key);
} catch (XModelException e) {
- d.showDialog(ModelMessages.WARNING, e.getMessage(), new String[]{"Close"}, null, ServiceDialog.WARNING);
+ d.showDialog(ModelMessages.WARNING, e.getMessage(),
+ new String[]{"Close"}, null, ServiceDialog.WARNING);
}
}
}
@@ -91,15 +95,18 @@
public static void helpEclipse(XModel model, String key) {
ServiceDialog d = model.getService();
if(!isHelpPluginInstalled()) {
- d.showDialog("Help", "User Guide is not installed.", new String[]{"Close"}, null, ServiceDialog.MESSAGE);
+ d.showDialog("Help", "User Guide is not installed.",
+ new String[]{"Close"}, null, ServiceDialog.MESSAGE);
} else if(!hasEclipseHelp(key)) {
- d.showDialog("Help", "Help key " + key + " is not found.", new String[]{"Close"}, null, ServiceDialog.MESSAGE);
+ d.showDialog("Help", MessageFormat.format("Help key {0} is not found.", key),
+ new String[]{"Close"}, null, ServiceDialog.MESSAGE);
} else {
String path = getValidPath(keys.getProperty(key));
if (path != null) {
WorkbenchHelp.displayHelpResource(path);
} else {
- d.showDialog("Help", "Help resource " + keys.getProperty(key) + " is not found.", new String[]{"Close"}, null, ServiceDialog.MESSAGE);
+ d.showDialog("Help", MessageFormat.format("Help resource {0} is not found.",
+ keys.getProperty(key)), new String[]{"Close"}, null, ServiceDialog.MESSAGE);
}
}
}
@@ -113,7 +120,7 @@
String f = url.getFile().replace('\\', '/');
if(f.endsWith(XModelObjectConstants.SEPARATOR)) f = f.substring(0, f.length() - 1);
if(!path.startsWith(XModelObjectConstants.SEPARATOR)) path = XModelObjectConstants.SEPARATOR + path;
- String zipPath = f + "/doc.zip";
+ String zipPath = f + "/doc.zip"; //$NON-NLS-1$
if(new File(zipPath).exists()) {
Set set = getZipEntries(zipPath);
if(set.contains(path)) return XModelObjectConstants.SEPARATOR + PLUGINS[i] + XModelObjectConstants.SEPARATOR + path;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,14 +33,14 @@
import org.jboss.tools.common.xml.XMLUtilities;
public class MetaLibLoader {
- public static String DOC_PUBLICID = "-//Red Hat, Inc.//DTD Meta 1.0//EN";
+ public static String DOC_PUBLICID = "-//Red Hat, Inc.//DTD Meta 1.0//EN"; //$NON-NLS-1$
public static boolean validateMetaXML = false;
static {
try {
Class<?> c = MetaLibLoader.class;
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID, c, "/meta/meta.dtd");
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID, c, "/meta/meta.dtd"); //$NON-NLS-1$
} catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
@@ -51,7 +51,7 @@
private HashSet<String> metas = new HashSet<String>();
private ArrayList<ModuleRef> metarefs = new ArrayList<ModuleRef>();
- private Element root = XMLUtilities.createDocumentElement("meta");
+ private Element root = XMLUtilities.createDocumentElement("meta"); //$NON-NLS-1$
public MetaLibLoader() {}
@@ -99,13 +99,13 @@
Element g = parse(stream2);
if(g == null) {
- ModelPlugin.getPluginLog().logInfo("Corrupted meta resource " + name);
+ ModelPlugin.getPluginLog().logInfo("Corrupted meta resource " + name); //$NON-NLS-1$
} else {
load0(g, name, url.toString());
}
} catch (IOException e) {
- ModelPlugin.getPluginLog().logError("MetaLoader: Cannot read resource " + url.toString());
+ ModelPlugin.getPluginLog().logError("MetaLoader: Cannot read resource " + url.toString()); //$NON-NLS-1$
return;
} finally {
if(stream2!=null) {
@@ -126,7 +126,7 @@
InputSource is = new InputSource(stream3);
String[] errors = XMLUtil.getXMLErrors(is, true);
if(errors != null && errors.length > 0) {
- ModelPlugin.getPluginLog().logInfo("Errors in " + name);
+ ModelPlugin.getPluginLog().logInfo("Errors in " + name); //$NON-NLS-1$
for (int i = 0; i < errors.length && i < 5; i++) {
ModelPlugin.getPluginLog().logInfo(errors[i]);
}
@@ -154,7 +154,7 @@
p.current = root;
p.parse(stream);
Element g = p.documentElement;
- g = XMLUtilities.getUniqueChild(g, "XModelEntityGroup");
+ g = XMLUtilities.getUniqueChild(g, "XModelEntityGroup"); //$NON-NLS-1$
p.documentElement.removeChild(g);
return g;
}
@@ -183,42 +183,42 @@
Element element;
String name;
String info;
- String key = "";
+ String key = ""; //$NON-NLS-1$
ArrayList<String> depends = new ArrayList<String>();
public ModuleRef(Element e, String name, String info) {
this.element = e;
- Element v = XMLUtil.getUniqueChild(e, "VERSION");
+ Element v = XMLUtil.getUniqueChild(e, "VERSION"); //$NON-NLS-1$
this.name = name;
this.info = info;
if(v == null) return;
- if(v.hasAttribute("MODULE") && v.hasAttribute("VERSION")) {
- key = v.getAttribute("MODULE") + ":" + v.getAttribute("VERSION");
+ if(v.hasAttribute("MODULE") && v.hasAttribute("VERSION")) { //$NON-NLS-1$ //$NON-NLS-2$
+ key = v.getAttribute("MODULE") + ":" + v.getAttribute("VERSION"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- if(v.hasAttribute("DEPENDS")) {
- String s = v.getAttribute("DEPENDS");
- StringTokenizer st = new StringTokenizer(s, ",");
+ if(v.hasAttribute("DEPENDS")) { //$NON-NLS-1$
+ String s = v.getAttribute("DEPENDS"); //$NON-NLS-1$
+ StringTokenizer st = new StringTokenizer(s, ","); //$NON-NLS-1$
while(st.hasMoreTokens()) depends.add(st.nextToken());
}
}
public boolean acceptable(Set modules) {
- return (true || key.endsWith("1.0"));
+ return (true || key.endsWith("1.0")); //$NON-NLS-1$
}
}
class Parser implements ContentHandler {
- protected static final String FATAL_ERROR_PROCESSING_FEATURE_ID = "http://apache.org/xml/features/continue-after-fatal-error";
- protected static final String ENTITY_RESOLVER_PROPERTY_ID = "http://apache.org/xml/properties/internal/entity-resolver";
- protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
- protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes";
- protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
- protected static final String VALIDATION_SCHEMA_FEATURE_ID = "http://apache.org/xml/features/validation/schema";
- protected static final String VALIDATION_SCHEMA_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
- protected static final String VALIDATION_DYNAMIC_FEATURE_ID = "http://apache.org/xml/features/validation/dynamic";
+ protected static final String FATAL_ERROR_PROCESSING_FEATURE_ID = "http://apache.org/xml/features/continue-after-fatal-error"; //$NON-NLS-1$
+ protected static final String ENTITY_RESOLVER_PROPERTY_ID = "http://apache.org/xml/properties/internal/entity-resolver"; //$NON-NLS-1$
+ protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces"; //$NON-NLS-1$
+ protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes"; //$NON-NLS-1$
+ protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation"; //$NON-NLS-1$
+ protected static final String VALIDATION_SCHEMA_FEATURE_ID = "http://apache.org/xml/features/validation/schema"; //$NON-NLS-1$
+ protected static final String VALIDATION_SCHEMA_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking"; //$NON-NLS-1$
+ protected static final String VALIDATION_DYNAMIC_FEATURE_ID = "http://apache.org/xml/features/validation/dynamic"; //$NON-NLS-1$
- protected static final String DEFAULT_SAX_PARSER_CLASS_NAME = "org.apache.xerces.parsers.SAXParser";
+ protected static final String DEFAULT_SAX_PARSER_CLASS_NAME = "org.apache.xerces.parsers.SAXParser"; //$NON-NLS-1$
Element documentElement = null;
Element current = null;
@@ -260,7 +260,7 @@
try {
parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
} catch (SAXException e1) {
- CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1);
+ CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
}
parserInstance.setContentHandler(handler);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaResourceLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaResourceLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaResourceLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,17 +20,17 @@
public static Map<String,URL> getMetaResources() {
Map<String,URL> resources = new HashMap<String,URL>();
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.jboss.tools.common.model.meta");
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.jboss.tools.common.model.meta"); //$NON-NLS-1$
IExtension[] es = point.getExtensions();
for (int i = 0; i < es.length; i++) {
Bundle bundle = Platform.getBundle(es[i].getNamespaceIdentifier());
IConfigurationElement[] elements = es[i].getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
- String path = elements[j].getAttribute("path");
+ String path = elements[j].getAttribute("path"); //$NON-NLS-1$
if(path == null) continue;
if(resources.containsKey(path)) {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("Warning: duplicate meta resource " + path + " ignored.");
+ ModelPlugin.getPluginLog().logInfo("Warning: duplicate meta resource " + path + " ignored."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
try {
@@ -39,11 +39,11 @@
resources.put(path, url);
} else {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("Warning: meta resource " + path + " not found.");
+ ModelPlugin.getPluginLog().logInfo("Warning: meta resource " + path + " not found."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} catch (IllegalStateException e) {
- ModelPlugin.getPluginLog().logError("MetaResourceLoader warning: meta resource " + path + " not found.");
+ ModelPlugin.getPluginLog().logError("MetaResourceLoader warning: meta resource " + path + " not found."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -144,8 +144,8 @@
setDefaultValue(el.getAttribute(DEFAULT_VALUE));
setXMLName(el.getAttribute(XML_NAME));
loadAdapter(el);
- trimmable = !XModelObjectConstants.NO.equals(el.getAttribute("TRIM")); //$NON-NLS-1$//$NON-NLS-2$
- copyable = !XModelObjectConstants.NO.equals(el.getAttribute("COPYABLE")); //$NON-NLS-1$//$NON-NLS-2$
+ trimmable = !XModelObjectConstants.NO.equals(el.getAttribute("TRIM")); //$NON-NLS-1$
+ copyable = !XModelObjectConstants.NO.equals(el.getAttribute("COPYABLE")); //$NON-NLS-1$
loadProperties(el);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XEntityRendererImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XEntityRendererImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XEntityRendererImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,7 +22,7 @@
public XEntityRendererImpl() {}
public String getProperty(String name) {
- return "";
+ return ""; //$NON-NLS-1$
}
public String[] getIconNames() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataConstants.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataConstants.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,58 +14,58 @@
public interface XMetaDataConstants {
- String XMODEL_STRUCTURE = "XModelStructure";
- String XMODEL_ENTITY = "XModelEntity";
- String XENTITY_EXTENTION = "XEntityExtension";
- String XMODEL_ATTRIBUTES = "XModelAttributes";
- String XMODEL_ATTRIBUTE = "XModelAttribute";
- String XMODEL_ATTRIBUTE_REF = "XModelAttributeReference";
- String XMODEL_ACTIONS = "XModelActions";
- String XMODEL_ACTION = "XModelAction";
- String XMODEL_ACTION_ITEM = "XActionItem";
- String XMODEL_ACTION_ITEM_REF = "XActionItemReference";
- String XMODEL_CHILDREN = "XChildrenEntities";
- String XMODEL_CHILD = "XChildEntity";
+ String XMODEL_STRUCTURE = "XModelStructure"; //$NON-NLS-1$
+ String XMODEL_ENTITY = "XModelEntity"; //$NON-NLS-1$
+ String XENTITY_EXTENTION = "XEntityExtension"; //$NON-NLS-1$
+ String XMODEL_ATTRIBUTES = "XModelAttributes"; //$NON-NLS-1$
+ String XMODEL_ATTRIBUTE = "XModelAttribute"; //$NON-NLS-1$
+ String XMODEL_ATTRIBUTE_REF = "XModelAttributeReference"; //$NON-NLS-1$
+ String XMODEL_ACTIONS = "XModelActions"; //$NON-NLS-1$
+ String XMODEL_ACTION = "XModelAction"; //$NON-NLS-1$
+ String XMODEL_ACTION_ITEM = "XActionItem"; //$NON-NLS-1$
+ String XMODEL_ACTION_ITEM_REF = "XActionItemReference"; //$NON-NLS-1$
+ String XMODEL_CHILDREN = "XChildrenEntities"; //$NON-NLS-1$
+ String XMODEL_CHILD = "XChildEntity"; //$NON-NLS-1$
String NAME = XModelObjectConstants.ATTR_NAME;
- String XML_NAME = "xmlname";
- String DISPLAYNAME="displayName";
- String LOADER = "loader";
+ String XML_NAME = "xmlname"; //$NON-NLS-1$
+ String DISPLAYNAME="displayName"; //$NON-NLS-1$
+ String LOADER = "loader"; //$NON-NLS-1$
- String IMPLEMENTING_CLASS = "ImplementingClass";
- String IMPLEMENTATION_LOADING_CLASS = "ImplementationLoadingClass";
- String IMPLEMENTATION_GENERATOR_CLASS = "ImplementationGenerator";
- String OBJECT_EDITOR_CLASSNAME = "ObjectEditorClass";
- String ADOPT_MANAGER_CLASS = "AdoptManagerClass";
+ String IMPLEMENTING_CLASS = "ImplementingClass"; //$NON-NLS-1$
+ String IMPLEMENTATION_LOADING_CLASS = "ImplementationLoadingClass"; //$NON-NLS-1$
+ String IMPLEMENTATION_GENERATOR_CLASS = "ImplementationGenerator"; //$NON-NLS-1$
+ String OBJECT_EDITOR_CLASSNAME = "ObjectEditorClass"; //$NON-NLS-1$
+ String ADOPT_MANAGER_CLASS = "AdoptManagerClass"; //$NON-NLS-1$
- String CONSTRAINT = "Constraint";
- String VALUE = "value";
- String DEFAULT_VALUE = "default";
- String RENDERER = "XEntityRenderer";
- String GROUP_NAME= "groupName";
- String HANDLER_CLASSNAME= "handler";
+ String CONSTRAINT = "Constraint"; //$NON-NLS-1$
+ String VALUE = "value"; //$NON-NLS-1$
+ String DEFAULT_VALUE = "default"; //$NON-NLS-1$
+ String RENDERER = "XEntityRenderer"; //$NON-NLS-1$
+ String GROUP_NAME= "groupName"; //$NON-NLS-1$
+ String HANDLER_CLASSNAME= "handler"; //$NON-NLS-1$
- String EDITOR = "Editor";
- String EDITOR_CLASSNAME = "class";
- String EDITOR_VIEWERNAME = "viewer";
- String EDITOR_ALLOWS_ANY_VALUE = "allows_any_value";
- String REQUIRED = "required";
- String EDITABLE = "editable";
- String VISIBLE = "visibility";
- String MAX_COUNT= "maxCount";
- String ENTITY_NAME= "entityName";
+ String EDITOR = "Editor"; //$NON-NLS-1$
+ String EDITOR_CLASSNAME = "class"; //$NON-NLS-1$
+ String EDITOR_VIEWERNAME = "viewer"; //$NON-NLS-1$
+ String EDITOR_ALLOWS_ANY_VALUE = "allows_any_value"; //$NON-NLS-1$
+ String REQUIRED = "required"; //$NON-NLS-1$
+ String EDITABLE = "editable"; //$NON-NLS-1$
+ String VISIBLE = "visibility"; //$NON-NLS-1$
+ String MAX_COUNT= "maxCount"; //$NON-NLS-1$
+ String ENTITY_NAME= "entityName"; //$NON-NLS-1$
- String ENTITY = "entity";
+ String ENTITY = "entity"; //$NON-NLS-1$
- String ICONS = "ICONS";
- String ICON = "ICON";
- String ICON_PATH = "path";
- String ICON_TYPE = "type";
- String ICON_INFO = "info";
+ String ICONS = "ICONS"; //$NON-NLS-1$
+ String ICON = "ICON"; //$NON-NLS-1$
+ String ICON_PATH = "path"; //$NON-NLS-1$
+ String ICON_TYPE = "type"; //$NON-NLS-1$
+ String ICON_INFO = "info"; //$NON-NLS-1$
- String MAPPINGS = "MAPPINGS";
- String MAPPING = "MAPPING";
- String PAIR = "PAIR";
- String DEFAULT_KEY = "*";
+ String MAPPINGS = "MAPPINGS"; //$NON-NLS-1$
+ String MAPPING = "MAPPING"; //$NON-NLS-1$
+ String PAIR = "PAIR"; //$NON-NLS-1$
+ String DEFAULT_KEY = "*"; //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaDataLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,6 +12,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.*;
import org.w3c.dom.*;
import org.jboss.tools.common.meta.XMetaElement;
@@ -31,9 +32,9 @@
try {
return (XMetaElementImpl)defImpl.newInstance();
} catch (InstantiationException e) {
- ModelPlugin.getPluginLog().logError("Error in getDefaultMetaElementInstance");
+ ModelPlugin.getPluginLog().logError("Error in getDefaultMetaElementInstance"); //$NON-NLS-1$
} catch (IllegalAccessException e) {
- ModelPlugin.getPluginLog().logError("Error in getDefaultMetaElementInstance");
+ ModelPlugin.getPluginLog().logError("Error in getDefaultMetaElementInstance"); //$NON-NLS-1$
}
return null;
}
@@ -47,11 +48,11 @@
try {
return (XMetaElementImpl)ClassLoaderUtil.getClassLoader().loadClass(loader).newInstance();
} catch (InstantiationException e) {
- ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e);
+ ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e); //$NON-NLS-1$
} catch (IllegalAccessException e) {
- ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e);
+ ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e); //$NON-NLS-1$
} catch (ClassNotFoundException e) {
- ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e);
+ ModelPlugin.getPluginLog().logError("Error in getMetaElementInstance " + loader, e); //$NON-NLS-1$
}
return null;
}
@@ -108,7 +109,7 @@
static Element loadDocument(String filename) throws FileNotFoundException {
Element e = XMLUtil.getElement(filename);
- if(e == null) throw new FileNotFoundException("Can't load meta model from " + filename);
+ if(e == null) throw new FileNotFoundException(MessageFormat.format("Can''t load meta model from {0}", filename));
return e;
}
@@ -118,10 +119,10 @@
static void loadEntityGroup(XModelMetaDataImpl factory, Element g) {
// String n = g.getAttribute(XModelObjectConstants.XML_ATTR_NAME);
- String module = "";
- Element v = XMLUtilities.getUniqueChild(g, "VERSION");
- if(v != null && v.hasAttribute("MODULE")) {
- module = v.getAttribute("MODULE");
+ String module = ""; //$NON-NLS-1$
+ Element v = XMLUtilities.getUniqueChild(g, "VERSION"); //$NON-NLS-1$
+ if(v != null && v.hasAttribute("MODULE")) { //$NON-NLS-1$
+ module = v.getAttribute("MODULE"); //$NON-NLS-1$
}
loadMappings(factory, g);
factory.createIconList(getUniqueChild(g, ICONS));
@@ -145,7 +146,7 @@
}
private static void loadGlobalActions(XModelMetaDataImpl factory, Element group) {
- Element actions = getUniqueChild(group, "GlobalActions");
+ Element actions = getUniqueChild(group, "GlobalActions"); //$NON-NLS-1$
if(actions != null) factory.loadGlobalActions(actions);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -45,7 +45,7 @@
public final String expand(String parameter, String mapping) {
if(parameter == null) return null;
- if(parameter.startsWith("%")) {
+ if(parameter.startsWith("%")) { //$NON-NLS-1$
int j = parameter.length() - 1;
XMapping m = getMetaModel().getMapping(mapping);
if(m == null) return null;
@@ -59,13 +59,13 @@
}
protected void loadProperties(Element el) {
- p = parseProperties(el.getAttribute("PROPERTIES"));
+ p = parseProperties(el.getAttribute("PROPERTIES")); //$NON-NLS-1$
}
protected static Properties parseProperties(String ps) {
if(ps == null || ps.length() == 0) return null;
Properties p = new Properties();
- StringTokenizer st = new StringTokenizer(ps, ";,");
+ StringTokenizer st = new StringTokenizer(ps, ";,"); //$NON-NLS-1$
while(st.hasMoreElements()) {
String t = st.nextToken();
int i = t.indexOf('=');
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityExtensionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityExtensionImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityExtensionImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -47,7 +47,7 @@
public void load(Element element) {
setName(element.getAttribute(NAME));
children.load(element);
- Element ei = XMetaDataLoader.getUniqueChild(element, "XActionItem");
+ Element ei = XMetaDataLoader.getUniqueChild(element, "XActionItem"); //$NON-NLS-1$
actions.setElement(ei);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.common.meta.impl;
-import java.io.IOException;
import java.util.*;
import org.w3c.dom.Element;
@@ -76,7 +75,7 @@
private void addHelpAction() {
XActionListImpl list = actions;
- XActionItem item = actions.getItem("Properties");
+ XActionItem item = actions.getItem("Properties"); //$NON-NLS-1$
if(item instanceof XActionListImpl) list = (XActionListImpl)item;
list.addActionItem(XActionImpl.getHelpAction());
}
@@ -101,7 +100,7 @@
public Class getImplementingClass() {
if(resolvedImplementationClassName == UNRESOLVED) {
- resolvedImplementationClassName = expand(implementationClassName, "Implementations");
+ resolvedImplementationClassName = expand(implementationClassName, "Implementations"); //$NON-NLS-1$
}
if(resolvedImplementationClassName == null) return null;
Class cls = ModelFeatureFactory.getInstance().getFeatureClass(resolvedImplementationClassName);
@@ -117,7 +116,7 @@
public XModelObject getObjectImplementation() {
if(resolvedImplementationClassName == UNRESOLVED) {
- resolvedImplementationClassName = expand(implementationClassName, "Implementations");
+ resolvedImplementationClassName = expand(implementationClassName, "Implementations"); //$NON-NLS-1$
}
if(resolvedImplementationClassName == null) return null;
XModelObject o = ModelFeatureFactory.getInstance().createXModelObjectInstance(resolvedImplementationClassName);
@@ -141,7 +140,7 @@
public XObjectLoader getObjectLoader() {
if(resolvedLoaderClassName == UNRESOLVED) {
- resolvedLoaderClassName = expand(loaderClassName, "Loaders");
+ resolvedLoaderClassName = expand(loaderClassName, "Loaders"); //$NON-NLS-1$
}
if(resolvedLoaderClassName == null) return null;
Object o = ModelFeatureFactory.getInstance().createFeatureInstance(resolvedLoaderClassName);
@@ -149,14 +148,14 @@
return null;
}
if(!(o instanceof XObjectLoader)) {
- ModelPlugin.getPluginLog().logError("Model object loader" + resolvedLoaderClassName + " must implement " + XObjectLoader.class.getName());
+ ModelPlugin.getPluginLog().logError("Model object loader" + resolvedLoaderClassName + " must implement " + XObjectLoader.class.getName()); //$NON-NLS-1$ //$NON-NLS-2$
resolvedLoaderClassName = null;
return null;
}
return (XObjectLoader)o;
}
- static String UNRESOLVED = "UNRESOLVED";
+ static String UNRESOLVED = "UNRESOLVED"; //$NON-NLS-1$
public void setLoaderClassName(String className) {
if(className != null && className.length() > 0) {
@@ -166,7 +165,7 @@
}
public String getEditorClassName() {
- return (m_EditorClassName = expand(m_EditorClassName, "ObjectEditor"));
+ return (m_EditorClassName = expand(m_EditorClassName, "ObjectEditor")); //$NON-NLS-1$
}
public void setEditorClassName(String className){
@@ -226,8 +225,8 @@
setAdoptManager(element.getAttribute(ADOPT_MANAGER_CLASS));
}
loadDependencies(element);
- xmlSubPath = element.getAttribute("XMLSUBPATH");
- Element ei = XMetaDataLoader.getUniqueChild(element, "XActionItem");
+ xmlSubPath = element.getAttribute("XMLSUBPATH"); //$NON-NLS-1$
+ Element ei = XMetaDataLoader.getUniqueChild(element, "XActionItem"); //$NON-NLS-1$
actions.setElement(ei);
loadProperties(element);
}
@@ -247,7 +246,7 @@
} else if(XMODEL_ATTRIBUTE_REF.equals(name)) {
String entityName = e.getAttribute(XMetaDataConstants.ENTITY);
String attrName = e.getAttribute(NAME);
- String attributes = e.getAttribute("attributes");
+ String attributes = e.getAttribute("attributes"); //$NON-NLS-1$
String[] atributeNames = new String[]{attrName};
if(atributeNames != null && attributes.length() > 0) {
atributeNames = XModelObjectUtil.asStringArray(attributes);
@@ -259,11 +258,11 @@
if(attr != null) {
list.add(attr.copy());
} else {
- ModelPlugin.getPluginLog().logInfo("Cannot find reference to attribute " + attrName + " of entity " + entityName);
+ ModelPlugin.getPluginLog().logInfo("Cannot find reference to attribute " + attrName + " of entity " + entityName); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} else {
- ModelPlugin.getPluginLog().logInfo("Cannot find reference to entity " + entityName);
+ ModelPlugin.getPluginLog().logInfo("Cannot find reference to entity " + entityName); //$NON-NLS-1$
}
}
}
@@ -272,7 +271,7 @@
}
private void loadDependencies(Element el) {
- Element c = XMetaDataLoader.getUniqueChild(el, "XDependencies");
+ Element c = XMetaDataLoader.getUniqueChild(el, "XDependencies"); //$NON-NLS-1$
XDependencies d = (c == null) ? null : (XDependencies)XMetaDataLoader.loadMetaElement(c, null, false);
if(d != null) dependencies = d;
}
@@ -282,7 +281,7 @@
sb.append(getName());
sb.append('\n');
for(int i = 0; i < m_Attributes.length;++i)
- sb.append(" " + m_Attributes[i] + "\n");
+ sb.append(" " + m_Attributes[i] + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
return sb.toString();
}
@@ -361,7 +360,7 @@
if(unfoundEntities == null) unfoundEntities = new HashSet<String>();
if(!unfoundEntities.contains(n)) {
unfoundEntities.add(n);
- ModelPlugin.getPluginLog().logInfo("getChildByXML: cannot find child entity " + n);
+ ModelPlugin.getPluginLog().logInfo("getChildByXML: cannot find child entity " + n); //$NON-NLS-1$
}
continue;
}
@@ -398,23 +397,23 @@
if(implementationClassName == null || implementationClassName.length() == 0) {
return null;
}
- String cn = expand(implementationClassName, "Implementations");
+ String cn = expand(implementationClassName, "Implementations"); //$NON-NLS-1$
if(cn == null) {
- return "cannot expand implementation " + implementationClassName;
+ return "cannot expand implementation " + implementationClassName; //$NON-NLS-1$
}
Class cls = ModelFeatureFactory.getInstance().getFeatureClass(cn);
if(cls == null) {
- return "cannot load implementation class " + cn;
+ return "cannot load implementation class " + cn; //$NON-NLS-1$
}
try {
Object h = cls.newInstance();
if(!(h instanceof XModelObject)) {
- return "cannot reduce implementation to XModelObject";
+ return "cannot reduce implementation to XModelObject"; //$NON-NLS-1$
}
} catch (InstantiationException e) {
- return "cannot create implementation object";
+ return "cannot create implementation object"; //$NON-NLS-1$
} catch (IllegalAccessException e) {
- return "cannot create implementation object";
+ return "cannot create implementation object"; //$NON-NLS-1$
}
return null;
}
@@ -427,23 +426,23 @@
if(loaderClassName == null || loaderClassName.length() == 0) {
return null;
}
- String cn = expand(loaderClassName, "Loaders");
+ String cn = expand(loaderClassName, "Loaders"); //$NON-NLS-1$
if(cn == null) {
- return "cannot expand loader " + loaderClassName;
+ return "cannot expand loader " + loaderClassName; //$NON-NLS-1$
}
Class cls = ModelFeatureFactory.getInstance().getFeatureClass(cn);
if(cls == null) {
- return "cannot load loader class " + cn;
+ return "cannot load loader class " + cn; //$NON-NLS-1$
}
try {
Object h = cls.newInstance();
if(!(h instanceof XObjectLoader)) {
- return "cannot reduce loader to XObjectLoader";
+ return "cannot reduce loader to XObjectLoader"; //$NON-NLS-1$
}
} catch (InstantiationException e) {
- return "cannot create loader object";
+ return "cannot create loader object"; //$NON-NLS-1$
} catch (IllegalAccessException e) {
- return "cannot create loader object";
+ return "cannot create loader object"; //$NON-NLS-1$
}
return null;
}
@@ -477,7 +476,7 @@
entity.adopt = (XAdoptManager)ModelFeatureFactory.getInstance().createFeatureInstance(adoptclass);
}
} catch (ClassCastException e) {
- ModelPlugin.getPluginLog().logError("XModelEntityImpl:setAdoptManager:" + e.getMessage());
+ ModelPlugin.getPluginLog().logError("XModelEntityImpl:setAdoptManager:" + e.getMessage()); //$NON-NLS-1$
entity.adopt = null;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelMetaDataImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelMetaDataImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelMetaDataImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -65,7 +65,7 @@
// makeStatistics(es);
if(reportLoadingTime) {
long dt = - t + (t = System.currentTimeMillis());
- ModelPlugin.getPluginLog().logInfo("Meta model loaded in " + dt + " ms");
+ ModelPlugin.getPluginLog().logInfo("Meta model loaded in " + dt + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -91,9 +91,9 @@
XActionList al = es[i].getActionList();
makeActionList(al, actionMenuNames);
}
- System.out.println("------> Attributes=" + attNames.size() + " (total " + attrCount + ")");
- System.out.println("------> List values=" + listValues.size());
- System.out.println("------> Action menu names=" + actionMenuNames.size());
+ System.out.println("------> Attributes=" + attNames.size() + " (total " + attrCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ System.out.println("------> List values=" + listValues.size()); //$NON-NLS-1$
+ System.out.println("------> Action menu names=" + actionMenuNames.size()); //$NON-NLS-1$
}
private void makeActionList(XActionList list, Set<String> actionMenuNames) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelElement.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelElement.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelElement.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,7 +14,7 @@
import org.jboss.tools.common.meta.constraint.*;
public class XAdapterModelElement extends XAdapter {
- private String xmlname = "";
+ private String xmlname = ""; //$NON-NLS-1$
public XAdapterModelElement() {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelPath.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelPath.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterModelPath.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,7 +21,7 @@
public String getProperty(XProperty object) {
String p = XModelObjectLoaderUtil.getResourcePath((XModelObject)object);
- return (p == null) ? "" + object.get(XModelObjectConstants.XML_ATTR_NAME) : p;
+ return (p == null) ? "" + object.get(XModelObjectConstants.XML_ATTR_NAME) : p; //$NON-NLS-1$
}
public void setProperty(XProperty object, String value) {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterProjectsRoot.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterProjectsRoot.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/adapters/XAdapterProjectsRoot.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,7 +15,7 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
public class XAdapterProjectsRoot extends XAdapterModelElement {
- static String USE_DEFAULT = "Use Default Path";
+ static String USE_DEFAULT = "Use Default Path"; //$NON-NLS-1$
public String getProperty(XProperty object) {
XModelObject o = (XModelObject)object;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -23,7 +23,6 @@
import java.util.Iterator;
import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -39,13 +38,13 @@
public DocumentGenerator() {}
public void setModel(XModel model) {
- meta = model.getRoot().getChildByPath("MetaModel");
+ meta = model.getRoot().getChildByPath("MetaModel"); //$NON-NLS-1$
}
public void generate(String filename) {
- if(meta == null) throw new IllegalStateException("Meta root is not set.");
+ if(meta == null) throw new IllegalStateException("Meta root is not set."); //$NON-NLS-1$
this.filename = filename;
- Element g = XMLUtil.createDocumentElement("html");
+ Element g = XMLUtil.createDocumentElement("html"); //$NON-NLS-1$
generateTitle(g);
generateHead(g);
generateBody(g);
@@ -58,19 +57,19 @@
}
protected void generateTitle(Element e) {
- Element t = XMLUtil.createElement(e, "title");
+ Element t = XMLUtil.createElement(e, "title"); //$NON-NLS-1$
XMLUtil2.createText(t, "Entity list");
}
protected void generateHead(Element e) {
- Element h = XMLUtil.createElement(e, "head");
- Element s = XMLUtil.createElement(h, "style");
+ Element h = XMLUtil.createElement(e, "head"); //$NON-NLS-1$
+ Element s = XMLUtil.createElement(h, "style"); //$NON-NLS-1$
XMLUtil2.createText(s, new StyleGenerator().getStyle());
}
protected void generateBody(Element e) {
Element b = XMLUtil.createElement(e, XModelObjectConstants.ATTR_NAME_BODY);
- XModelObject entities = meta.getChildren("MetaEntities")[0];
+ XModelObject entities = meta.getChildren("MetaEntities")[0]; //$NON-NLS-1$
parents = new Parents();
parents.set(entities);
parents.compile();
@@ -79,37 +78,37 @@
}
protected void processGroup(Element e, XModelObject o) {
- XModelObject[] es = o.getChildren("MetaEntity");
+ XModelObject[] es = o.getChildren("MetaEntity"); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) processEntity(e, es[i]);
- XModelObject[] gs = o.getChildren("MetaEntityGroup");
+ XModelObject[] gs = o.getChildren("MetaEntityGroup"); //$NON-NLS-1$
for (int i = 0; i < gs.length; i++) processGroup(e, gs[i]);
}
protected void processEntity(Element e, XModelObject o) {
XMLUtil2.hr(e);
- Element t = XMLUtil.createElement(e, "table");
+ Element t = XMLUtil.createElement(e, "table"); //$NON-NLS-1$
XMLUtil2.entityRow(t, "Name:", o.getAttributeValue(XModelObjectConstants.ATTR_NAME));
- XMLUtil2.simpleRow(t, "Editor:", o.getAttributeValue("editor"));
+ XMLUtil2.simpleRow(t, "Editor:", o.getAttributeValue("editor")); //$NON-NLS-2$
processHierarchy(e, o);
- processAttributeList(e, o.getChildren("MetaAttributes")[0]);
- processActionList(e, o.getChildren("MetaActionList")[0]);
+ processAttributeList(e, o.getChildren("MetaAttributes")[0]); //$NON-NLS-1$
+ processActionList(e, o.getChildren("MetaActionList")[0]); //$NON-NLS-1$
}
protected void processHierarchy(Element e, XModelObject o) {
- Element t = XMLUtil.createElement(e, "table");
- t.setAttribute("width", "600");
- Element tr = XMLUtil.createElement(t, "tr");
+ Element t = XMLUtil.createElement(e, "table"); //$NON-NLS-1$
+ t.setAttribute("width", "600"); //$NON-NLS-1$ //$NON-NLS-2$
+ Element tr = XMLUtil.createElement(t, "tr"); //$NON-NLS-1$
for (int i = 0; i < 2; i++) {
- Element td = XMLUtil.createElement(tr, "td");
- td.setAttribute("width", "300");
+ Element td = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td.setAttribute("width", "300"); //$NON-NLS-1$ //$NON-NLS-2$
}
- tr = XMLUtil.createElement(t, "tr");
- Element td = XMLUtil.createElement(tr, "td");
- td.setAttribute("valign", "top");
+ tr = XMLUtil.createElement(t, "tr"); //$NON-NLS-1$
+ Element td = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td.setAttribute("valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$
processParents(td, o);
- td = XMLUtil.createElement(tr, "td");
- td.setAttribute("valign", "top");
- processChildren(td, o.getChildren("MetaChildren")[0]);
+ td = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td.setAttribute("valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$
+ processChildren(td, o.getChildren("MetaChildren")[0]); //$NON-NLS-1$
}
@@ -118,12 +117,12 @@
ArrayList<String> v = parents.get(o);
if(v.size() == 0) {
XMLUtil2.createText(lt, "None");
- XMLUtil.createElement(lt, "br");
+ XMLUtil.createElement(lt, "br"); //$NON-NLS-1$
} else for (int i = 0; i < v.size(); i++) {
- Element s = XMLUtil.createElement(lt, "span");
- s.setAttribute("class", "value");
+ Element s = XMLUtil.createElement(lt, "span"); //$NON-NLS-1$
+ s.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createEntityReference(s, v.get(i));
- XMLUtil.createElement(lt, "br");
+ XMLUtil.createElement(lt, "br"); //$NON-NLS-1$
}
}
@@ -135,78 +134,78 @@
return;
}
Element t = createTable(lt);
- Element tr = XMLUtil.createElement(t, "tr");
+ Element tr = XMLUtil.createElement(t, "tr"); //$NON-NLS-1$
createHeaderCell(tr, "Name", 0);
createHeaderCell(tr, "Required", 0);
for (int i = 0; i < as.length; i++) {
- tr = XMLUtil.createElement(tr, "tr");
- Element td = XMLUtil.createElement(tr, "td");
- td.setAttribute("class", "value");
+ tr = XMLUtil.createElement(tr, "tr"); //$NON-NLS-1$
+ Element td = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createEntityReference(td, as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
- createValueCell(tr, as[i].getAttributeValue("required"));
+ createValueCell(tr, as[i].getAttributeValue("required")); //$NON-NLS-1$
}
}
protected void processAttributeList(Element e, XModelObject o) {
Element lt = XMLUtil2.createSubTitle(e, "Attribute List:");
Element t = createTable(lt);
- Element tr = XMLUtil.createElement(t, "tr");
+ Element tr = XMLUtil.createElement(t, "tr"); //$NON-NLS-1$
createHeaderCell(tr, "Name", 130);
createHeaderCell(tr, "Visible", 50);
createHeaderCell(tr, "Editor", 0);
createHeaderCell(tr, "Default Value", 0);
createHeaderCell(tr, "Possible Values", 0);
- XModelObject[] as = o.getChildren("MetaAttribute");
+ XModelObject[] as = o.getChildren("MetaAttribute"); //$NON-NLS-1$
for (int i = 0; i < as.length; i++) {
- tr = XMLUtil.createElement(tr, "tr");
+ tr = XMLUtil.createElement(tr, "tr"); //$NON-NLS-1$
createValueCell(tr, as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
- createValueCell(tr, as[i].getAttributeValue("visibility"));
- XModelObject oe = as[i].getChildren("MetaAttributeEditor")[0];
+ createValueCell(tr, as[i].getAttributeValue("visibility")); //$NON-NLS-1$
+ XModelObject oe = as[i].getChildren("MetaAttributeEditor")[0]; //$NON-NLS-1$
String ed = oe.getAttributeValue(XModelObjectConstants.ATTR_NAME);
createValueCell(tr, ed);
- String dv = as[i].getAttributeValue("default value");
+ String dv = as[i].getAttributeValue("default value"); //$NON-NLS-1$
createValueCell(tr, dv);
- XModelObject oc = as[i].getChildren("MetaAttributeConstraint")[0];
- String cl = oc.getAttributeValue("loader");
- if(cl.startsWith("List")) {
+ XModelObject oc = as[i].getChildren("MetaAttributeConstraint")[0]; //$NON-NLS-1$
+ String cl = oc.getAttributeValue("loader"); //$NON-NLS-1$
+ if(cl.startsWith("List")) { //$NON-NLS-1$
processListConstraint(tr, oc);
- } else if(cl.length() == 0 && "Uneditable".equals(ed)) {
+ } else if(cl.length() == 0 && "Uneditable".equals(ed)) { //$NON-NLS-1$
createValueCell(tr, dv);
- } else if(cl.length() == 0 && "Int".equals(ed)) {
- createValueCell(tr, "integer");
+ } else if(cl.length() == 0 && "Int".equals(ed)) { //$NON-NLS-1$
+ createValueCell(tr, "integer"); //$NON-NLS-1$
} else {
- createValueCell(tr, "any");
+ createValueCell(tr, "any"); //$NON-NLS-1$
}
}
}
Element createTable(Element e) {
- Element t = XMLUtil.createElement(e, "table");
- t.setAttribute("border", "1");
- t.setAttribute("cellspacing", "0");
- t.setAttribute("cellpadding", "2");
+ Element t = XMLUtil.createElement(e, "table"); //$NON-NLS-1$
+ t.setAttribute("border", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+ t.setAttribute("cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$
+ t.setAttribute("cellpadding", "2"); //$NON-NLS-1$ //$NON-NLS-2$
return t;
}
void createHeaderCell(Element e, String name, int width) {
- Element td = XMLUtil.createElement(e, "td");
- td.setAttribute("class", XModelObjectConstants.ATTR_NAME);
- if(width > 0) td.setAttribute("width", "" + width);
+ Element td = XMLUtil.createElement(e, "td"); //$NON-NLS-1$
+ td.setAttribute("class", XModelObjectConstants.ATTR_NAME); //$NON-NLS-1$
+ if(width > 0) td.setAttribute("width", "" + width); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createText(td, name);
}
void createValueCell(Element e, String value) {
- Element td = XMLUtil.createElement(e, "td");
- if(value.length() == 0) value = " ";
- td.setAttribute("class", "value");
+ Element td = XMLUtil.createElement(e, "td"); //$NON-NLS-1$
+ if(value.length() == 0) value = " "; //$NON-NLS-1$
+ td.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createText(td, value);
}
void processListConstraint(Element e, XModelObject o) {
- Element td = XMLUtil.createElement(e, "td");
+ Element td = XMLUtil.createElement(e, "td"); //$NON-NLS-1$
XModelObject[] vs = o.getChildren();
for (int i = 0; i < vs.length; i++) {
- Element s = XMLUtil.createElement(td, "span");
- s.setAttribute("class", "value");
+ Element s = XMLUtil.createElement(td, "span"); //$NON-NLS-1$
+ s.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createText(s, vs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
- XMLUtil.createElement(td, "br");
+ XMLUtil.createElement(td, "br"); //$NON-NLS-1$
}
}
@@ -214,7 +213,7 @@
Element lt = XMLUtil2.createSubTitle(e, "Action List:");
int i = o.getChildren().length;
if(i > 0) {
- Element ul = XMLUtil.createElement(lt, "ul");
+ Element ul = XMLUtil.createElement(lt, "ul"); //$NON-NLS-1$
processAction(ul, o);
} else {
XMLUtil2.createText(lt, "Empty");
@@ -224,19 +223,19 @@
protected void processAction(Element e, XModelObject o) {
XModelObject[] os = o.getChildren();
for (int i = 0; i < os.length; i++) {
- if("MetaActionList".equals(os[i].getModelEntity().getName())) {
- if("0".equals(os[i].getAttributeValue("group"))) {
+ if("MetaActionList".equals(os[i].getModelEntity().getName())) { //$NON-NLS-1$
+ if("0".equals(os[i].getAttributeValue("group"))) { //$NON-NLS-1$ //$NON-NLS-2$
processAction(e, os[i]);
XMLUtil2.hr(e, 100);
} else {
- Element li = XMLUtil.createElement(e, "li");
- XMLUtil2.createText(li, os[i].getAttributeValue("display name"));
- Element ul = XMLUtil.createElement(e, "ul");
+ Element li = XMLUtil.createElement(e, "li"); //$NON-NLS-1$
+ XMLUtil2.createText(li, os[i].getAttributeValue("display name")); //$NON-NLS-1$
+ Element ul = XMLUtil.createElement(e, "ul"); //$NON-NLS-1$
processAction(ul, os[i]);
}
} else {
- Element li = XMLUtil.createElement(e, "li");
- XMLUtil2.createText(li, os[i].getAttributeValue("display name"));
+ Element li = XMLUtil.createElement(e, "li"); //$NON-NLS-1$
+ XMLUtil2.createText(li, os[i].getAttributeValue("display name")); //$NON-NLS-1$
}
}
}
@@ -246,9 +245,9 @@
private Hashtable<String,ArrayList<String>> par = new Hashtable<String,ArrayList<String>>();
public void set(XModelObject o) {
- XModelObject[] cs = o.getChildren("MetaEntityGroup");
+ XModelObject[] cs = o.getChildren("MetaEntityGroup"); //$NON-NLS-1$
for (int i = 0; i < cs.length; i++) set(cs[i]);
- cs = o.getChildren("MetaEntity");
+ cs = o.getChildren("MetaEntity"); //$NON-NLS-1$
for (int i = 0; i < cs.length; i++) {
String n = cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
ent.put(n, cs[i]);
@@ -260,7 +259,7 @@
while(it.hasNext()) {
XModelObject o = (XModelObject)it.next();
String p = o.getAttributeValue(XModelObjectConstants.ATTR_NAME);
- XModelObject[] os = o.getChildren("MetaChildren")[0].getChildren();
+ XModelObject[] os = o.getChildren("MetaChildren")[0].getChildren(); //$NON-NLS-1$
for (int i = 0; i < os.length; i++) {
String n = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
ArrayList<String> v = par.get(n);
@@ -296,7 +295,7 @@
}
int i = 0;
while(i < sb.length()) {
- if(sb.charAt(i) == '&') sb.replace(i + 1, i + 5, "");
+ if(sb.charAt(i) == '&') sb.replace(i + 1, i + 5, ""); //$NON-NLS-1$
i++;
}
try {
@@ -313,11 +312,11 @@
class StyleGenerator {
public String getStyle() {
- return ".name{ font-size: 12pt; text-align: right; vertical-align:top }\n" +
- ".value{ font-size: 12pt; font-weight: bold; vertical-align:top }\n" +
- ".title{ font-size: 14pt; }\n" +
- ".listtab{ font-size: 12pt; margin-left: 20px; vertical-align:top }\n" +
- "UL{ list-style: none; margin-left: 20px; }\n";
+ return ".name{ font-size: 12pt; text-align: right; vertical-align:top }\n" + //$NON-NLS-1$
+ ".value{ font-size: 12pt; font-weight: bold; vertical-align:top }\n" + //$NON-NLS-1$
+ ".title{ font-size: 14pt; }\n" + //$NON-NLS-1$
+ ".listtab{ font-size: 12pt; margin-left: 20px; vertical-align:top }\n" + //$NON-NLS-1$
+ "UL{ list-style: none; margin-left: 20px; }\n"; //$NON-NLS-1$
}
}
@@ -327,49 +326,49 @@
}
public static void hr(Element e) {
- XMLUtil.createElement(e, "hr");
+ XMLUtil.createElement(e, "hr"); //$NON-NLS-1$
}
public static void hr(Element e, int length) {
- Element h = XMLUtil.createElement(e, "hr");
- h.setAttribute("width", "" + length);
- h.setAttribute("align", "left");
+ Element h = XMLUtil.createElement(e, "hr"); //$NON-NLS-1$
+ h.setAttribute("width", "" + length); //$NON-NLS-1$ //$NON-NLS-2$
+ h.setAttribute("align", "left"); //$NON-NLS-1$ //$NON-NLS-2$
}
public static void simpleRow(Element e, String name, String value) {
- Element tr = XMLUtil.createElement(e, "tr");
- Element td1 = XMLUtil.createElement(tr, "td");
- td1.setAttribute("class", XModelObjectConstants.ATTR_NAME);
+ Element tr = XMLUtil.createElement(e, "tr"); //$NON-NLS-1$
+ Element td1 = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td1.setAttribute("class", XModelObjectConstants.ATTR_NAME); //$NON-NLS-1$
createText(td1, name);
- Element td2 = XMLUtil.createElement(tr, "td");
- td1.setAttribute("class", "value");
+ Element td2 = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td1.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
createText(td2, value);
}
public static Element createSubTitle(Element e, String title) {
- Element p = XMLUtil.createElement(e, "p");
- p.setAttribute("class", "title");
+ Element p = XMLUtil.createElement(e, "p"); //$NON-NLS-1$
+ p.setAttribute("class", "title"); //$NON-NLS-1$ //$NON-NLS-2$
XMLUtil2.createText(p, title);
- Element lt = XMLUtil.createElement(e, "p");
- lt.setAttribute("class", "listtab");
+ Element lt = XMLUtil.createElement(e, "p"); //$NON-NLS-1$
+ lt.setAttribute("class", "listtab"); //$NON-NLS-1$ //$NON-NLS-2$
return lt;
}
public static void entityRow(Element e, String name, String value) {
- Element tr = XMLUtil.createElement(e, "tr");
- Element td1 = XMLUtil.createElement(tr, "td");
- td1.setAttribute("class", XModelObjectConstants.ATTR_NAME);
+ Element tr = XMLUtil.createElement(e, "tr"); //$NON-NLS-1$
+ Element td1 = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td1.setAttribute("class", XModelObjectConstants.ATTR_NAME); //$NON-NLS-1$
createText(td1, name);
- Element td2 = XMLUtil.createElement(tr, "td");
- td1.setAttribute("class", "value");
- Element a = XMLUtil.createElement(td2, "a");
+ Element td2 = XMLUtil.createElement(tr, "td"); //$NON-NLS-1$
+ td1.setAttribute("class", "value"); //$NON-NLS-1$ //$NON-NLS-2$
+ Element a = XMLUtil.createElement(td2, "a"); //$NON-NLS-1$
a.setAttribute(XModelObjectConstants.ATTR_NAME, value);
createText(a, value);
}
public static void createEntityReference(Element e, String value) {
- Element a = XMLUtil.createElement(e, "a");
- a.setAttribute("href", "#" + value);
+ Element a = XMLUtil.createElement(e, "a"); //$NON-NLS-1$
+ a.setAttribute("href", "#" + value); //$NON-NLS-1$ //$NON-NLS-2$
createText(a, value);
}
}
@@ -387,16 +386,16 @@
char cx = keys[i].charAt(0);
if(cx != c) {
c = cx;
- XMLUtil2.createSubTitle(element, "" + c);
+ XMLUtil2.createSubTitle(element, "" + c); //$NON-NLS-1$
}
XMLUtil2.createEntityReference(element, keys[i]);
}
}
private void processGroup(XModelObject o) {
- XModelObject[] es = o.getChildren("MetaEntity");
+ XModelObject[] es = o.getChildren("MetaEntity"); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) list.put(es[i].getAttributeValue(XModelObjectConstants.ATTR_NAME), es[i]);
- XModelObject[] gs = o.getChildren("MetaEntityGroup");
+ XModelObject[] gs = o.getChildren("MetaEntityGroup"); //$NON-NLS-1$
for (int i = 0; i < gs.length; i++) processGroup(gs[i]);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.impl.documentation;
+import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Set;
@@ -26,10 +27,10 @@
public MetaValidator() {}
public void validate(XModelObject metaroot) {
- if(!"MetaRoot".equals(metaroot.getModelEntity().getName()))
- throw new IllegalArgumentException("Meta validator must be called with MetaRoot.");
- iv.validate(metaroot.getChildren("MetaIcons")[0]);
- ev.validate(metaroot.getChildren("MetaEntities")[0]);
+ if(!"MetaRoot".equals(metaroot.getModelEntity().getName())) //$NON-NLS-1$
+ throw new IllegalArgumentException("Meta validator must be called with MetaRoot."); //$NON-NLS-1$
+ iv.validate(metaroot.getChildren("MetaIcons")[0]); //$NON-NLS-1$
+ ev.validate(metaroot.getChildren("MetaEntities")[0]); //$NON-NLS-1$
//// mv.validate(metaroot.getChildren("MetaMappings")[0]);
}
@@ -38,13 +39,13 @@
}
public static final String id(XModelObject object) {
- return object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
+ return object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + //$NON-NLS-1$
object.getModelEntity().getRenderer().getTitle(object);
}
public static boolean isBasic(XModelObject object) {
String e = object.getModelEntity().getName();
- return ("MetaEntity".equals(e) || "MetaMapping".equals(e));
+ return ("MetaEntity".equals(e) || "MetaMapping".equals(e)); //$NON-NLS-1$ //$NON-NLS-2$
}
public static String entityId(XModelObject object) {
@@ -52,19 +53,20 @@
if(isBasic(object)) return id(object);
object = object.getParent();
}
- return "!!!!!!!!!!!!";
+ return "!!!!!!!!!!!!"; //$NON-NLS-1$
}
public static final String longid(XModelObject object) {
- return id(object) + ((isBasic(object)) ? "" : " of " + entityId(object));
+ return id(object) + ((isBasic(object)) ? "" : MessageFormat.format(" of {0}", entityId(object))); //$NON-NLS-1$
}
public static final void checkClass(XModelObject object, String attribute, boolean mandatory, String mapping) {
- checkClass(object, attribute, "", mandatory, mapping);
+ checkClass(object, attribute, "", mandatory, mapping); //$NON-NLS-1$
}
public static final void checkClass(XModelObject object, String attribute, String prefix, boolean mandatory, String mapping) {
- String pref = "Error in attribute '" + attribute + "' in " + longid(object) + ": ";
+ String pref = MessageFormat.format("Error in attribute ''{0}'' in {1}: ", attribute,
+ longid(object));
String classname = object.getAttributeValue(attribute);
int i = classname.indexOf('%');
if(classname.length() == 0) {
@@ -72,26 +74,26 @@
message(pref + " class name cannot be empty.");
} else if(i == 0) {
if(mapping == null) {
- message(pref + " alias " + classname + " is not allowed.");
+ message(pref + (MessageFormat.format(" alias {0} is not allowed.", classname)));
} else if(classname.charAt(classname.length() - 1) != '%') {
- message(pref + " incorrect alias " + classname);
+ message(pref + (MessageFormat.format(" incorrect alias {0}", classname)));
} else {
MappingsValidator.classmappings.add(mapping);
String alias = classname.substring(1, classname.length() - 1);
- XModelObject v = object.getModel().getByPath("MetaModel/Mappings/" + mapping);
- if(v == null) message("Mapping " + mapping + " is not found.");
+ XModelObject v = object.getModel().getByPath("MetaModel/Mappings/" + mapping); //$NON-NLS-1$
+ if(v == null) message(MessageFormat.format("Mapping {0} is not found.", mapping));
if(v.getChildByPath(alias) != null) return;
- message(pref + " incorrect alias " + classname);
+ message(pref + (MessageFormat.format(" incorrect alias {0}", classname)));
}
} else {
try {
Class.forName(prefix + classname).newInstance();
} catch (ClassNotFoundException e) {
- message(pref + " class '" + classname + "' not found.");
+ message(pref + (MessageFormat.format(" class ''{0}'' not found.", classname)));
} catch (InstantiationException e) {
- message(pref + " class '" + classname + "' not found.");
+ message(pref + (MessageFormat.format(" class ''{0}'' not found.", classname)));
} catch (IllegalAccessException e) {
- message(pref + " class '" + classname + "' not found.");
+ message(pref + (MessageFormat.format(" class ''{0}'' not found.", classname)));
}
}
}
@@ -107,15 +109,17 @@
}
private void validate2(XModelObject object) {
- XModelObject[] gs = object.getChildren("MetaIconGroup");
+ XModelObject[] gs = object.getChildren("MetaIconGroup"); //$NON-NLS-1$
for (int i = 0; i < gs.length; i++) validate2(gs[i]);
- XModelObject[] is = object.getChildren("MetaIcon");
+ XModelObject[] is = object.getChildren("MetaIcon"); //$NON-NLS-1$
for (int i = 0; i < is.length; i++) {
String s = is[i].getPath().substring(iconsrootlength).replace('/', '.');
- String p = is[i].getAttributeValue("path");
+ String p = is[i].getAttributeValue("path"); //$NON-NLS-1$
icons.addElement(s);
if(int.class.getResource(p) == null)
- MetaValidator.message("Error in icon " + s + ": Resource " + p + " is not found.");
+ MetaValidator.message(MessageFormat.format(
+ "Error in icon {0}: Resource {1} is not found.", s,
+ p));
}
}
@@ -129,15 +133,15 @@
public void validate(XModelObject object) {
collect(object);
- XModelObject[] gs = object.getChildren("MetaEntityGroup");
+ XModelObject[] gs = object.getChildren("MetaEntityGroup"); //$NON-NLS-1$
for (int i = 0; i < gs.length; i++) validate(gs[i]);
- XModelObject[] es = object.getChildren("MetaEntity");
+ XModelObject[] es = object.getChildren("MetaEntity"); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) {
- MetaValidator.checkClass(es[i], "implementation", true, null);
- MetaValidator.checkClass(es[i], "loader", false, null);
- MetaValidator.checkClass(es[i], "generator", false, null);
- MetaValidator.checkClass(es[i], "editor", false, "ObjectEditor");
- MetaValidator.checkClass(es[i], "adopt manager", false, null);
+ MetaValidator.checkClass(es[i], "implementation", true, null); //$NON-NLS-1$
+ MetaValidator.checkClass(es[i], "loader", false, null); //$NON-NLS-1$
+ MetaValidator.checkClass(es[i], "generator", false, null); //$NON-NLS-1$
+ MetaValidator.checkClass(es[i], "editor", false, "ObjectEditor"); //$NON-NLS-1$ //$NON-NLS-2$
+ MetaValidator.checkClass(es[i], "adopt manager", false, null); //$NON-NLS-1$
cv.validate(es[i]);
av.validate(es[i]);
tv.validate(es[i]);
@@ -145,11 +149,11 @@
}
private void collect(XModelObject object) {
- XModelObject[] gs = object.getChildren("MetaEntityGroup");
+ XModelObject[] gs = object.getChildren("MetaEntityGroup"); //$NON-NLS-1$
for (int i = 0; i < gs.length; i++) collect(gs[i]);
- XModelObject[] es = object.getChildren("MetaEntity");
+ XModelObject[] es = object.getChildren("MetaEntity"); //$NON-NLS-1$
for (int i = 0; i < es.length; i++) {
- XModelObject[] as = es[i].getChildByPath("Attributes").getChildren();
+ XModelObject[] as = es[i].getChildByPath("Attributes").getChildren(); //$NON-NLS-1$
Vector<String> v = new Vector<String>();
for (int j = 0; j < as.length; j++) v.addElement(as[j].getAttributeValue(XModelObjectConstants.ATTR_NAME));
entities.put(es[i].getAttributeValue(XModelObjectConstants.ATTR_NAME), v);
@@ -159,12 +163,14 @@
class ChildrenValidator {
public void validate(XModelObject object) {
- XModelObject[] cs = object.getChildByPath("Children").getChildren();
+ XModelObject[] cs = object.getChildByPath("Children").getChildren(); //$NON-NLS-1$
for (int i = 0; i < cs.length; i++) {
String c = cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
if(EntitiesValidator.entities.get(c) == null) {
- MetaValidator.message("Error in " + MetaValidator.id(object) +
- ": child " + c + " not found in the entity list.");
+ MetaValidator.message(MessageFormat
+ .format(
+ "Error in {0}: child {1} not found in the entity list.",
+ MetaValidator.id(object), c));
}
}
}
@@ -173,17 +179,19 @@
class AttributesValidator {
public void validate(XModelObject object) {
- XModelObject[] as = object.getChildByPath("Attributes").getChildren();
+ XModelObject[] as = object.getChildByPath("Attributes").getChildren(); //$NON-NLS-1$
for (int i = 0; i < as.length; i++) {
String an = as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
- MetaValidator.checkClass(as[i], "loader", "org.jboss.tools.common.meta.impl.adapters.XAdapter", false, null);
- XModelObject ed = as[i].getChildren("MetaAttributeEditor")[0];
+ MetaValidator.checkClass(as[i], "loader", "org.jboss.tools.common.meta.impl.adapters.XAdapter", false, null); //$NON-NLS-1$ //$NON-NLS-2$
+ XModelObject ed = as[i].getChildren("MetaAttributeEditor")[0]; //$NON-NLS-1$
String en = ed.getAttributeValue(XModelObjectConstants.ATTR_NAME);
- if("GUI".equals(en)) continue;
- XModelObject mi = ed.getModel().getByPath("MetaModel/Mappings/AttributeEditor/" + en);
+ if("GUI".equals(en)) continue; //$NON-NLS-1$
+ XModelObject mi = ed.getModel().getByPath("MetaModel/Mappings/AttributeEditor/" + en); //$NON-NLS-1$
if(mi == null) {
- MetaValidator.message("Error in attribute '" + an + "' of " +
- MetaValidator.id(object) + ": incorrect editor '" + en + "'.");
+ MetaValidator.message(MessageFormat
+ .format(
+ "Error in attribute ''{0}'' of {1}: incorrect editor ''{2}''.",
+ an, MetaValidator.id(object), en));
}
}
}
@@ -193,21 +201,20 @@
private EntityDataValidator dv = new EntityDataValidator();
public void validate(XModelObject object) {
- XModelObject[] ls = object.getChildren("MetaActionList");
+ XModelObject[] ls = object.getChildren("MetaActionList"); //$NON-NLS-1$
for (int i = 0; i < ls.length; i++) validate(ls[i]);
- XModelObject[] as = object.getChildren("MetaAction");
+ XModelObject[] as = object.getChildren("MetaAction"); //$NON-NLS-1$
for (int i = 0; i < as.length; i++) {
// String n = as[i].getAttributeValue("display name");
- String in = as[i].getAttributeValue("icon");
+ String in = as[i].getAttributeValue("icon"); //$NON-NLS-1$
if(in.trim().length() == 0)
- MetaValidator.message("Error in " + MetaValidator.longid(as[i]) +
- ": icon not specified");
+ MetaValidator.message(MessageFormat.format("Error in {0}: icon not specified", MetaValidator.longid(as[i])));
if(in.length() > 0 && !IconsValidator.icons.contains(in))
- MetaValidator.message("Error in " + MetaValidator.longid(as[i]) +
- ": icon '" + in + "' not found");
- MetaValidator.checkClass(as[i], "handler", true, null);
- String wm = (System.getProperty("testmodel") != null) ? "TestWizards" : "Wizards";
- MetaValidator.checkClass(as[i], "wizard", false, wm);
+ MetaValidator.message(MessageFormat.format("Error in {0}: icon ''{1}'' not found",
+ MetaValidator.longid(as[i]), in));
+ MetaValidator.checkClass(as[i], "handler", true, null); //$NON-NLS-1$
+ String wm = (System.getProperty("testmodel") != null) ? "TestWizards" : "Wizards"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ MetaValidator.checkClass(as[i], "wizard", false, wm); //$NON-NLS-1$
dv.validate(as[i]);
}
}
@@ -215,20 +222,22 @@
class EntityDataValidator {
public void validate(XModelObject object) {
- XModelObject[] ds = object.getChildren("MetaEntityData");
+ XModelObject[] ds = object.getChildren("MetaEntityData"); //$NON-NLS-1$
for (int i = 0; i < ds.length; i++) {
- String en = ds[i].getAttributeValue("entity name");
+ String en = ds[i].getAttributeValue("entity name"); //$NON-NLS-1$
Vector v = (Vector)EntitiesValidator.entities.get(en);
if(v == null) {
- MetaValidator.message("Error in " + MetaValidator.longid(object) +
- ": entity '" + en + "' not found.");
+ MetaValidator.message(MessageFormat.format("Error in {0}: entity ''{1}'' not found.",
+ MetaValidator.longid(object), en));
} else {
- XModelObject[] as = ds[i].getChildren("MetaAttributeData");
+ XModelObject[] as = ds[i].getChildren("MetaAttributeData"); //$NON-NLS-1$
for (int j = 0; j < as.length; j++) {
- String an = as[j].getAttributeValue("attribute name");
+ String an = as[j].getAttributeValue("attribute name"); //$NON-NLS-1$
if(v.contains(an)) continue;
- MetaValidator.message("Error in " + MetaValidator.longid(object) +
- ": attribute '" + an + "' not found in entity " + en + ".");
+ MetaValidator.message(MessageFormat
+ .format(
+ "Error in {0}: attribute ''{1}'' not found in entity {2}.",
+ MetaValidator.longid(object), an, en));
}
}
}
@@ -240,11 +249,11 @@
public static Set<String> classmappings = new HashSet<String>();
public void validate(XModelObject object) {
- classmappings.add("FilteredTrees");
- if(System.getProperty("testmodel") != null) {
- classmappings.remove("ObjectEditor");
+ classmappings.add("FilteredTrees"); //$NON-NLS-1$
+ if(System.getProperty("testmodel") != null) { //$NON-NLS-1$
+ classmappings.remove("ObjectEditor"); //$NON-NLS-1$
} else {
- classmappings.add("AttributeEditor");
+ classmappings.add("AttributeEditor"); //$NON-NLS-1$
}
Object[] mtoc = classmappings.toArray();
for (int i = 0; i < mtoc.length; i++) {
@@ -259,7 +268,7 @@
if(object == null) return;
XModelObject[] is = object.getChildren();
for (int i = 0; i < is.length; i++)
- MetaValidator.checkClass(is[i], "value", true, null);
+ MetaValidator.checkClass(is[i], "value", true, null); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidatorHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidatorHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidatorHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -23,7 +23,7 @@
}
public boolean isEnabled(XModelObject object) {
- return (object != null && "MetaRoot".equals(object.getModelEntity().getName()));
+ return (object != null && "MetaRoot".equals(object.getModelEntity().getName())); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/KeyLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/KeyLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/KeyLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -31,7 +31,7 @@
try {
p.load(url.openConnection().getInputStream());
} catch (IOException e) {
- ModelPlugin.getPluginLog().logError("KeyLoader:load" + url);
+ ModelPlugin.getPluginLog().logError("KeyLoader:load" + url); //$NON-NLS-1$
}
Enumeration ks = p.keys();
while(ks.hasMoreElements()) {
@@ -44,15 +44,15 @@
private static Set<URL> getKeyResources(String locale) {
Set<URL> resources = new HashSet<URL>();
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.jboss.tools.common.model.keys");
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.jboss.tools.common.model.keys"); //$NON-NLS-1$
IExtension[] es = point.getExtensions();
for (int i = 0; i < es.length; i++) {
Bundle bundle = Platform.getBundle(es[i].getNamespaceIdentifier());
IConfigurationElement[] elements = es[i].getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
- String path = elements[j].getAttribute("path");
- if(path.endsWith(".properties") && locale != null && locale.length() > 0) {
- path = path.substring(0, path.length() - ".properties".length()) + "_" + locale + ".properties";
+ String path = elements[j].getAttribute("path"); //$NON-NLS-1$
+ if(path.endsWith(".properties") && locale != null && locale.length() > 0) { //$NON-NLS-1$
+ path = path.substring(0, path.length() - ".properties".length()) + "_" + locale + ".properties"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
try {
URL url = bundle.getResource(path);
@@ -60,7 +60,7 @@
resources.add(url);
}
} catch (IllegalStateException e) {
- ModelPlugin.getPluginLog().logInfo("KeyLoader: Plugin " + es[i].getNamespaceIdentifier() + " is uninstalled");
+ ModelPlugin.getPluginLog().logInfo("KeyLoader: Plugin " + es[i].getNamespaceIdentifier() + " is uninstalled"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/WizardKeys.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/WizardKeys.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/key/WizardKeys.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -29,7 +29,7 @@
addNew(keys, KeyLoader.load(localeString));
if(localeString.length() == 0) break;
int i = localeString.indexOf('_');
- localeString = (i < 0) ? "" : localeString.substring(0, i);
+ localeString = (i < 0) ? "" : localeString.substring(0, i); //$NON-NLS-1$
}
}
@@ -44,21 +44,21 @@
public static String getHeader(String key) {
if(key == null) return null;
- return keys.getProperty(key + ".WindowTitle");
+ return keys.getProperty(key + ".WindowTitle"); //$NON-NLS-1$
}
public static String getTitle(String key) {
if(key == null) return null;
- return keys.getProperty(key + ".Title");
+ return keys.getProperty(key + ".Title"); //$NON-NLS-1$
}
public static String getMessage(String key) {
if(key == null) return null;
- return keys.getProperty(key + ".Message");
+ return keys.getProperty(key + ".Message"); //$NON-NLS-1$
}
public static String getLabelText(String entity, String attribute) {
- String key = "" + entity + "." + attribute.replace(' ', '_');
+ String key = "" + entity + "." + attribute.replace(' ', '_'); //$NON-NLS-1$ //$NON-NLS-2$
return keys.getProperty(key);
}
@@ -74,7 +74,7 @@
return null;
}
}
- return "@NULL_KEY@";
+ return "@NULL_KEY@"; //$NON-NLS-1$
//return (key == null) ? null : common.getProperty(key);
}
@@ -96,7 +96,7 @@
public static String getAttributeDisplayName(XAttribute a) {
String s = getLabelText(a.getModelEntity().getName(), a.getName());
if(s == null) {
- String labelText = a.getModelEntity().getName() + "_" + a.getName();
+ String labelText = a.getModelEntity().getName() + "_" + a.getName(); //$NON-NLS-1$
s = getLabelText(labelText);
}
if(s == null) {
@@ -109,16 +109,16 @@
private static Set<String> UPPER_CASE_WORDS = new HashSet<String>();
static {
- String[] lcw = new String[]{"the", "web.xml", "for"};
- String[] ucw = new String[]{"tld", "uri", "jsp", "html", "url", "jsf", "xml",
- "id", "jms", "esb", "ftp", "jbr", "fs", "mep"};
+ String[] lcw = new String[]{"the", "web.xml", "for"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String[] ucw = new String[]{"tld", "uri", "jsp", "html", "url", "jsf", "xml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "id", "jms", "esb", "ftp", "jbr", "fs", "mep"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
for (int i = 0; i < lcw.length; i++) LOWER_CASE_WORDS.add(lcw[i]);
for (int i = 0; i < ucw.length; i++) UPPER_CASE_WORDS.add(ucw[i]);
}
public static String toDisplayName(String n) {
- if(n == null || n.length() == 0) return "";
- StringTokenizer st = new StringTokenizer(n, " -", true);
+ if(n == null || n.length() == 0) return ""; //$NON-NLS-1$
+ StringTokenizer st = new StringTokenizer(n, " -", true); //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
int k = st.countTokens();
for (int i = 0; i < k; i++) {
@@ -148,14 +148,14 @@
*/
public static String getMenuItemDisplayName(XActionItem item, XModelEntity entity) {
if(entity != null) {
- String key = entity.getName() + "." + item.getName() + ".menu";
+ String key = entity.getName() + "." + item.getName() + ".menu"; //$NON-NLS-1$ //$NON-NLS-2$
String s = keys.getProperty(key);
if(s != null) return s;
- key = entity.getModule() + "." + item.getName() + ".menu";
+ key = entity.getModule() + "." + item.getName() + ".menu"; //$NON-NLS-1$ //$NON-NLS-2$
s = keys.getProperty(key);
if(s != null) return s;
}
- String key = item.getName() + ".menu";
+ String key = item.getName() + ".menu"; //$NON-NLS-1$
String s = keys.getProperty(key);
if(s != null) return s;
@@ -166,10 +166,10 @@
if(attr == null || value == null || value.length() == 0) return value;
String keyPart = toKey(value);
String module = attr.getModelEntity().getModule();
- String key1 = module + "." + "lists." + keyPart;
+ String key1 = module + "." + "lists." + keyPart; //$NON-NLS-1$ //$NON-NLS-2$
String result = WizardKeys.getString(key1);
if(result != null) return result;
- String key2 = "lists." + keyPart;
+ String key2 = "lists." + keyPart; //$NON-NLS-1$
result = WizardKeys.getString(key2);
if(result != null) return result;
return value;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/ServiceDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/ServiceDialog.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/ServiceDialog.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -27,12 +27,12 @@
public void showDialog(SpecialWizardSupport support);
- public String DIALOG_MESSAGE = "message";
- public String CHECKBOX_MESSAGE = "checkboxMessage";
- public String CHECKED = "checked";
- public String SEPARATOR = "separator";
- public String BUTTONS = "buttons";
- public static String RETURN_CODE = "returnCode";
+ public String DIALOG_MESSAGE = "message"; //$NON-NLS-1$
+ public String CHECKBOX_MESSAGE = "checkboxMessage"; //$NON-NLS-1$
+ public String CHECKED = "checked"; //$NON-NLS-1$
+ public String SEPARATOR = "separator"; //$NON-NLS-1$
+ public String BUTTONS = "buttons"; //$NON-NLS-1$
+ public static String RETURN_CODE = "returnCode"; //$NON-NLS-1$
public boolean openConfirm(Properties p);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -23,8 +23,6 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.internal.decorators.DecoratorManager;
import org.eclipse.ui.progress.UIJob;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.osgi.framework.Bundle;
public class XJob extends WorkspaceJob {
public static Object FAMILY_XJOB = new Object();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelConstants.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelConstants.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -13,20 +13,20 @@
import java.util.*;
public class XModelConstants {
- public static String HOME = "product.home";
+ public static String HOME = "product.home"; //$NON-NLS-1$
- public static String WORKSPACE = "workspace.home";
- public static String WORKSPACE_REF = "%" + WORKSPACE + "%";
+ public static String WORKSPACE = "workspace.home"; //$NON-NLS-1$
+ public static String WORKSPACE_REF = "%" + WORKSPACE + "%"; //$NON-NLS-1$ //$NON-NLS-2$
- public static String WORKSPACE_OLD = "redhat.workspace";
- public static String WORKSPACE_OLD_REF = "%" + WORKSPACE_OLD + "%";
+ public static String WORKSPACE_OLD = "redhat.workspace"; //$NON-NLS-1$
+ public static String WORKSPACE_OLD_REF = "%" + WORKSPACE_OLD + "%"; //$NON-NLS-1$ //$NON-NLS-2$
- public static String MODEL_VERSION = "version";
+ public static String MODEL_VERSION = "version"; //$NON-NLS-1$
- public static String XMODEL_ENTITY_ATTR = "model-entity";
- public static String XMODEL_ENTITY_ATTR_OLD = "ENTITY";
+ public static String XMODEL_ENTITY_ATTR = "model-entity"; //$NON-NLS-1$
+ public static String XMODEL_ENTITY_ATTR_OLD = "ENTITY"; //$NON-NLS-1$
- public static String AUTOLOAD = "autoload";
+ public static String AUTOLOAD = "autoload"; //$NON-NLS-1$
private XModelConstants() {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelFactory.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModelFactory.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
*/
public class XModelFactory {
- static public final String META_PATH = "/meta";
+ static public final String META_PATH = "/meta"; //$NON-NLS-1$
private static XModel defaultInstance = null;
private static Object monitor = new Object();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/adapter/ModelObjectAdapterExtensionPoint.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/adapter/ModelObjectAdapterExtensionPoint.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/adapter/ModelObjectAdapterExtensionPoint.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
import org.osgi.framework.Bundle;
public class ModelObjectAdapterExtensionPoint {
- static String POINT_ID = "org.jboss.tools.common.model.modelObjectAdapter";
+ static String POINT_ID = "org.jboss.tools.common.model.modelObjectAdapter"; //$NON-NLS-1$
static ModelObjectAdapterExtensionPoint instance;
IExtensionPoint point = null;
@@ -39,17 +39,17 @@
IConfigurationElement[] cs = es[i].getConfigurationElements();
for (int j = 0; j < cs.length; j++) {
Bundle bundle = Platform.getBundle(es[i].getNamespaceIdentifier());
- String iclassname = cs[j].getAttribute("iclass");
- String classname = cs[j].getAttribute("class");
+ String iclassname = cs[j].getAttribute("iclass"); //$NON-NLS-1$
+ String classname = cs[j].getAttribute("class"); //$NON-NLS-1$
Class cls = null;
try {
cls = bundle.loadClass(classname);
} catch (ClassNotFoundException e) {
- ModelPlugin.getPluginLog().logError("Cannot load editor class " + classname + " from " + es[i].getNamespaceIdentifier());
+ ModelPlugin.getPluginLog().logError("Cannot load editor class " + classname + " from " + es[i].getNamespaceIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
if(!IModelObjectAdapter.class.isAssignableFrom(cls)) {
- ModelPlugin.getPluginLog().logInfo("Class " + classname + " must implement IModelObjectAdapter");
+ ModelPlugin.getPluginLog().logInfo("Class " + classname + " must implement IModelObjectAdapter"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
adapters.put(iclassname, cls);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -65,7 +65,7 @@
}
protected String fileName(XModelObject object) {
- return object.getModelEntity().getName().toLowerCase() + ".rex";
+ return object.getModelEntity().getName().toLowerCase() + ".rex"; //$NON-NLS-1$
}
public static void merge(XModelObject object, XModelObject update) throws XModelException {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.engines.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.*;
@@ -32,7 +33,8 @@
Long[] ls = map.keySet().toArray(new Long[0]);
for (int i = 0; i < ls.length; i++) {
s.stopInstance(path, ls[i].longValue());
- object.getModel().getOut().println("Process executing " + FindObjectHelper.makeRef(object) + " (" + new Date(ls[i].longValue()) + ") stopped.");
+ object.getModel().getOut().println(MessageFormat.format("Process executing {0} ({1}) stopped.",
+ FindObjectHelper.makeRef(object), new Date(ls[i].longValue())));
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -103,11 +103,11 @@
}
protected void appendJava(ArrayList<String> l, Properties p) {
- l.add(getJavaHome(p) + "/bin/java");
+ l.add(getJavaHome(p) + "/bin/java"); //$NON-NLS-1$
}
protected String getJavaHome(Properties p) {
- File f = new File(p.getProperty("java.home"));
+ File f = new File(p.getProperty("java.home")); //$NON-NLS-1$
return f.getAbsolutePath().replace('\\', '/');
//// return f.getParent().replace('\\', '/');
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/XActionAgentEvent.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/XActionAgentEvent.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/XActionAgentEvent.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,10 +11,10 @@
package org.jboss.tools.common.model.event;
public class XActionAgentEvent {
- public static final String BASE = "Base";
- public static final String DEFAULT = BASE + ".Out";
- public static final String COMPILATION = BASE + ".Compilation";
- public static final String SOURCE_VIEW = "Source View";
+ public static final String BASE = "Base"; //$NON-NLS-1$
+ public static final String DEFAULT = BASE + ".Out"; //$NON-NLS-1$
+ public static final String COMPILATION = BASE + ".Compilation"; //$NON-NLS-1$
+ public static final String SOURCE_VIEW = "Source View"; //$NON-NLS-1$
private String id = DEFAULT;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.files.handlers;
import java.io.*;
+import java.text.MessageFormat;
import java.util.*;
import org.eclipse.core.resources.IResource;
@@ -29,8 +30,8 @@
import org.jboss.tools.common.util.FileUtil;
public class CreateFileSupport extends SpecialWizardSupport {
- static final String ATTR_TEMPLATE = "template";
- static final String ATTR_FOLDER = "folder";
+ static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
+ static final String ATTR_FOLDER = "folder"; //$NON-NLS-1$
protected TargetHolder targetHolder = new TargetHolder();
TreeMap<String,String> versionEntities = new TreeMap<String,String>();
@@ -59,11 +60,11 @@
targetHolder.target = getTarget();
IResource r = (IResource)getTarget().getAdapter(IResource.class);
if(r == null) {
- setAttributeValue(0, ATTR_FOLDER, "");
+ setAttributeValue(0, ATTR_FOLDER, ""); //$NON-NLS-1$
targetHolder.revalidate(null);
} else {
targetHolder.revalidate(r.getFullPath().toString());
- setAttributeValue(0, ATTR_FOLDER, "" + targetHolder.path);
+ setAttributeValue(0, ATTR_FOLDER, "" + targetHolder.path); //$NON-NLS-1$
}
initVersions();
}
@@ -75,11 +76,11 @@
useVersions = false;
versionEntities.clear();
XModelMetaData meta = getTarget().getModel().getMetaData();
- XMapping m = meta.getMapping("FileVersions");
+ XMapping m = meta.getMapping("FileVersions"); //$NON-NLS-1$
if(m == null) return;
- String entityVersion = action.getProperty("entityVersion");
+ String entityVersion = action.getProperty("entityVersion"); //$NON-NLS-1$
if(entityVersion == null || entityVersion.length() == 0) return;
- if(getAttributeValue(0, "version") == null) return;
+ if(getAttributeValue(0, "version") == null) return; //$NON-NLS-1$
useVersions = true;
String[] keys = m.getKeys();
for (int i = 0; i < keys.length; i++) {
@@ -90,12 +91,12 @@
versionEntities.put(version, entity);
}
if(versionEntities.size() == 0 && action.getProperty(XMetaDataConstants.ENTITY) != null) {
- versionEntities.put("default", action.getProperty(XMetaDataConstants.ENTITY));
+ versionEntities.put("default", action.getProperty(XMetaDataConstants.ENTITY)); //$NON-NLS-1$
}
String[] versionList = (String[])versionEntities.keySet().toArray(new String[0]);
- setValueList(0, "version", versionList);
+ setValueList(0, "version", versionList); //$NON-NLS-1$
if(versionList.length > 0) {
- setAttributeValue(0, "version", versionList[0]);
+ setAttributeValue(0, "version", versionList[0]); //$NON-NLS-1$
}
}
@@ -131,7 +132,9 @@
protected boolean checkResource() {
if(targetHolder.addPath.length() == 0) return true;
ServiceDialog d = getTarget().getModel().getService();
- String message = "Folder " + targetHolder.path + " does not exist. Do you want to create it?";
+ String message = MessageFormat.format(
+ "Folder {0} does not exist. Do you want to create it?",
+ targetHolder.path);
int q = d.showDialog(ModelMessages.WARNING, message, new String[]{SpecialWizardSupport.OK, SpecialWizardSupport.CANCEL}, null, ServiceDialog.QUESTION);
return q == 0;
}
@@ -153,7 +156,7 @@
boolean isCorrectPath(String path) {
path = revalidatePath(path);
- if(path == null || path.equals(XModelObjectConstants.SEPARATOR) || path.indexOf("//") >= 0) return false;
+ if(path == null || path.equals(XModelObjectConstants.SEPARATOR) || path.indexOf("//") >= 0) return false; //$NON-NLS-1$
return true;
}
@@ -167,7 +170,7 @@
protected String revalidatePath(String path) {
if(path == null || path.length() == 0) return path;
if(!path.startsWith(XModelObjectConstants.SEPARATOR)) path = XModelObjectConstants.SEPARATOR + path;
- String extension = "." + action.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
+ String extension = "." + action.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION); //$NON-NLS-1$
if(path.lastIndexOf('.') < 0) {
path += extension;
} else {
@@ -196,9 +199,10 @@
String template = getAttributeValue(0, ATTR_TEMPLATE);
if(template != null && template.trim().length() > 0) {
templateFile = findTemplate(template.trim());
- if(templateFile == null || !templateFile.isFile()) throw new IOException("Template " + template + " is not found.");
+ if(templateFile == null || !templateFile.isFile()) throw new IOException(
+ MessageFormat.format("Template {0} is not found.", template));
}
- return (templateFile == null) ? "" : FileUtil.readFile(templateFile);
+ return (templateFile == null) ? "" : FileUtil.readFile(templateFile); //$NON-NLS-1$
}
protected String modifyBody(String body) throws IOException {
@@ -220,7 +224,7 @@
String s = st.nextToken();
XModelObject o = fs.getChildByPath(s);
if(o == null) {
- o = fs.getModel().createModelObject("FileFolder", null);
+ o = fs.getModel().createModelObject("FileFolder", null); //$NON-NLS-1$
o.setAttributeValue(XModelObjectConstants.ATTR_NAME, s);
DefaultCreateHandler.addCreatedObject(fs, o, FindObjectHelper.IN_NAVIGATOR_ONLY);
((FolderImpl)o).save();
@@ -253,22 +257,22 @@
//entity could change after saving child.
f = f.getModel().getByPath(modelPath);
}
- if(f != null) getProperties().put("created", f);
+ if(f != null) getProperties().put("created", f); //$NON-NLS-1$
return f;
}
protected String getFileEntity(String extension) {
if(useVersions) {
- String version = getAttributeValue(0, "version");
+ String version = getAttributeValue(0, "version"); //$NON-NLS-1$
String entity = version == null ? null : (String)versionEntities.get(version);
if(entity != null) return entity;
}
- return ("jsp".equals(extension)) ? "FileJSP" :
- ("htm".equals(extension)) ? "FileHTML" :
- ("html".equals(extension)) ? "FileHTML" :
- ("properties".equals(extension)) ? "FilePROPERTIES" :
+ return ("jsp".equals(extension)) ? "FileJSP" : //$NON-NLS-1$ //$NON-NLS-2$
+ ("htm".equals(extension)) ? "FileHTML" : //$NON-NLS-1$ //$NON-NLS-2$
+ ("html".equals(extension)) ? "FileHTML" : //$NON-NLS-1$ //$NON-NLS-2$
+ ("properties".equals(extension)) ? "FilePROPERTIES" : //$NON-NLS-1$ //$NON-NLS-2$
(extension.equals(action.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION))) ? action.getProperty(XMetaDataConstants.ENTITY) :
- "FileAny";
+ "FileAny"; //$NON-NLS-1$
}
protected XModelObject modifyCreatedObject(XModelObject o) {
@@ -318,31 +322,35 @@
super.validate(data);
}
- String FORBIDDEN_INDICES = "\"\n\t*\\/:<>?|";
+ String FORBIDDEN_INDICES = "\"\n\t*\\/:<>?|"; //$NON-NLS-1$
protected void validateFileName(Properties data) {
if(message != null) return;
String fileName = data.getProperty(XModelObjectConstants.ATTR_NAME);
if(fileName == null || fileName.length() == 0) return;
- if(fileName.equals(".")) {
+ if(fileName.equals(".")) { //$NON-NLS-1$
message = "Incorrect file name.";
- } else if(fileName.endsWith(".") && fileName.indexOf('.') != fileName.lastIndexOf('.')) {
+ } else if(fileName.endsWith(".") && fileName.indexOf('.') != fileName.lastIndexOf('.')) { //$NON-NLS-1$
message = "File name must not end in a period.";
} else {
for (int i = 0; i < FORBIDDEN_INDICES.length(); i++) {
if(fileName.indexOf(FORBIDDEN_INDICES.charAt(i)) >= 0) {
- message = "File name must not contain character " + FORBIDDEN_INDICES.charAt(i) + " .";
+ message = MessageFormat.format(
+ "File name must not contain character {0} .",
+ FORBIDDEN_INDICES.charAt(i));
return;
}
}
}
}
- String FORBIDDEN_FOLDER_LETTERS = "\"\n\t*:<>?|";
+ String FORBIDDEN_FOLDER_LETTERS = "\"\n\t*:<>?|"; //$NON-NLS-1$
private void validateFolderName() {
if(targetHolder.addPath.length() == 0) return;
for (int i = 0; i < FORBIDDEN_FOLDER_LETTERS.length(); i++) {
if(targetHolder.addPath.indexOf(FORBIDDEN_FOLDER_LETTERS.charAt(i)) >= 0) {
- message = "Folder name must not contain character " + FORBIDDEN_FOLDER_LETTERS.charAt(i) + " .";
+ message = MessageFormat.format(
+ "Folder name must not contain character {0} .",
+ FORBIDDEN_FOLDER_LETTERS.charAt(i));
return;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFolderSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFolderSupport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFolderSupport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -1,5 +1,6 @@
package org.jboss.tools.common.model.files.handlers;
+import java.text.MessageFormat;
import java.util.Properties;
import java.util.StringTokenizer;
@@ -28,11 +29,11 @@
targetHolder.target = getTarget();
IResource r = (IResource)getTarget().getAdapter(IResource.class);
if(r == null) {
- setAttributeValue(0, "folder", "");
+ setAttributeValue(0, "folder", ""); //$NON-NLS-1$ //$NON-NLS-2$
targetHolder.revalidate(null);
} else {
targetHolder.revalidate(r.getFullPath().toString());
- setAttributeValue(0, "folder", "" + targetHolder.path);
+ setAttributeValue(0, "folder", "" + targetHolder.path); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -56,7 +57,9 @@
protected boolean checkResource() {
if(targetHolder.addPath.length() == 0) return true;
ServiceDialog d = getTarget().getModel().getService();
- String message = "Folder " + targetHolder.path + " does not exist. Do you want to create it?";
+ String message = MessageFormat.format(
+ "Folder {0} does not exist. Do you want to create it?",
+ targetHolder.path);
int q = d.showDialog(ModelMessages.WARNING, message, new String[]{SpecialWizardSupport.OK, SpecialWizardSupport.CANCEL}, null, ServiceDialog.QUESTION);
return q == 0;
}
@@ -69,7 +72,7 @@
boolean isCorrectPath(String path) {
path = revalidatePath(path);
- if(path == null || path.equals(XModelObjectConstants.SEPARATOR) || path.indexOf("//") >= 0) return false;
+ if(path == null || path.equals(XModelObjectConstants.SEPARATOR) || path.indexOf("//") >= 0) return false; //$NON-NLS-1$
return true;
}
@@ -107,7 +110,7 @@
String s = st.nextToken();
XModelObject o = fs.getChildByPath(s);
if(o == null) {
- o = fs.getModel().createModelObject("FileFolder", null);
+ o = fs.getModel().createModelObject("FileFolder", null); //$NON-NLS-1$
o.setAttributeValue(XModelObjectConstants.ATTR_NAME, s);
DefaultCreateHandler.addCreatedObject(fs, o, getProperties());
((FolderImpl)o).save();
@@ -136,7 +139,7 @@
protected class Validator extends DefaultWizardDataValidator {
public void validate(Properties data) {
- String folder = data.getProperty("folder");
+ String folder = data.getProperty("folder"); //$NON-NLS-1$
targetHolder.revalidate(folder);
message = null;
if(targetHolder.target == null) {
@@ -150,31 +153,35 @@
super.validate(data);
}
- String FORBIDDEN_INDICES = "\"\n\t*\\/:<>?|";
+ String FORBIDDEN_INDICES = "\"\n\t*\\/:<>?|"; //$NON-NLS-1$
protected void validateChildName(Properties data) {
if(message != null) return;
String name = data.getProperty(XModelObjectConstants.ATTR_NAME);
if(name == null || name.length() == 0) return;
- if(name.equals(".")) {
+ if(name.equals(".")) { //$NON-NLS-1$
message = "Incorrect name.";
- } else if(name.endsWith(".") && name.indexOf('.') != name.lastIndexOf('.')) {
+ } else if(name.endsWith(".") && name.indexOf('.') != name.lastIndexOf('.')) { //$NON-NLS-1$
message = "Name must not end in a period.";
} else {
for (int i = 0; i < FORBIDDEN_INDICES.length(); i++) {
if(name.indexOf(FORBIDDEN_INDICES.charAt(i)) >= 0) {
- message = "Name must not contain character " + FORBIDDEN_INDICES.charAt(i) + " .";
+ message = MessageFormat.format(
+ "Name must not contain character {0} .",
+ FORBIDDEN_INDICES.charAt(i));
return;
}
}
}
}
- String FORBIDDEN_FOLDER_LETTERS = "\"\n\t*:<>?|";
+ String FORBIDDEN_FOLDER_LETTERS = "\"\n\t*:<>?|"; //$NON-NLS-1$
private void validateFolderName() {
if(targetHolder.addPath.length() == 0) return;
for (int i = 0; i < FORBIDDEN_FOLDER_LETTERS.length(); i++) {
if(targetHolder.addPath.indexOf(FORBIDDEN_FOLDER_LETTERS.charAt(i)) >= 0) {
- message = "Folder name must not contain character " + FORBIDDEN_FOLDER_LETTERS.charAt(i) + " .";
+ message = MessageFormat.format(
+ "Folder name must not contain character {0} .",
+ FORBIDDEN_FOLDER_LETTERS.charAt(i));
return;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/InvokingWizardHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/InvokingWizardHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/InvokingWizardHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,7 +10,7 @@
import org.jboss.tools.common.model.XModelObject;
public class InvokingWizardHandler extends AbstractHandler {
- SpecialWizard sw = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizard.newfile.WizardInvoker");
+ SpecialWizard sw = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizard.newfile.WizardInvoker"); //$NON-NLS-1$
public InvokingWizardHandler() {}
@@ -21,12 +21,12 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(sw == null || object == null) return;
if(p == null) p = new Properties();
- String pluginId = action.getProperty("plugin");
- String wizardId = action.getProperty("wizard");
+ String pluginId = action.getProperty("plugin"); //$NON-NLS-1$
+ String wizardId = action.getProperty("wizard"); //$NON-NLS-1$
- p.setProperty("plugin", pluginId);
- p.setProperty("wizard", wizardId);
- p.put("object", object);
+ p.setProperty("plugin", pluginId); //$NON-NLS-1$
+ p.setProperty("wizard", wizardId); //$NON-NLS-1$
+ p.put("object", object); //$NON-NLS-1$
sw.setObject(p);
int r = sw.execute();
@@ -38,10 +38,10 @@
}
private String getTruePath() {
- String path = action.getProperty("action");
+ String path = action.getProperty("action"); //$NON-NLS-1$
if(path != null) return path;
path = action.getPath();
- if(path.endsWith("V")) {
+ if(path.endsWith("V")) { //$NON-NLS-1$
path = path.substring(0, path.length() - 1).replace('/', '.');
} else {
path = null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -27,7 +27,7 @@
private static XAdoptManager[] managers = null;
public XAdoptManager[] getManagers() {
- if(managers == null) managers = loadManagers("org.jboss.tools.common.model.jspAdopt");
+ if(managers == null) managers = loadManagers("org.jboss.tools.common.model.jspAdopt"); //$NON-NLS-1$
return managers;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/TargetHolder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/TargetHolder.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/TargetHolder.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,7 +15,7 @@
XModelObject target;
String path;
IResource folder;
- String addPath = "";
+ String addPath = ""; //$NON-NLS-1$
public void setAction(XAction action) {
this.action = action;
@@ -24,12 +24,12 @@
public void revalidate(String newPath) {
if(newPath == path || (newPath != null && newPath.equals(path))) return;
path = newPath;
- addPath = "";
+ addPath = ""; //$NON-NLS-1$
folder = (path == null) ? null : ModelPlugin.getWorkspace().getRoot().findMember(path);
target = EclipseResourceUtil.getObjectByResource(folder);
if(path != null && (folder == null || !folder.exists())) {
String p = path.replace('\\', '/');
- String ap = "";
+ String ap = ""; //$NON-NLS-1$
while(true) {
int q = p.lastIndexOf('/');
if(q < 0) break;
@@ -53,11 +53,11 @@
public void saveLastPath() {
if(path == null || folder == null) return;
- QualifiedName n = new QualifiedName("", action.getName() + "_lastPath");
+ QualifiedName n = new QualifiedName("", action.getName() + "_lastPath"); //$NON-NLS-1$ //$NON-NLS-2$
try {
folder.getProject().setPersistentProperty(n, path);
} catch (CoreException e) {
- ModelPlugin.getPluginLog().logError("CreateFileSuppport:TargetHolder:saveLastPath:" + e.getMessage());
+ ModelPlugin.getPluginLog().logError("CreateFileSuppport:TargetHolder:saveLastPath:" + e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileAuxiliary.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileAuxiliary.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileAuxiliary.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,8 +14,8 @@
import org.jboss.tools.common.model.filesystems.impl.*;
public class FileAuxiliary {
- public static String AUX_FILE_ENTITY = "FileAnyAuxiliary";
- String extension = "";
+ public static String AUX_FILE_ENTITY = "FileAnyAuxiliary"; //$NON-NLS-1$
+ String extension = ""; //$NON-NLS-1$
boolean replaceExtension = true;
boolean addLeadingDot = true;
@@ -41,7 +41,7 @@
public FileAnyAuxiliaryImpl getAuxiliaryFile(XModelObject folder, XModelObject main, boolean create) {
if(folder==null) return null;
String name = getAuxiliaryName(main);
- String p = name + "." + extension;
+ String p = name + "." + extension; //$NON-NLS-1$
XModelObject f = folder.getChildByPath(p);
if(!(f instanceof FileAnyAuxiliaryImpl)) {
if(!create) return null;
@@ -61,14 +61,14 @@
if(replaceExtension) return auxname;
int i = auxname.lastIndexOf('.');
String s = (i < 0) ? auxname : auxname.substring(0, i);
- if(addLeadingDot && s.startsWith(".")) s = s.substring(1);
+ if(addLeadingDot && s.startsWith(".")) s = s.substring(1); //$NON-NLS-1$
return s;
}
public String getAuxiliaryName(XModelObject main) {
String name = main.getAttributeValue(XModelObjectConstants.ATTR_NAME);
- if(!replaceExtension) name += "." + main.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION);
- if(addLeadingDot) name = "." + name;
+ if(!replaceExtension) name += "." + main.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION); //$NON-NLS-1$
+ if(addLeadingDot) name = "." + name; //$NON-NLS-1$
return name;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FilePathHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FilePathHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FilePathHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -38,12 +38,12 @@
Bundle b = Platform.getBundle(ModelPlugin.PLUGIN_ID);
String path = EclipseResourceUtil.getInstallPath(b);
if(path == null) return;
- String file = path + "/images/default.gif";
+ String file = path + "/images/default.gif"; //$NON-NLS-1$
if(!new File(file).isFile()) {
- ModelPlugin.getPluginLog().logWarning("Cannot find file " + file);
+ ModelPlugin.getPluginLog().logWarning("Cannot find file " + file); //$NON-NLS-1$
return;
}
- String file2 = path + "/images/Default.gif";
+ String file2 = path + "/images/Default.gif"; //$NON-NLS-1$
if(!new File(file2).isFile()) {
isCaseSensitive = true;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileSystemsHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileSystemsHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/FileSystemsHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -13,7 +13,7 @@
import org.jboss.tools.common.model.*;
public class FileSystemsHelper {
- public static final String FILE_SYSTEMS = "FileSystems";
+ public static final String FILE_SYSTEMS = "FileSystems"; //$NON-NLS-1$
public static XModelObject getFileSystems(XModel model) {
return model.getByPath(FILE_SYSTEMS);
@@ -24,11 +24,11 @@
}
public static XModelObject getWebRoot(XModel model) {
- return model.getByPath(FILE_SYSTEMS + "/WEB-ROOT");
+ return model.getByPath(FILE_SYSTEMS + "/WEB-ROOT"); //$NON-NLS-1$
}
public static XModelObject getWebInf(XModel model) {
- return model.getByPath(FILE_SYSTEMS + "/WEB-INF");
+ return model.getByPath(FILE_SYSTEMS + "/WEB-INF"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -42,13 +42,13 @@
return true;
}
- private static String ns = ".NAME.EXTENSION.overlapped.expanded._body_.actualBodyTimeStamp.correctBody.forceLoad.";
+ private static String ns = ".NAME.EXTENSION.overlapped.expanded._body_.actualBodyTimeStamp.correctBody.forceLoad."; //$NON-NLS-1$
public String get(String name) {
- if(name.equals("_hasErrors_")) {
+ if(name.equals("_hasErrors_")) { //$NON-NLS-1$
return super.get(XModelObjectConstants.ATTR_NAME_IS_INCORRECT);
}
- if (getParent() != null && ns.indexOf("." + name + ".") < 0) {
+ if (getParent() != null && ns.indexOf("." + name + ".") < 0) { //$NON-NLS-1$ //$NON-NLS-2$
if(loadAttributeSeparately(name)) return super.get(name);
loadChildren();
@@ -93,7 +93,7 @@
}
public boolean isObjectEditable() {
- return super.isObjectEditable() && (!XModelObjectConstants.YES.equals(get("_hasErrors_")));
+ return super.isObjectEditable() && (!XModelObjectConstants.YES.equals(get("_hasErrors_"))); //$NON-NLS-1$
}
protected void loadChildren() {
@@ -138,7 +138,7 @@
public void set(String name, String value) {
super.set(name, value);
- if("incorrectBody".equals(name) && value.length() > 0) {
+ if("incorrectBody".equals(name) && value.length() > 0) { //$NON-NLS-1$
set(XModelObjectConstants.ATTR_NAME_IS_INCORRECT, XModelObjectConstants.YES);
// setErrors(value, hasDTD(), !hasDTD()); //never validate dtd
int resolution = EntityXMLRegistration.getInstance().resolve(getModelEntity());
@@ -156,7 +156,7 @@
}
protected boolean isForceLoadOn() {
- return XModelObjectConstants.TRUE.equals(get("forceLoad"));
+ return XModelObjectConstants.TRUE.equals(get("forceLoad")); //$NON-NLS-1$
}
public void edit(String body, boolean update) throws XModelException {
@@ -174,7 +174,7 @@
return;
}
- boolean errors1 = (XModelObjectConstants.YES.equals(get("_hasErrors_")));
+ boolean errors1 = (XModelObjectConstants.YES.equals(get("_hasErrors_"))); //$NON-NLS-1$
AbstractExtendedXMLFileImpl f = getUpdatedFile(body, true);
if(f == null) return;
f.getChildren();
@@ -187,27 +187,27 @@
getChildren();
boolean fire = this.loaderError == null && f.loaderError != null;
this.loaderError = f.loaderError;
- super.set("incorrectBody", f.get("incorrectBody"));
+ super.set("incorrectBody", f.get("incorrectBody")); //$NON-NLS-1$ //$NON-NLS-2$
super.set(XModelObjectConstants.ATTR_NAME_IS_INCORRECT, XModelObjectConstants.YES);
- if(f.get("errors") != null) super.set("errors", f.get("errors"));
+ if(f.get("errors") != null) super.set("errors", f.get("errors")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(fire) changeTimeStamp();
- if(f.get("actualBodyTimeStamp") != null && !"-1".equals(f.get("actualBodyTimeStamp"))) {
+ if(f.get("actualBodyTimeStamp") != null && !"-1".equals(f.get("actualBodyTimeStamp"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
mergeAll(f, update);
}
m.fireStructureChanged(this);
if(!isOverlapped) getResourceMarkers().update();
} else if(isMergingChanges()) {
- String oldBody = get("correctBody");
+ String oldBody = get("correctBody"); //$NON-NLS-1$
boolean changed = body != null && !body.equals(oldBody);
- set("correctBody", body);
- set("actualBodyTimeStamp", "0");
+ set("correctBody", body); //$NON-NLS-1$
+ set("actualBodyTimeStamp", "0"); //$NON-NLS-1$ //$NON-NLS-2$
long ots = getTimeStamp();
mergeAll(f, update);
if(changed && ots == getTimeStamp()) {
changeTimeStamp();
}
- set("actualBodyTimeStamp", "" + getTimeStamp());
+ set("actualBodyTimeStamp", "" + getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
if(errors1) m.fireStructureChanged(this);
if(!isOverlapped) constraintChecker.check();
} else {
@@ -221,9 +221,9 @@
}
protected void safeChangeTimeStamp() {
- boolean b = ("" + getTimeStamp()).equals(get("actualBodyTimeStamp"));
+ boolean b = ("" + getTimeStamp()).equals(get("actualBodyTimeStamp")); //$NON-NLS-1$ //$NON-NLS-2$
changeTimeStamp();
- if(b) set("actualBodyTimeStamp", "" + getTimeStamp());
+ if(b) set("actualBodyTimeStamp", "" + getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
}
protected void mergeAll(XModelObject f, boolean update) throws XModelException {
merge(f, !update);
@@ -242,15 +242,15 @@
}
private AbstractExtendedXMLFileImpl getUpdatedFile(String body, boolean fire) {
- boolean errors1 = (XModelObjectConstants.YES.equals(get("_hasErrors_")));
+ boolean errors1 = (XModelObjectConstants.YES.equals(get("_hasErrors_"))); //$NON-NLS-1$
loaderError = null;
// setErrors(body, hasDTD(), !hasDTD()); //never validate dtd
int resolution = EntityXMLRegistration.getInstance().resolve(getModelEntity());
if(EntityXMLRegistration.isSystemId(body)) resolution = EntityXMLRegistration.UNRESOLVED;
setErrors(body, resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
- boolean errors2 = (get("errors") != null && get("errors").length() > 0);
+ boolean errors2 = (get("errors") != null && get("errors").length() > 0); //$NON-NLS-1$ //$NON-NLS-2$
if(errors1 && errors2) {
- super.set("incorrectBody".intern(), body);
+ super.set("incorrectBody".intern(), body); //$NON-NLS-1$
if(fire) {
changeTimeStamp();
if(isActive()) ((XModelImpl)getModel()).fireNodeChanged(this, getPath());
@@ -261,8 +261,8 @@
f.setAttributeValue(XModelObjectConstants.ATTR_NAME, getAttributeValue(XModelObjectConstants.ATTR_NAME));
f.setAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION, getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION));
if(errors2) {
- f.set("incorrectBody", body);
- f.set("errors", super.get("errors"));
+ f.set("incorrectBody", body); //$NON-NLS-1$
+ f.set("errors", super.get("errors")); //$NON-NLS-1$ //$NON-NLS-2$
}
f.setBodySource(new SFBodySource(body));
return f;
@@ -273,9 +273,9 @@
fireObjectChanged(XModelTreeEvent.BEFORE_MERGE);
}
if(!XModelObjectConstants.YES.equals(update.get(XModelObjectConstants.ATTR_NAME_IS_INCORRECT))) {
- super.set("incorrectBody", "");
+ super.set("incorrectBody", ""); //$NON-NLS-1$ //$NON-NLS-2$
super.set(XModelObjectConstants.ATTR_NAME_IS_INCORRECT,XModelObjectConstants.NO);
- super.set("errors", "");
+ super.set("errors", ""); //$NON-NLS-1$ //$NON-NLS-2$
loaderError = null;
}
if(update instanceof AbstractExtendedXMLFileImpl) {
@@ -332,12 +332,12 @@
}
}
- static String NO_MERGE_ATTRIBUTES = ".name.extension._lateload.isIncorrect.incorrectBody.expand.";
+ static String NO_MERGE_ATTRIBUTES = ".name.extension._lateload.isIncorrect.incorrectBody.expand."; //$NON-NLS-1$
void mergeAttributes(XModelObject update, boolean fire) throws XModelException {
XAttribute[] as = update.getModelEntity().getAttributes();
for (int i = 0; i < as.length; i++) {
String n = as[i].getName();
- if(NO_MERGE_ATTRIBUTES.indexOf("." + n + ".") >= 0) continue;
+ if(NO_MERGE_ATTRIBUTES.indexOf("." + n + ".") >= 0) continue; //$NON-NLS-1$ //$NON-NLS-2$
XModelObjectLoaderUtil.mergeAttributeComment(this, update, as[i], fire);
String ov = getAttributeValue(n);
String nv = update.getAttributeValue(n);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.common.model.filesystems.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.markers.ResourceMarkers;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.filesystems.impl.RecognizedFileImpl;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.model.util.XMLUtil;
@@ -83,7 +83,7 @@
} catch (NumberFormatException e) {
ModelPlugin.getPluginLog().logError(e);
}
- String ep = "ERROR: " + FindObjectHelper.makeRef(getPath() + ":" + ln1, ln + ":" + pos) + " " + er;
+ String ep = MessageFormat.format("ERROR: {0} {1}", FindObjectHelper.makeRef(getPath() + ":" + ln1, ln + ":" + pos), er); //$NON-NLS-2$ //$NON-NLS-3$
if(iln < 0) markers.lines.remove(ep);
else markers.lines.put(ep, Integer.valueOf(iln));
sb.append(ep).append('\n');
@@ -100,7 +100,7 @@
protected boolean isOverlapped() {
XModelObject p = getParent();
- while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent(); //$NON-NLS-1$ //$NON-NLS-2$
+ while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent(); //$NON-NLS-1$
return (p != null);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -44,8 +44,8 @@
addCreatedObject(parent, c, p);
} else {
addCreatedObject(parent, c, false, p);
- XModelObject po = (XModelObject)p.get("parentObject");
- XModelObject co = (XModelObject)p.get("childObject");
+ XModelObject po = (XModelObject)p.get("parentObject"); //$NON-NLS-1$
+ XModelObject co = (XModelObject)p.get("childObject"); //$NON-NLS-1$
addCreatedObject(po, co, p);
}
if(parent instanceof FolderImpl) {
@@ -55,13 +55,13 @@
final XModelObject q = c;
if(q != null) Display.getDefault().asyncExec(new Runnable() {
public void run() {
- XActionInvoker.invoke("Open", q, new Properties());
+ XActionInvoker.invoke("Open", q, new Properties()); //$NON-NLS-1$
}
});
}
private String getDefaultExtension(Properties prop) {
- String ext = (prop == null) ? null : prop.getProperty("defaultExtention");
+ String ext = (prop == null) ? null : prop.getProperty("defaultExtention"); //$NON-NLS-1$
return (ext == null) ? null : ext;
}
@@ -71,9 +71,9 @@
String path = null;
int i = name.lastIndexOf('.');
if(i > 0) {
- String es = action.getProperty("extensions");
+ String es = action.getProperty("extensions"); //$NON-NLS-1$
String xext = name.substring(i + 1);
- if(es == null || es.length() == 0 || es.indexOf("." + xext + ".") >= 0) {
+ if(es == null || es.length() == 0 || es.indexOf("." + xext + ".") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$
ext = xext;
name = name.substring(0, i);
}
@@ -86,23 +86,23 @@
}
p.setProperty(XModelObjectConstants.ATTR_NAME, name);
if(ext != null) p.setProperty(XModelObjectConstants.ATTR_NAME_EXTENSION, ext);
- if(path != null) p.setProperty("path", path);
+ if(path != null) p.setProperty("path", path); //$NON-NLS-1$
}
private XModelObject getParentFolder(XModelObject object, Properties p) throws XModelException {
- String path = p.getProperty("path");
+ String path = p.getProperty("path"); //$NON-NLS-1$
if(path == null || path.length() == 0) return object;
StringTokenizer st = new StringTokenizer(path, XModelObjectConstants.SEPARATOR);
while(st.hasMoreTokens()) {
String pp = st.nextToken();
XModelObject c = object.getChildByPath(pp);
if(c == null) {
- c = object.getModel().createModelObject("FileFolder", null);
+ c = object.getModel().createModelObject("FileFolder", null); //$NON-NLS-1$
c.setAttributeValue(XModelObjectConstants.ATTR_NAME, pp);
- p.put("parentObject", object);
- p.put("childObject", c);
+ p.put("parentObject", object); //$NON-NLS-1$
+ p.put("childObject", c); //$NON-NLS-1$
return createFolder(c, st);
- } else if(!"FileFolder".equals(c.getModelEntity().getName())) {
+ } else if(!"FileFolder".equals(c.getModelEntity().getName())) { //$NON-NLS-1$
throw new XModelException("Cannot create folder " + pp + " in " + object.getPathPart());
} else {
object = c;
@@ -114,7 +114,7 @@
private XModelObject createFolder(XModelObject object, StringTokenizer path) throws XModelException {
while(path.hasMoreTokens()) {
String pp = path.nextToken();
- XModelObject c = object.getModel().createModelObject("FileFolder", null);
+ XModelObject c = object.getModel().createModelObject("FileFolder", null); //$NON-NLS-1$
c.setAttributeValue(XModelObjectConstants.ATTR_NAME, pp);
object.addChild(c);
object = c;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DeleteFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DeleteFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DeleteFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
import org.jboss.tools.common.model.filesystems.XFileObject;
public class DeleteFileHandler extends AbstractHandler {
- SpecialWizard closeEditor = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.editor.DeleteFileUnderEditingSpecialWizard");
+ SpecialWizard closeEditor = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.editor.DeleteFileUnderEditingSpecialWizard"); //$NON-NLS-1$
public boolean isEnabled(XModelObject object) {
return object != null && object.isActive() && object.getFileType() > XFileObject.NONE
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DiscardFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DiscardFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/DiscardFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -34,7 +34,7 @@
object.setModified(false);
XModelObjectLoaderUtil.updateModifiedOnSave(object);
}
- if(p != null) p.setProperty("done", XModelObjectConstants.TRUE);
+ if(p != null) p.setProperty("done", XModelObjectConstants.TRUE); //$NON-NLS-1$
}
public boolean getSignificantFlag(XModelObject object) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -67,7 +67,7 @@
}
super.setModified(value);
if(changed && isActive() && updateLock <= 0) {
- fireObjectChanged("setModified");
+ fireObjectChanged("setModified"); //$NON-NLS-1$
if(value) {
saveUnopen();
}
@@ -79,7 +79,7 @@
}
private boolean isObjectEditable0() {
- if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) return false;
+ if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) return false; //$NON-NLS-1$
XModelObject p = getParent();
if(p == null) return true;
if(p instanceof JarFolderImpl) return false;
@@ -96,8 +96,8 @@
}
public String getMainIconName() {
- if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) {
- String oin = get("overlappedSystem");
+ if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) { //$NON-NLS-1$
+ String oin = get("overlappedSystem"); //$NON-NLS-1$
XModelObject o = (oin == null || oin.length() == 0) ? null : getModel().getByPath(oin);
if(o == null) {
o = this;
@@ -125,13 +125,13 @@
public static String toFileName(XProperty p) {
String n = p.get(XModelObjectConstants.XML_ATTR_NAME);
if(n == null) return null;
- String s = p.get("EXTENSION");
- return n + ((s == null || s.length() == 0) ? "" : "." + s);
+ String s = p.get("EXTENSION"); //$NON-NLS-1$
+ return n + ((s == null || s.length() == 0) ? "" : "." + s); //$NON-NLS-1$ //$NON-NLS-2$
}
public void setBodySource(BodySource bodysource) {
this.bodysource = bodysource;
- super.set(XModelObjectConstants.ATTR_NAME_BODY, "");
+ super.set(XModelObjectConstants.ATTR_NAME_BODY, ""); //$NON-NLS-1$
changeTimeStamp();
}
@@ -177,7 +177,7 @@
}
public void set(String name, String value) {
- if((!XModelObjectConstants.XML_ATTR_NAME.equals(name) && !"EXTENSION".equals(name)) || !isActive() || !(getParent() instanceof FolderImpl)) {
+ if((!XModelObjectConstants.XML_ATTR_NAME.equals(name) && !"EXTENSION".equals(name)) || !isActive() || !(getParent() instanceof FolderImpl)) { //$NON-NLS-1$
super.set(name, value);
} else {
rename0(value, name);
@@ -186,11 +186,11 @@
public void fileRenamed(String name, String extension) {
if(name != null && name.equals(super.get(XModelObjectConstants.XML_ATTR_NAME))
- && extension != null && extension.equals(super.get("EXTENSION"))) {
+ && extension != null && extension.equals(super.get("EXTENSION"))) { //$NON-NLS-1$
return;
}
super.set(XModelObjectConstants.XML_ATTR_NAME, name);
- super.set("EXTENSION", extension);
+ super.set("EXTENSION", extension); //$NON-NLS-1$
fireObjectChanged(null);
}
@@ -243,7 +243,7 @@
if(!isModified() || !isActive()) return;
XJob.addRunnableWithPriority(new XRunnable() {
public String getId() {
- return "Save " + getPath();
+ return "Save " + getPath(); //$NON-NLS-1$
}
public void run() {
Display.getDefault().asyncExec(new Runnable(){
@@ -259,7 +259,7 @@
if(!isActive()) return;
//Be careful!
if(!isModified()) return;
- SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveUnopenSpecialWizard");
+ SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveUnopenSpecialWizard"); //$NON-NLS-1$
if(w == null) return;
w.setObject(this);
w.execute();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyLongImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyLongImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileAnyLongImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
public String getAsText() {
File file = _getFile();
- return (!file.isFile()) ? "" : FileUtil.readFile(file);
+ return (!file.isFile()) ? "" : FileUtil.readFile(file); //$NON-NLS-1$
}
public void edit(String body) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemFolderLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemFolderLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemFolderLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -30,7 +30,7 @@
private boolean isProtectedFileSystem(XModelObject object) {
String name = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
- if("WEB-ROOT".equals(name) || "WEB-INF".equals(name)) return true;
+ if("WEB-ROOT".equals(name) || "WEB-INF".equals(name)) return true; //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -55,7 +55,7 @@
}
try {
java.io.File f = new java.io.File(thloc);
- if(f.exists() || thloc.indexOf("/..") >= 0) {
+ if(f.exists() || thloc.indexOf("/..") >= 0) { //$NON-NLS-1$
thloc = f.getCanonicalPath().replace('\\', '/');
} else {
thloc = thloc.replace('\\', '/');
@@ -93,9 +93,9 @@
f.createLink(new Path(thloc), IFolder.FORCE, null);
resource = f;
} catch (CoreException e) {
- ModelPlugin.getPluginLog().logError("Cannot create link: " + e.getMessage());
- ModelPlugin.getPluginLog().logError("Project path=" + prloc);
- ModelPlugin.getPluginLog().logError(" Link path=" + thloc);
+ ModelPlugin.getPluginLog().logError("Cannot create link: " + e.getMessage()); //$NON-NLS-1$
+ ModelPlugin.getPluginLog().logError("Project path=" + prloc); //$NON-NLS-1$
+ ModelPlugin.getPluginLog().logError(" Link path=" + thloc); //$NON-NLS-1$
}
} else resource = f;
return resource;
@@ -121,7 +121,7 @@
}
protected String getAbsolutePath() {
- return "" + get(XModelObjectConstants.ATTR_NAME_LOCATION);
+ return "" + get(XModelObjectConstants.ATTR_NAME_LOCATION); //$NON-NLS-1$
}
public FileSystemPeer getPeer() {
@@ -141,20 +141,20 @@
}
public String getMainIconName() {
- String info = getAttributeValue("info");
+ String info = getAttributeValue("info"); //$NON-NLS-1$
if(info == null || info.length() == 0) return super.getMainIconName();
- int mr = info.indexOf("Struts-Module=/");
- if(mr >= 0) return "main.struts.moduleroot";
- int wc = info.indexOf("Content-Type=Web");
- if(wc >= 0) return "main.webprj.webroot";
+ int mr = info.indexOf("Struts-Module=/"); //$NON-NLS-1$
+ if(mr >= 0) return "main.struts.moduleroot"; //$NON-NLS-1$
+ int wc = info.indexOf("Content-Type=Web"); //$NON-NLS-1$
+ if(wc >= 0) return "main.webprj.webroot"; //$NON-NLS-1$
return super.getMainIconName();
}
public String getPresentationString() {
IResource r = getResource();
String resourceName = (r == null) ? null : r.getName();
- String natureProperty = getModel().getProperties().getProperty("nature");
- if("org.jboss.tools.jsf.jsfnature".equals(natureProperty)) {
+ String natureProperty = getModel().getProperties().getProperty("nature"); //$NON-NLS-1$
+ if("org.jboss.tools.jsf.jsfnature".equals(natureProperty)) { //$NON-NLS-1$
return resourceName;
}
String p = super.getPresentationString();
@@ -162,9 +162,9 @@
if(resourceName != null && resource.isLinked()) return resourceName.replace('#', '/');
return resourceName;
}
- if(XModelObjectConstants.TRUE.equals(getModel().getProperties().getProperty("isProjectFragment"))) {
+ if(XModelObjectConstants.TRUE.equals(getModel().getProperties().getProperty("isProjectFragment"))) { //$NON-NLS-1$
return resourceName;
}
- return p.replace('#', '/') + " (" + resourceName + ")";
+ return p.replace('#', '/') + " (" + resourceName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -39,9 +39,9 @@
public String getPresentationString() {
IProject p = EclipseResourceUtil.getProject(this);
- String app = getAttributeValue("application name");
+ String app = getAttributeValue("application name"); //$NON-NLS-1$
if(p != null && !app.equals(p.getName())) {
- app = app.length() > 0 ? p.getName() + " (" + app + ")" : p.getName();
+ app = app.length() > 0 ? p.getName() + " (" + app + ")" : p.getName(); //$NON-NLS-1$ //$NON-NLS-2$
}
return (app != null && app.length() > 0) ? app : super.getPresentationString();
}
@@ -83,7 +83,7 @@
}
public String getId() {
- return "Model:update overlapped: " + XModelConstants.getWorkspace(FileSystemsImpl.this.getModel());
+ return "Model:update overlapped: " + XModelConstants.getWorkspace(FileSystemsImpl.this.getModel()); //$NON-NLS-1$
}
}
@@ -146,15 +146,15 @@
String path = (String)it.next();
if(_overlapped.contains(path)) {
XModelObject c = getChildByPath(path);
- if(c == null || XModelObjectConstants.TRUE.equals(c.get("overlapped"))) {
+ if(c == null || XModelObjectConstants.TRUE.equals(c.get("overlapped"))) { //$NON-NLS-1$
_overlapped.remove(path);
}
} else {
it.remove();
XModelObject c = getChildByPath(path);
if(c == null) continue;
- c.set("overlapped", "");
- c.set("overlappedSystem", "");
+ c.set("overlapped", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ c.set("overlappedSystem", ""); //$NON-NLS-1$ //$NON-NLS-2$
c = c.getParent();
if(c != null) fire.add(c);
}
@@ -165,8 +165,8 @@
overlapped.add(path);
XModelObject c = getChildByPath(path);
if(c == null) continue;
- c.set("overlapped", XModelObjectConstants.TRUE);
- c.set("overlappedSystem", "" + overlappedSystems.get(path));
+ c.set("overlapped", XModelObjectConstants.TRUE); //$NON-NLS-1$
+ c.set("overlappedSystem", "" + overlappedSystems.get(path)); //$NON-NLS-1$ //$NON-NLS-2$
c = c.getParent();
if(c != null) fire.add(c);
}
@@ -181,13 +181,13 @@
}
public String get(String name) {
- if("APPLICATION_NAME".equals(name) || "application-name".equals(name)) {
+ if("APPLICATION_NAME".equals(name) || "application-name".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
String s = super.get(name);
if(s == null || s.length() == 0) {
- s = "";
+ s = ""; //$NON-NLS-1$
// project name ?
}
- return (s == null) ? "" : s;
+ return (s == null) ? "" : s; //$NON-NLS-1$
} else {
return super.get(name);
}
@@ -251,7 +251,7 @@
}
class UpdateRunnable implements XJob.XRunnable {
- String id = "Update File Systems - " + XModelConstants.getWorkspace(getModel());
+ String id = "Update File Systems - " + XModelConstants.getWorkspace(getModel()); //$NON-NLS-1$
int request = 0;
int usage = 0;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -30,7 +30,7 @@
import org.jboss.tools.common.model.project.WatcherLoader;
public class FileSystemsLoader extends URLRootLoader {
- public static String IS_ADDED_TO_CLASSPATH = "isAddedToClassPath";
+ public static String IS_ADDED_TO_CLASSPATH = "isAddedToClassPath"; //$NON-NLS-1$
FileSystemsLoaderUtil fsutil = new FileSystemsLoaderUtil();
@@ -102,7 +102,7 @@
}
void removeMissingJarSystems(XModelObject object) {
- XModelObject[] os = object.getChildren("FileSystemJar");
+ XModelObject[] os = object.getChildren("FileSystemJar"); //$NON-NLS-1$
for (int i = 0; i < os.length; i++) {
JarSystemImpl jar = (JarSystemImpl)os[i];
String location = jar.getLocation();
@@ -118,7 +118,7 @@
}
protected String fileName(XModelObject object) {
- return "workspace.pex";
+ return "workspace.pex"; //$NON-NLS-1$
}
private boolean saveEclipse(XModelObject object) {
@@ -196,22 +196,22 @@
String fileName = new File(path).getName();
if(SYSTEM_JAR_SET.contains(fileName)) continue;
String jsname = "lib-" + fileName; //$NON-NLS-1$
- XModelObject o = object.getChildByPath(jsname); //$NON-NLS-1$
+ XModelObject o = object.getChildByPath(jsname);
if(o != null) {
fss.remove(o);
} else {
o = object.getModel().createModelObject("FileSystemJar", null); //$NON-NLS-1$
- o.setAttributeValue(XModelObjectConstants.ATTR_NAME, jsname); //$NON-NLS-1$
- o.setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, path); //$NON-NLS-1$
- o.set(IS_ADDED_TO_CLASSPATH, XModelObjectConstants.TRUE); //$NON-NLS-1$
+ o.setAttributeValue(XModelObjectConstants.ATTR_NAME, jsname);
+ o.setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, path);
+ o.set(IS_ADDED_TO_CLASSPATH, XModelObjectConstants.TRUE);
object.addChild(o);
// object.setModified(true);
}
}
for (XModelObject o: fss) {
- String path = XModelObjectUtil.expand(o.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION), o.getModel(), null); //$NON-NLS-1$
- if(XModelObjectConstants.TRUE.equals(o.get(FileSystemsLoader.IS_ADDED_TO_CLASSPATH))) { //$NON-NLS-1$
+ String path = XModelObjectUtil.expand(o.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION), o.getModel(), null);
+ if(XModelObjectConstants.TRUE.equals(o.get(FileSystemsLoader.IS_ADDED_TO_CLASSPATH))) {
o.removeFromParent();
} else if(!new File(path).exists()) {
o.removeFromParent();
@@ -221,15 +221,15 @@
}
private XModelObject validateLib(XModelObject object) {
- XModelObject lib = object.getChildByPath("lib");
+ XModelObject lib = object.getChildByPath("lib"); //$NON-NLS-1$
if(lib == null) {
- XModelObject wi = object.getChildByPath("WEB-INF");
+ XModelObject wi = object.getChildByPath("WEB-INF"); //$NON-NLS-1$
if(wi == null) return null;
- XModelObject lb = wi.getChildByPath("lib");
+ XModelObject lb = wi.getChildByPath("lib"); //$NON-NLS-1$
if(lb == null) return null;
lib = wi.getModel().createModelObject(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER, null);
- lib.setAttributeValue(XModelObjectConstants.ATTR_NAME, "lib");
- lib.setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, wi.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION) + "/lib");
+ lib.setAttributeValue(XModelObjectConstants.ATTR_NAME, "lib"); //$NON-NLS-1$
+ lib.setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, wi.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION) + "/lib"); //$NON-NLS-1$
object.addChild(lib);
object.setModified(true);
}
@@ -256,7 +256,7 @@
}
XModelObject[] cs = object.getChildren(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER);
for (int i = 0; i < cs.length; i++) {
- if(cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME).startsWith("src")) {
+ if(cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME).startsWith("src")) { //$NON-NLS-1$
String loc = cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION);
if(!paths.contains(loc)) {
object.removeChild(cs[i]);
@@ -276,10 +276,10 @@
}
private String getNextSrcName(XModelObject object) {
- if(object.getChildByPath("src") == null) return "src";
+ if(object.getChildByPath("src") == null) return "src"; //$NON-NLS-1$ //$NON-NLS-2$
int i = 1;
while(true) {
- String s = "src-" + i;
+ String s = "src-" + i; //$NON-NLS-1$
if(object.getChildByPath(s) == null) return s;
i++;
}
@@ -290,14 +290,14 @@
class FileSystemsLoaderUtil extends XModelObjectLoaderUtil {
boolean isFileSystems(String nodeName) {
- return "FILESYSTEMS".equals(nodeName) || "file-systems".equals(nodeName);
+ return "FILESYSTEMS".equals(nodeName) || "file-systems".equals(nodeName); //$NON-NLS-1$ //$NON-NLS-2$
}
protected Set<String> getAllowedChildren(XModelEntity entity) {
Set<String> children = super.getAllowedChildren(entity);
if(isFileSystems(entity.getXMLSubPath())) {
- children.add("WEB");
- children.add("web");
+ children.add("WEB"); //$NON-NLS-1$
+ children.add("web"); //$NON-NLS-1$
}
return children;
}
@@ -305,8 +305,8 @@
protected Set<String> getAllowedAttributes(XModelEntity entity) {
Set<String> attributes = super.getAllowedAttributes(entity);
if(isFileSystems(entity.getXMLSubPath())) {
- attributes.add("WORKSPACE_HOME");
- attributes.add("workspace-home");
+ attributes.add("WORKSPACE_HOME"); //$NON-NLS-1$
+ attributes.add("workspace-home"); //$NON-NLS-1$
}
return attributes;
}
@@ -324,8 +324,8 @@
public void loadChildren(Element element, XModelObject o) {
super.loadChildren(element, o);
if(isFileSystems(element.getNodeName())) {
- Element e = XMLUtil.getUniqueChild(element, "web");
- if(e == null) e = XMLUtil.getUniqueChild(element, "WEB");
+ Element e = XMLUtil.getUniqueChild(element, "web"); //$NON-NLS-1$
+ if(e == null) e = XMLUtil.getUniqueChild(element, "WEB"); //$NON-NLS-1$
XModelObject w = getWeb(o);
if(w != null && e != null) load(e, w);
}
@@ -338,7 +338,7 @@
}
private XModelObject getWeb(XModelObject object) {
- return object.getModel().getByPath("Web");
+ return object.getModel().getByPath("Web"); //$NON-NLS-1$
}
private void saveWorkspaceHomeAttr(Element element, XModelObject o) {
@@ -347,21 +347,21 @@
String workspace = p.getProperty(XModelConstants.WORKSPACE);
if(project == null) return;
String relative = workspace.startsWith(project + XModelObjectConstants.SEPARATOR) ?
- "." + workspace.substring(project.length()) : workspace;
- element.setAttribute("workspace-home", relative);
+ "." + workspace.substring(project.length()) : workspace; //$NON-NLS-1$
+ element.setAttribute("workspace-home", relative); //$NON-NLS-1$
}
static Map<String,String> oldAttributes = new HashMap<String, String>();
static {
- oldAttributes.put("application-name", "APPLICATION_NAME");
- oldAttributes.put("workspace-home", "WORKSPACE_HOME");
- oldAttributes.put("info", "INFO");
- oldAttributes.put(XModelObjectConstants.ATTR_NAME_LOCATION, "LOCATION");
- oldAttributes.put("model-path", "MODEL_PATH");
- oldAttributes.put("root", "ROOT");
- oldAttributes.put("web-root", "root");
- oldAttributes.put("src", "SRC");
+ oldAttributes.put("application-name", "APPLICATION_NAME"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put("workspace-home", "WORKSPACE_HOME"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put("info", "INFO"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put(XModelObjectConstants.ATTR_NAME_LOCATION, "LOCATION"); //$NON-NLS-1$
+ oldAttributes.put("model-path", "MODEL_PATH"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put("root", "ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put("web-root", "root"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldAttributes.put("src", "SRC"); //$NON-NLS-1$ //$NON-NLS-2$
}
public String getAttribute(Element element, String xmlname, XAttribute attr) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -24,8 +24,8 @@
static {
try {
- if(Platform.getBundle("org.jboss.tools.jst.web") != null) {
- contribution = (Contribution)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.project.FileSystemsRenameListenerContribution");
+ if(Platform.getBundle("org.jboss.tools.jst.web") != null) { //$NON-NLS-1$
+ contribution = (Contribution)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.project.FileSystemsRenameListenerContribution"); //$NON-NLS-1$
}
} catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsTreeConstraint.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,19 +19,19 @@
public void update(XModel model) {}
- String excludeExtensions = ".project.struts.classpath.";
+ String excludeExtensions = ".project.struts.classpath."; //$NON-NLS-1$
public boolean accepts(XModelObject object) {
String entity = object.getModelEntity().getName();
- if("FileAnyAuxiliary".equals(entity)) return false;
+ if("FileAnyAuxiliary".equals(entity)) return false; //$NON-NLS-1$
if(object.getFileType() == XFileObject.SYSTEM) {
- String s = object.getAttributeValue("info");
- return (s == null || s.indexOf("hidden=yes") < 0);
+ String s = object.getAttributeValue("info"); //$NON-NLS-1$
+ return (s == null || s.indexOf("hidden=yes") < 0); //$NON-NLS-1$
}
if(object.getFileType() == XFileObject.FILE) {
- String ext = "." + object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION) + ".";
+ String ext = "." + object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION) + "."; //$NON-NLS-1$ //$NON-NLS-2$
if(excludeExtensions.indexOf(ext) >= 0) return false;
- if(".rule-sets".equals(object.getAttributeValue(XModelObjectConstants.ATTR_NAME))) return false;
+ if(".rule-sets".equals(object.getAttributeValue(XModelObjectConstants.ATTR_NAME))) return false; //$NON-NLS-1$
} else if(object.getFileType() == XFileObject.FOLDER) {
String[] ns = getHiddenFolderNames();
String n = object.get(XModelObjectConstants.XML_ATTR_NAME);
@@ -42,7 +42,7 @@
public boolean isHidingAllChildren(XModelObject object) {
if(object.getFileType() > XFileObject.NONE
- && XModelObjectConstants.TRUE.equals(object.get("overlapped"))) return true;
+ && XModelObjectConstants.TRUE.equals(object.get("overlapped"))) return true; //$NON-NLS-1$
// String entity = object.getModelEntity().getName();
return false; ///entity.equals("FilePROPERTIES");
}
@@ -53,7 +53,7 @@
return true;
}
- private static String[] names = new String[]{"CVS", ".svn"};
+ private static String[] names = new String[]{"CVS", ".svn"}; //$NON-NLS-1$ //$NON-NLS-2$
protected String[] getHiddenFolderNames() {
return names;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -28,7 +28,7 @@
}
public String get(String name) {
- if(name.equals("_hasErrors_")) {
+ if(name.equals("_hasErrors_")) { //$NON-NLS-1$
return super.get(XModelObjectConstants.ATTR_NAME_IS_INCORRECT);
}
if(!markersReset && isActive()) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,6 +12,7 @@
import java.io.File;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
@@ -184,10 +185,10 @@
if(f.isDirectory()) {
Properties p = new Properties();
p.setProperty(XModelObjectConstants.ATTR_NAME, f.getName());
- XModelObject c = getModel().createModelObject("FileFolder", p);
+ XModelObject c = getModel().createModelObject("FileFolder", p); //$NON-NLS-1$
String pp = FilePathHelper.toPathPath(f.getName());
if(linked.containsKey(pp)) {
- c.setObject("file", linked.get(pp));
+ c.setObject("file", linked.get(pp)); //$NON-NLS-1$
}
addChild(c);
} else {
@@ -202,15 +203,15 @@
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String body = null;
String entity = getModel().getEntityRecognizer().getEntityName(ext, body);
- if("FileAny".equals(entity)) {
+ if("FileAny".equals(entity)) { //$NON-NLS-1$
boolean isText = XModelObjectLoaderUtil.isTextFile(f, 100);
if(f.length() > 100000 || !isText) entity = XModelObjectConstants.ENT_FILE_ANY_LONG;
- else if(isText) entity = "FileTXT";
+ else if(isText) entity = "FileTXT"; //$NON-NLS-1$
} else if(entity == null) {
body = getBodySource(f).get();
entity = getModel().getEntityRecognizer().getEntityName(ext, body);
}
- if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny";
+ if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny"; //$NON-NLS-1$
p.setProperty(XMetaDataConstants.ENTITY, entity);
if(body != null) p.setProperty(XModelObjectConstants.ATTR_NAME_BODY, body);
return p;
@@ -226,7 +227,7 @@
String entity = p.getProperty(XMetaDataConstants.ENTITY);
XModelObject c = getModel().createModelObject(entity, p);
if(c == null) {
- ModelPlugin.getPluginLog().logInfo("Cannot create file for entity " + entity);
+ ModelPlugin.getPluginLog().logInfo("Cannot create file for entity " + entity); //$NON-NLS-1$
return;
}
if(isLateloadFile2(c)) {
@@ -236,9 +237,9 @@
if(loader != null) {
if(body == null) body = bs.get();
XModelObjectLoaderUtil.setTempBody(c, body);
- if("FilePROPERTIES".equals(entity) && bs instanceof EclipseFileBodySource) {
+ if("FilePROPERTIES".equals(entity) && bs instanceof EclipseFileBodySource) { //$NON-NLS-1$
String encoding = FileUtil.getEncoding(((EclipseFileBodySource)bs).ef);
- if(encoding != null) c.set("_encoding_", encoding);
+ if(encoding != null) c.set("_encoding_", encoding); //$NON-NLS-1$
}
loader.load(c);
} else if(c.getModelEntity().getAttribute(XModelObjectConstants.ATTR_NAME__FILE) != null) {
@@ -246,7 +247,7 @@
}
}
if(linked.containsValue(f)) {
- c.setObject("file", f);
+ c.setObject("file", f); //$NON-NLS-1$
}
addChild(c);
}
@@ -282,12 +283,12 @@
} catch (ResourceException re) {
IPath p = resource.getLocation();
if(p != null && p.toFile().exists()) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()", re);
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()", re); //$NON-NLS-1$
} else {
//ignore we cannot prevent this when project is removed externally
}
} catch (CoreException e) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()", e);
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()", e); //$NON-NLS-1$
} finally {
fsi.unlockUpdate();
}
@@ -307,7 +308,7 @@
}
}
} catch (CoreException ex) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()");
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()"); //$NON-NLS-1$
}
File[] fs = getFiles();
@@ -359,7 +360,7 @@
//Most probably Eclipse is shutting down.
return true;
} catch (XModelException t) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()");
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()"); //$NON-NLS-1$
} finally {
updateLock--;
unsynchronized = null;
@@ -369,7 +370,7 @@
protected File getChildIOFile(XModelObject o) {
String s = FileAnyImpl.toFileName(o);
- File f = (File)o.getObject("file"); //for links
+ File f = (File)o.getObject("file"); //for links //$NON-NLS-1$
if(f == null && linked.containsKey(o.getPathPart())) {
f = linked.get(o.getPathPart());
}
@@ -406,7 +407,7 @@
XModelObject main = aux.getMainObject();
if(main != null && main.isActive() && h != null) {
String n = h.getAuxiliaryName(main);
- String p = n + "." + aux.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION);
+ String p = n + "." + aux.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION); //$NON-NLS-1$
XModelObject other = getChildByPath(p);
if(other != null && other != aux) other.removeFromParent();
aux.fileRenamed(n, aux.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION));
@@ -426,7 +427,7 @@
try {
ef.refreshLocal(0, null);
} catch (CoreException e) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()");
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()"); //$NON-NLS-1$
}
}
ef = getChildFile(r.getName());
@@ -434,7 +435,7 @@
try {
ef.refreshLocal(0, null);
} catch (CoreException e) {
- ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()");
+ ModelPlugin.getPluginLog().logError("Exception caught in FolderImpl.update()"); //$NON-NLS-1$
}
}
@@ -483,7 +484,7 @@
}
private void setForceLoadProperty(XModelObject f, boolean b) {
- f.set("forceLoad", b ? XModelObjectConstants.TRUE : "");
+ f.set("forceLoad", b ? XModelObjectConstants.TRUE : ""); //$NON-NLS-1$ //$NON-NLS-2$
}
protected void updateLoaded(XModelObject o, File f) throws XModelException {
@@ -498,9 +499,9 @@
if(!registerFileInPeer(peer, f) && !isEncodingChanged(o)) {
if(!f.getName().equals(FileAnyImpl.toFileName(o))) {
String n = f.getName();
- int i = n.lastIndexOf(".");
+ int i = n.lastIndexOf("."); //$NON-NLS-1$
String nm = (i >= 0) ? n.substring(0, i) : n;
- String ext = (i >= 0) ? n.substring(i + 1) : "";
+ String ext = (i >= 0) ? n.substring(i + 1) : ""; //$NON-NLS-1$
((FileAnyImpl)o).fileRenamed(nm, ext);
}
return;
@@ -528,14 +529,14 @@
}
private boolean isEncodingChanged(XModelObject o) {
- if(o != null && o.getModelEntity().getName().equals("FilePROPERTIES")) {
- String encoding = o.getAttributeValue("encoding");
+ if(o != null && o.getModelEntity().getName().equals("FilePROPERTIES")) { //$NON-NLS-1$
+ String encoding = o.getAttributeValue("encoding"); //$NON-NLS-1$
if(encoding == null) {
return false;
}
String newEncoding = PropertiesLoader.getEncoding(o);
if(newEncoding == null) {
- newEncoding = "8859_1";
+ newEncoding = "8859_1"; //$NON-NLS-1$
}
if(!encoding.equals(newEncoding)) {
@@ -548,8 +549,10 @@
private int question(File f) {
if(Display.getCurrent() == null) return -100;
return getModel().getService().showDialog("Update",
- "File " + f.getAbsolutePath() + " is externally modified.\n" +
- "Do you want to reload it?", new String[]{"Yes", "No"}, null,
+ MessageFormat
+ .format(
+ "File {0} is externally modified.\nDo you want to reload it?",
+ f.getAbsolutePath()), new String[]{"Yes", "No"}, null,
ServiceDialog.QUESTION);
}
@@ -590,9 +593,9 @@
XObjectLoader loader = XModelObjectLoaderUtil.getObjectLoader(o);
if(loader != null) {
XModelObjectLoaderUtil.setTempBody(o, bs.get());
- if("FilePROPERTIES".equals(o.getModelEntity().getName()) && bs instanceof EclipseFileBodySource) {
+ if("FilePROPERTIES".equals(o.getModelEntity().getName()) && bs instanceof EclipseFileBodySource) { //$NON-NLS-1$
String encoding = FileUtil.getEncoding(((EclipseFileBodySource)bs).ef);
- if(encoding != null) o.setAttributeValue("encoding", encoding);
+ if(encoding != null) o.setAttributeValue("encoding", encoding); //$NON-NLS-1$
}
loader.update(o);
} else if(o instanceof Reloadable) {
@@ -610,10 +613,10 @@
if(f.isDirectory()) {
Properties p = new Properties();
p.setProperty(XModelObjectConstants.ATTR_NAME, f.getName());
- c = getModel().createModelObject("FileFolder", p);
+ c = getModel().createModelObject("FileFolder", p); //$NON-NLS-1$
String pp = FilePathHelper.toPathPath(f.getName());
if(linked.containsKey(pp)) {
- c.setObject("file", linked.get(pp));
+ c.setObject("file", linked.get(pp)); //$NON-NLS-1$
}
} else {
Properties ep = getEntityProperties(f);
@@ -661,7 +664,7 @@
o.removeFromParent();
} else {
saveChild(o, peer, rf);
- XActionInvoker.invoke("Open", o, null);
+ XActionInvoker.invoke("Open", o, null); //$NON-NLS-1$
}
if(d) peer.unregisterDir(rf); else peer.unregister(rf);
}
@@ -675,7 +678,7 @@
if(o.getModel().getModelBuffer().source() == o && rf.exists() && o.getModelEntity().getAttribute(XModelObjectConstants.ATTR_NAME__FILE) != null) {
File temp = null;
try {
- temp = File.createTempFile("efs_", rf.getName());
+ temp = File.createTempFile("efs_", rf.getName()); //$NON-NLS-1$
} catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
@@ -702,10 +705,11 @@
}
private static int question(XModelObject o) {
- String t = "File" + " " + o.getModelEntity().getRenderer().getTitle(o);
- return o.getModel().getService().showDialog("Update",
- t + " is removed from the disk.\n " +
- "Do you want to save your changes?", new String[]{"Yes", "No"}, null,
+ return o.getModel().getService().showDialog("Update",
+ MessageFormat
+ .format(
+ "File {0} is removed from the disk.\n Do you want to save your changes?",
+ o.getModelEntity().getRenderer().getTitle(o)), new String[]{"Yes", "No"}, null,
ServiceDialog.QUESTION);
}
@@ -908,7 +912,7 @@
public static void parseFileName(Properties p, String fn) {
int i = fn.lastIndexOf('.');
String n = (i < 0) ? fn : fn.substring(0, i);
- String e = (i < 0) ? "" : fn.substring(i + 1);
+ String e = (i < 0) ? "" : fn.substring(i + 1); //$NON-NLS-1$
p.setProperty(XModelObjectConstants.ATTR_NAME, n);
p.setProperty(XModelObjectConstants.ATTR_NAME_EXTENSION, e);
}
@@ -924,12 +928,12 @@
}
static boolean isLateloadFile(XModelObject o) {
- return (o.getModelEntity().getAttribute("_lateload") != null &&
+ return (o.getModelEntity().getAttribute("_lateload") != null && //$NON-NLS-1$
o.getModelEntity().getAttribute(XModelObjectConstants.ATTR_NAME_BODY) != null);
}
static boolean isLateloadFile2(XModelObject o) {
- return (o.getModelEntity().getAttribute("_lateload") != null);
+ return (o.getModelEntity().getAttribute("_lateload") != null); //$NON-NLS-1$
}
protected void copy_children(XModelObject copy, boolean transform) {
@@ -945,18 +949,18 @@
private void initEditability() {
if(editability > -1) return;
- editability = (null != getModelEntity().getActionList().getItem("DeleteActions").getItem("Delete"))
+ editability = (null != getModelEntity().getActionList().getItem("DeleteActions").getItem("Delete")) //$NON-NLS-1$ //$NON-NLS-2$
? 1 : 0;
}
public boolean isObjectEditable() {
initEditability();
- return (editability == 1 && !XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive());
+ return (editability == 1 && !XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()); //$NON-NLS-1$
}
public String getMainIconName() {
- if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) {
- String oin = get("overlappedSystem");
+ if(XModelObjectConstants.TRUE.equals(get("overlapped")) && isActive()) { //$NON-NLS-1$
+ String oin = get("overlappedSystem"); //$NON-NLS-1$
XModelObject o = (oin == null || oin.length() == 0) ? null : getModel().getByPath(oin);
if(o == null) {
o = this;
@@ -1013,7 +1017,7 @@
public boolean isOverlapped() {
XModelObject p = this;
- while(p != null && !XModelObjectConstants.TRUE.equals(get("overlapped"))) p = p.getParent();
+ while(p != null && !XModelObjectConstants.TRUE.equals(get("overlapped"))) p = p.getParent(); //$NON-NLS-1$
return p != null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HelpOverlappedFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HelpOverlappedFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HelpOverlappedFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public class HelpOverlappedFileSystemHandler extends HelpHandler {
public void executeHandler(XModelObject object, Properties prop) throws XModelException {
- if(object != null) help(object.getModel(), "OverlappedFileSystem");
+ if(object != null) help(object.getModel(), "OverlappedFileSystem"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HiddenSystemsHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HiddenSystemsHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/HiddenSystemsHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -28,28 +28,28 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
- SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizards.query.list.HiddenFileSystemsWizard");
+ SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizards.query.list.HiddenFileSystemsWizard"); //$NON-NLS-1$
XModelObject[] fs = object.getChildren();
String[][] vs = new String[fs.length][];
for (int i = 0; i < vs.length; i++) {
String name = fs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
Properties fsp = XModelObjectUtil.toProperties(fs[i]);
- String hidden = "" + fsp.getProperty("hidden", XModelObjectConstants.NO);
- String jar = "" + "FileSystemJar".equals(fs[i].getModelEntity().getName());
+ String hidden = "" + fsp.getProperty("hidden", XModelObjectConstants.NO); //$NON-NLS-1$ //$NON-NLS-2$
+ String jar = "" + "FileSystemJar".equals(fs[i].getModelEntity().getName()); //$NON-NLS-1$ //$NON-NLS-2$
vs[i] = new String[]{name, hidden, jar};
}
if(p == null) p = new Properties();
- p.put("data", vs);
- p.setProperty("help", "FileSystems_ShowHide");
+ p.put("data", vs); //$NON-NLS-1$
+ p.setProperty("help", "FileSystems_ShowHide"); //$NON-NLS-1$ //$NON-NLS-2$
wizard.setObject(p);
if(wizard.execute() != 0) return;
boolean ch = false;
for (int i = 0; i < vs.length; i++) {
Properties fsp = XModelObjectUtil.toProperties(fs[i]);
- String hidden = "" + fsp.getProperty("hidden", XModelObjectConstants.NO);
+ String hidden = "" + fsp.getProperty("hidden", XModelObjectConstants.NO); //$NON-NLS-1$ //$NON-NLS-2$
if(hidden.equals(vs[i][1])) continue;
- fsp.setProperty("hidden", vs[i][1]);
- fs[i].setAttributeValue("info", XModelObjectUtil.toString(fsp));
+ fsp.setProperty("hidden", vs[i][1]); //$NON-NLS-1$
+ fs[i].setAttributeValue("info", XModelObjectUtil.toString(fsp)); //$NON-NLS-1$
fs[i].setModified(true);
ch = true;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -66,11 +66,11 @@
loading = true;
templocation = null;
try {
- int ind = location.indexOf(":/");
+ int ind = location.indexOf(":/"); //$NON-NLS-1$
if (ind != 1 && ind != -1) {
int extI = location.lastIndexOf('.');
- String ext = extI >= 0 ? location.substring(extI) : ".jar";
- File f = File.createTempFile("efs_", ext);
+ String ext = extI >= 0 ? location.substring(extI) : ".jar"; //$NON-NLS-1$
+ File f = File.createTempFile("efs_", ext); //$NON-NLS-1$
f.deleteOnExit();
InputStream i = new java.net.URL(location).openConnection().getInputStream();
FileOutputStream o = new FileOutputStream(f);
@@ -100,7 +100,7 @@
ZipFile jar = getZipFile();
map.clear();
fileEntries.clear();
- map.put("", new HashSet<String>());
+ map.put("", new HashSet<String>()); //$NON-NLS-1$
try {
if(jar == null) return;
Enumeration<?> en = jar.entries();
@@ -154,7 +154,7 @@
if (path.endsWith(XModelObjectConstants.SEPARATOR))
q = q.substring(0, path.length() - 1);
int i = q.lastIndexOf('/');
- String root = (i < 0) ? "" : path.substring(0, i);
+ String root = (i < 0) ? "" : path.substring(0, i); //$NON-NLS-1$
String name = (i < 0) ? path : path.substring(i + 1);
return new String[] { root, name };
}
@@ -165,7 +165,7 @@
map.put(path, new HashSet<String>());
String[] parsed = parse(path);
check(parsed[0]);
- if ("".equals(parsed[1]))
+ if ("".equals(parsed[1])) //$NON-NLS-1$
return;
HashSet<String> set = map.get(parsed[0]);
set.add(parsed[1] + XModelObjectConstants.SEPARATOR);
@@ -190,7 +190,7 @@
jar = getZipFile();
} catch (IOException e) {
unlockJar();
- return "";
+ return ""; //$NON-NLS-1$
}
int length = 0;
BufferedInputStream bs = null;
@@ -218,7 +218,7 @@
return sb.toString();
} catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
- return "";
+ return ""; //$NON-NLS-1$
} finally {
unlockJar();
if(bs!=null) {
@@ -245,7 +245,7 @@
if (path == null)
return false;
int i = path.lastIndexOf('/');
- String p = (i < 0) ? "" : path.substring(0, i);
+ String p = (i < 0) ? "" : path.substring(0, i); //$NON-NLS-1$
String n = path.substring(i + 1);
Set<String> set = map.get(p);
return set != null && set.contains(n);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -68,7 +68,7 @@
if(d) {
p.clear();
p.setProperty(XModelObjectConstants.ATTR_NAME, cs[i]);
- XModelObject c = getModel().createModelObject("JarFolder", p);
+ XModelObject c = getModel().createModelObject("JarFolder", p); //$NON-NLS-1$
addChild(c);
} else {
createFileObject(jar, path, cs[i]);
@@ -85,14 +85,14 @@
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String body = null;
String entity = getModel().getEntityRecognizer().getEntityName(ext, body);
- if("FileAny".equals(entity)) {
+ if("FileAny".equals(entity)) { //$NON-NLS-1$
if(jar.getSize(cpath) > 100000) entity = XModelObjectConstants.ENT_FILE_ANY_LONG;
- else if(jar.isTextEntry(cpath, 100)) entity = "FileTXT";
+ else if(jar.isTextEntry(cpath, 100)) entity = "FileTXT"; //$NON-NLS-1$
} else if(entity == null) {
body = jar.getContent(cpath);
entity = getModel().getEntityRecognizer().getEntityName(ext, body);
}
- if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny";
+ if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny"; //$NON-NLS-1$
XModelObject c = getModel().createModelObject(entity, p);
if(FolderImpl.isLateloadFile2(c)) {
FileAnyImpl ci = (FileAnyImpl)c;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -36,7 +36,7 @@
}
protected String getAbsolutePath() {
- return "";
+ return ""; //$NON-NLS-1$
}
protected void loadChildren() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/LFileObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/LFileObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/LFileObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,7 +21,7 @@
this.root = root;
this.relpath = relpath;
aliaspath = relpath.length() == 0 ? alias : alias + '/' + relpath;
- String fn = (relpath.length() == 0) ? "" + root : "" + root + '/' + relpath;
+ String fn = (relpath.length() == 0) ? "" + root : "" + root + '/' + relpath; //$NON-NLS-1$ //$NON-NLS-2$
f = new File(fn);
}
@@ -54,7 +54,7 @@
}
public String read() {
- return f == null ? "" : XModelObjectLoaderUtil.readFile(f);
+ return f == null ? "" : XModelObjectLoaderUtil.readFile(f); //$NON-NLS-1$
}
public void write(String s) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.filesystems.impl;
+import java.text.MessageFormat;
import java.util.*;
import java.io.*;
@@ -54,7 +55,9 @@
for (int i = 0; i < cs.length; i++) {
String loc = canonize(cs[i].get(XModelObjectConstants.ATTR_NAME_LOCATION), cs[i].getModel()) + XModelObjectConstants.SEPARATOR;
if(!loc.startsWith(location) && !location.startsWith(loc)) continue;
- String mes = "File system " + p.get(XModelObjectConstants.ATTR_NAME) + " will share files with file system " + cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ String mes = MessageFormat.format(
+ "File system {0} will share files with file system {1}",
+ p.get(XModelObjectConstants.ATTR_NAME), cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
ServiceDialog d = object.getModel().getService();
int q = d.showDialog(ModelMessages.WARNING, mes, new String[]{ModelMessages.OK, ModelMessages.Cancel}, null, ServiceDialog.WARNING);
return (q == 0);
@@ -76,13 +79,13 @@
if(name != null && name.length() > 0) return;
String location = p.getProperty(XModelObjectConstants.ATTR_NAME_LOCATION);
name = location.substring(location.lastIndexOf('/') + 1);
- if(name.length() == 0) name = "filesystem";
+ if(name.length() == 0) name = "filesystem"; //$NON-NLS-1$
name = XModelObjectUtil.createNewChildName(name, object);
p.setProperty(XModelObjectConstants.ATTR_NAME, name);
}
private void setRelativeToProject(XModelObject object, Properties p) {
- boolean isRelative = XModelObjectConstants.TRUE.equals(p.getProperty("set location relative to project"));
+ boolean isRelative = XModelObjectConstants.TRUE.equals(p.getProperty("set location relative to project")); //$NON-NLS-1$
if(!isRelative) return;
String location = canonize(p.getProperty(XModelObjectConstants.ATTR_NAME_LOCATION), object.getModel());
String project = canonize(XModelConstants.WORKSPACE_REF, object.getModel());
@@ -110,18 +113,18 @@
String s = XModelConstants.WORKSPACE_REF;
if(project.length() > 0) {
int q = new StringTokenizer(project, XModelObjectConstants.SEPARATOR).countTokens();
- for (int i = 0; i < q; i++) s += "/..";
+ for (int i = 0; i < q; i++) s += "/.."; //$NON-NLS-1$
}
if(location.length() > 0) s += XModelObjectConstants.SEPARATOR + location;
p.setProperty(XModelObjectConstants.ATTR_NAME_LOCATION, s);
}
- static SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.project.ClassPathUpdateWizard");
+ static SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.project.ClassPathUpdateWizard"); //$NON-NLS-1$
public static void updateClassPath(XModelObject fs) {
- if(fs.getModelEntity().getName().indexOf("ar") >= 0 && w != null) {
+ if(fs.getModelEntity().getName().indexOf("ar") >= 0 && w != null) { //$NON-NLS-1$
Properties p = new Properties();
- p.put("model", fs.getModel());
+ p.put("model", fs.getModel()); //$NON-NLS-1$
w.setObject(p);
w.execute();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,12 +10,13 @@
******************************************************************************/
package org.jboss.tools.common.model.filesystems.impl;
+import java.text.MessageFormat;
import org.jboss.tools.common.model.*;
public class MountFileSystemUndo extends UnmountFileSystemUndo {
public MountFileSystemUndo(XModelObject fs) {
super(fs);
- description = "Mount file system " + p.getProperty(XModelObjectConstants.ATTR_NAME_LOCATION);
+ description = MessageFormat.format("Mount file system {0}", p.getProperty(XModelObjectConstants.ATTR_NAME_LOCATION));
}
protected void doUndo() {
@@ -27,7 +28,7 @@
}
protected String getActionIcon() {
- return "images/actions/new.gif";
+ return "images/actions/new.gif"; //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFolderHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFolderHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFolderHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,11 +22,11 @@
public MountFolderHandler() {}
public boolean isEnabled(XModelObject object) {
- if(object == null || XModelObjectConstants.TRUE.equals(object.get("overlapped"))) return false;
+ if(object == null || XModelObjectConstants.TRUE.equals(object.get("overlapped"))) return false; //$NON-NLS-1$
String entity = object.getModelEntity().getName();
- if("FileFolder".equals(entity)) return true;
+ if("FileFolder".equals(entity)) return true; //$NON-NLS-1$
if(object.getFileType() == XFileObject.FILE &&
- "jar".equals(object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION)) &&
+ "jar".equals(object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION)) && //$NON-NLS-1$
isInFileFolderSystem(object)) return true;
return false;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MoveFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MoveFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MoveFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.model.*;
public class MoveFileSystemHandler extends MoveHandler {
- static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.struts.webprj.model.helpers.sync.SortFileSystems");
+ static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.struts.webprj.model.helpers.sync.SortFileSystems"); //$NON-NLS-1$
public void executeHandler(XModelObject object, Properties prop) throws XModelException {
if(!isEnabled(object)) return;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SaveFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SaveFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SaveFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
public class SaveFileHandler extends AbstractHandler {
- static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveEditorSpecialWizard");
+ static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.objecteditor.SaveEditorSpecialWizard"); //$NON-NLS-1$
public SaveFileHandler() {}
public boolean isEnabled(XModelObject object) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SelectOverlappedFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SelectOverlappedFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SelectOverlappedFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -26,7 +26,7 @@
public SelectOverlappedFileSystemHandler() {}
public boolean isEnabled(XModelObject o) {
- return o != null && (XModelObjectConstants.TRUE.equals(o.get("overlapped")));
+ return o != null && (XModelObjectConstants.TRUE.equals(o.get("overlapped"))); //$NON-NLS-1$
}
public void executeHandler(XModelObject object, java.util.Properties p) throws XModelException {
@@ -34,15 +34,15 @@
if(object == fs) return;
if(fs == null) {
if(object.isActive() && object.getFileType() == XModelObject.FILE
- && XActionInvoker.getAction("OpenFile", object) != null) {
- XActionInvoker.invoke("OpenFile", object, null);
+ && XActionInvoker.getAction("OpenFile", object) != null) { //$NON-NLS-1$
+ XActionInvoker.invoke("OpenFile", object, null); //$NON-NLS-1$
}
return;
}
Properties fsp = XModelObjectUtil.toProperties(fs);
- if(XModelObjectConstants.YES.equals(fsp.getProperty("hidden", XModelObjectConstants.NO))) {
- fsp.setProperty("hidden", XModelObjectConstants.NO);
- fs.setAttributeValue("info", XModelObjectUtil.toString(fsp));
+ if(XModelObjectConstants.YES.equals(fsp.getProperty("hidden", XModelObjectConstants.NO))) { //$NON-NLS-1$
+ fsp.setProperty("hidden", XModelObjectConstants.NO); //$NON-NLS-1$
+ fs.setAttributeValue("info", XModelObjectUtil.toString(fsp)); //$NON-NLS-1$
fs.setModified(true);
XModelImpl m = (XModelImpl)object.getModel();
m.fireStructureChanged(fs.getParent());
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SimpleFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SimpleFileImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/SimpleFileImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,15 +33,15 @@
}
public String getBody() {
- if(isIncorrect()) return get("incorrectBody");
- String abts = get("actualBodyTimeStamp");
- if(abts != null && (abts.equals("0") || abts.equals("" + getTimeStamp()))) {
- return get("correctBody");
+ if(isIncorrect()) return get("incorrectBody"); //$NON-NLS-1$
+ String abts = get("actualBodyTimeStamp"); //$NON-NLS-1$
+ if(abts != null && (abts.equals("0") || abts.equals("" + getTimeStamp()))) { //$NON-NLS-1$ //$NON-NLS-2$
+ return get("correctBody"); //$NON-NLS-1$
}
if(loader == null) loader = (SerializingLoader)XModelObjectLoaderUtil.getObjectLoader(this);
String body = loader.serializeObject(this);
- set("correctBody", body);
- set("actualBodyTimeStamp", "" + getTimeStamp());
+ set("correctBody", body); //$NON-NLS-1$
+ set("actualBodyTimeStamp", "" + getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
return body;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.filesystems.impl;
+import java.text.MessageFormat;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRemoveHandler;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.*;
@@ -46,8 +47,9 @@
private boolean handleModified(XModelObject object) {
if(!object.isModified()) return true;
ServiceDialog d = object.getModel().getService();
- String mes = "File system " + object.get(XModelObjectConstants.XML_ATTR_NAME) + " was modified.\n" +
- "Do you want to save changes?";
+ String mes = MessageFormat.format(
+ "File system {0} was modified.\nDo you want to save changes?",
+ object.get(XModelObjectConstants.XML_ATTR_NAME));
int i = d.showDialog(action.getDisplayName(), mes, new String[]{ModelMessages.Yes, ModelMessages.No, ModelMessages.Cancel}, null, ServiceDialog.QUESTION);
if(i == 1) return true;
if(i != 0) return false;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFileSystemUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.filesystems.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
@@ -31,9 +32,10 @@
p.setProperty(pns[i], fs.getAttributeValue(pns[i]));
}
String nm = (p.getProperty(pns[1]) != null) ? p.getProperty(pns[1]) :
- "Engines/remote model/ " + p.getProperty(pns[2]) +
- ":FileSystems/" + p.getProperty(pns[3]);
- description = "Unmount file system " + nm;
+ MessageFormat.format(
+ "Engines/remote model/ {0}:FileSystems/{1}",
+ p.getProperty(pns[2]), p.getProperty(pns[3]));
+ description = MessageFormat.format("Unmount file system {0}", nm);
}
protected void doUndo() {
@@ -43,13 +45,13 @@
}
protected void doRedo() {
- XModelObject o = model.getByPath("FileSystems/" + pathpart);
+ XModelObject o = model.getByPath("FileSystems/" + pathpart); //$NON-NLS-1$
if(o != null) o.removeFromParent();
MountFileSystemHandler.updateClassPath(o);
}
protected String getActionIcon() {
- return "images/actions/delete.gif";
+ return "images/actions/delete.gif"; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFolderHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFolderHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/UnmountFolderHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
public UnmountFolderHandler() {}
public boolean isEnabled(XModelObject object) {
- return (object != null && XModelObjectConstants.TRUE.equals(object.get("overlapped")));
+ return (object != null && XModelObjectConstants.TRUE.equals(object.get("overlapped"))); //$NON-NLS-1$
}
protected XModelObject getTrueSource(XModelObject source) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
public String getEntityName(String ext, String body) {
if(body == null) return null;
- return "efe".equals(ext) ? "FileAnyAuxiliary" : null;
+ return "efe".equals(ext) ? "FileAnyAuxiliary" : null; //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -23,7 +23,7 @@
}
public String get(String name) {
- if(!(XModelObjectConstants.XML_ATTR_NAME.equals(name) || "EXTENSION".equals(name))
+ if(!(XModelObjectConstants.XML_ATTR_NAME.equals(name) || "EXTENSION".equals(name)) //$NON-NLS-1$
&& getParent() != null) loadChildren();
return super.get(name);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/FileMainLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,8 +18,8 @@
public class FileMainLoader extends DefaultEntityLoader {
// private String MAIN_ENTITY = "XT_Main";
- private String EXT_ENTITY = "XT_External";
- private FileAuxiliary aux = new FileAuxiliary("efe", true);
+ private String EXT_ENTITY = "XT_External"; //$NON-NLS-1$
+ private FileAuxiliary aux = new FileAuxiliary("efe", true); //$NON-NLS-1$
public FileMainLoader() {}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
public String getEntityName(String ext, String body) {
if(body == null) return null;
- return "mfe".equals(ext) ? "FileXTMain" : null;
+ return "mfe".equals(ext) ? "FileXTMain" : null; //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/FolderPasteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/FolderPasteHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/FolderPasteHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
XModelObjectLoaderUtil.updateModifiedOnSave(child);
return;
}
- XActionInvoker.invoke("SaveActions.Save", child, new Properties());
+ XActionInvoker.invoke("SaveActions.Save", child, new Properties()); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameEclipseFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameEclipseFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameEclipseFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -32,7 +32,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
final IResource file = EclipseResourceUtil.getResource(object);
if(file == null) {
- XActionInvoker.invoke("EditActions.Rename", object, p);
+ XActionInvoker.invoke("EditActions.Rename", object, p); //$NON-NLS-1$
return;
}
Display.getDefault().asyncExec(new Runnable() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,7 +22,7 @@
// prompt file object to build body if it has not been done yet.
((FileAnyImpl)object).getAsText();
super.executeHandler(object, prop);
- XActionInvoker.invoke("SaveActions.Save", object, prop);
+ XActionInvoker.invoke("SaveActions.Save", object, prop); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileSystemHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/handlers/RenameFileSystemHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,13 +15,13 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultEditHandler;
public class RenameFileSystemHandler extends DefaultEditHandler {
- static String RFS = "root file system";
- static String SFS = "src file system";
+ static String RFS = "root file system"; //$NON-NLS-1$
+ static String SFS = "src file system"; //$NON-NLS-1$
public boolean isEnabled(XModelObject object) {
if(!super.isEnabled(object)) return false;
String nm = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
- return !"WEB-INF".equals(nm);
+ return !"WEB-INF".equals(nm); //$NON-NLS-1$
}
public void executeHandler(XModelObject object, Properties prop) throws XModelException {
if(!isEnabled(object) || data == null) return;
@@ -30,7 +30,7 @@
String oldName = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
edit(object, p);
String newName = p.getProperty(XModelObjectConstants.ATTR_NAME);
- XModelObject web = object.getModel().getByPath("Web");
+ XModelObject web = object.getModel().getByPath("Web"); //$NON-NLS-1$
if(web == null) return;
XModelObject[] ms = web.getChildren();
for (int i = 0; i < ms.length; i++) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -38,7 +38,7 @@
deleteAction.selectionChanged(new StructuredSelection(project));
deleteAction.run();
if(!project.exists()) {
- XActionInvoker.invoke("Registration.UnregisterInServerXML", FileSystemsHelper.getFileSystems(object.getModel()), null);
+ XActionInvoker.invoke("Registration.UnregisterInServerXML", FileSystemsHelper.getFileSystems(object.getModel()), null); //$NON-NLS-1$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenEditorHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenEditorHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenEditorHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
import org.jboss.tools.common.model.XModelObject;
public class OpenEditorHandler extends AbstractHandler {
- static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.editor.OpenEditorWizard");
+ static SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.editor.OpenEditorWizard"); //$NON-NLS-1$
public boolean isEnabled(XModelObject object) {
return (object != null && object.isActive());
@@ -26,11 +26,11 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(wizard == null) return;
if(p == null) p = new Properties();
- p.put("object", object);
+ p.put("object", object); //$NON-NLS-1$
wizard.setObject(p);
int i = wizard.execute();
- if(i != 0 && p.get("exception") != null) {
- Exception e = (Exception)p.get("exception");
+ if(i != 0 && p.get("exception") != null) { //$NON-NLS-1$
+ Exception e = (Exception)p.get("exception"); //$NON-NLS-1$
if(e instanceof XModelException) throw (XModelException)e;
throw new XModelException(e);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenJavaEditorHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenJavaEditorHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/OpenJavaEditorHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -42,7 +42,7 @@
String className =
EclipseResourceUtil.getJavaClassQualifiedName(object).replace('.', '/') +
- "." + object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION);
+ "." + object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION); //$NON-NLS-1$
IJavaElement javaElement = javaProject.findElement(new Path(className));
if(javaElement != null) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/ProjectPropertiesHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/ProjectPropertiesHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/ProjectPropertiesHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,7 +33,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
IMenuManager m = findWorkbenchMenuManager(IWorkbenchActionConstants.M_PROJECT);
- final IAction action = findAction(m, "org.eclipse.ui.project.properties");
+ final IAction action = findAction(m, "org.eclipse.ui.project.properties"); //$NON-NLS-1$
if(action == null) return;
Display.getDefault().asyncExec(new Runnable() {
public void run() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.handlers;
import java.io.*;
+import java.text.MessageFormat;
import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
@@ -36,9 +37,9 @@
String nature = getNature(object);
if(nature == null) return false;
XActionImpl i = (XActionImpl)action;
- String n = (nature.indexOf("struts") > 0) ? "Struts" :
- (nature.indexOf("jsf") > 0) ? "JSF" : "Model";
- i.setDisplayName("Remove " + n + " Capabilities");
+ String n = (nature.indexOf("struts") > 0) ? "Struts" : //$NON-NLS-1$ //$NON-NLS-2$
+ (nature.indexOf("jsf") > 0) ? "JSF" : "Model"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ i.setDisplayName(MessageFormat.format("Remove {0} Capabilities", n));
return true;
}
@@ -50,7 +51,7 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
IProject project = EclipseResourceUtil.getProject(object);
- String nature = (p == null) ? null : p.getProperty("nature");
+ String nature = (p == null) ? null : p.getProperty("nature"); //$NON-NLS-1$
if(nature == null) nature = getNature(object);
if (project == null || nature == null) return;
@@ -65,7 +66,7 @@
pd.put(ServiceDialog.CHECKED, Boolean.FALSE);
if(!dialog.openConfirm(pd)) return;
- SpecialWizard contribution = p == null ? null : (SpecialWizard)p.get("contribution");
+ SpecialWizard contribution = p == null ? null : (SpecialWizard)p.get("contribution"); //$NON-NLS-1$
if(contribution != null) {
contribution.setObject(object.getModel());
contribution.execute();
@@ -89,10 +90,10 @@
String projectLocation = project.getLocation().toString();
removeFiles(projectLocation, XModelConstants.getWorkspace(object.getModel()));
if(unregisterWTP) {
- File f = new File(projectLocation + "/.settings");
+ File f = new File(projectLocation + "/.settings"); //$NON-NLS-1$
if(f.isDirectory()) FileUtil.remove(f);
}
- clear(object.getModel().getByPath("FileSystems/WEB-INF"));
+ clear(object.getModel().getByPath("FileSystems/WEB-INF")); //$NON-NLS-1$
project.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
throw new XModelException(e);
@@ -137,7 +138,7 @@
while (iterator.hasNext()) {
IClasspathEntry entry = iterator.next();
if(entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if(entry.getPath().toString().indexOf(".jst.") >= 0) {
+ if(entry.getPath().toString().indexOf(".jst.") >= 0) { //$NON-NLS-1$
iterator.remove();
continue;
}
@@ -164,12 +165,12 @@
void unregisterFromServer(XModelObject object) {
XModelObject fs = FileSystemsHelper.getFileSystems(object.getModel());
- XAction action = XActionInvoker.getAction("Registration.UnregisterInServerXML", fs);
+ XAction action = XActionInvoker.getAction("Registration.UnregisterInServerXML", fs); //$NON-NLS-1$
if(action != null) {
Properties runningProperties = new Properties();
- runningProperties.setProperty("unregisterFromAllServers", XModelObjectConstants.TRUE);
- runningProperties.setProperty("showResult", XModelObjectConstants.FALSE);
- XActionInvoker.invoke("Registration.UnregisterInServerXML", fs, runningProperties);
+ runningProperties.setProperty("unregisterFromAllServers", XModelObjectConstants.TRUE); //$NON-NLS-1$
+ runningProperties.setProperty("showResult", XModelObjectConstants.FALSE); //$NON-NLS-1$
+ XActionInvoker.invoke("Registration.UnregisterInServerXML", fs, runningProperties); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RunAntHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RunAntHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RunAntHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.handlers;
+import java.text.MessageFormat;
import java.util.Properties;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.*;
@@ -32,7 +33,7 @@
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
- ILaunchShortcut sc = findLaunchShortcut("org.eclipse.ant.ui.antShortcutWithDialog");
+ ILaunchShortcut sc = findLaunchShortcut("org.eclipse.ant.ui.antShortcutWithDialog"); //$NON-NLS-1$
IFile file = (IFile)object.getAdapter(IFile.class);
sc.launch(new StructuredSelection(file), ILaunchManager.RUN_MODE);
}
@@ -40,7 +41,7 @@
static IObjectActionDelegate findPopupMenusObjectAction(String pluginId, String actionId) {
Platform.getBundle(pluginId);
try {
- return (IObjectActionDelegate)ExtensionPointUtil.findClassByElementId("org.eclipse.ui.popupMenus", actionId);
+ return (IObjectActionDelegate)ExtensionPointUtil.findClassByElementId("org.eclipse.ui.popupMenus", actionId); //$NON-NLS-1$
} catch (IllegalArgumentException ex) {
//ignore
} catch (CoreException ex) {
@@ -52,18 +53,18 @@
}
static ILaunchShortcut findLaunchShortcut(String shortcutId) throws XModelException {
- String pointId = "org.eclipse.debug.ui.launchShortcuts";
+ String pointId = "org.eclipse.debug.ui.launchShortcuts"; //$NON-NLS-1$
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pointId);
- if(point == null) throw new XModelException("Cannot find extension point " + pointId);
+ if(point == null) throw new XModelException(MessageFormat.format("Cannot find extension point {0}", pointId));
IConfigurationElement[] es = point.getConfigurationElements();
for (int i = 0; i < es.length; i++) {
- if(!shortcutId.equals(es[i].getAttribute("id"))) continue;
+ if(!shortcutId.equals(es[i].getAttribute("id"))) continue; //$NON-NLS-1$
try {
- return (ILaunchShortcut)es[i].createExecutableExtension("class");
+ return (ILaunchShortcut)es[i].createExecutableExtension("class"); //$NON-NLS-1$
} catch (CoreException e) {
throw new XModelException(e);
}
}
- throw new XModelException("Cannot find launch shortcut " + shortcutId);
+ throw new XModelException(MessageFormat.format("Cannot find launch shortcut {0}", shortcutId));
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/EngineIcon.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/EngineIcon.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/EngineIcon.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,7 +12,6 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
public class EngineIcon implements ImageComponent {
@@ -25,8 +24,8 @@
public Image getImage(XModelObject obj) {
boolean b = true;
- String s = (b) ? "engine.running" : "engine.stopped";
- return obj.getModelEntity().getMetaModel().getIconList().getImage(s, "default.unknown");
+ String s = (b) ? "engine.running" : "engine.stopped"; //$NON-NLS-1$ //$NON-NLS-2$
+ return obj.getModelEntity().getMetaModel().getIconList().getImage(s, "default.unknown"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,29 +18,29 @@
* @author Viacheslav Kabanovich
*/
public class LargeReferencedIcons implements ImageComponent {
- static String DEFAULT_LARGE_ICON = "main.xstudio.palette.macro-tag-large";
+ static String DEFAULT_LARGE_ICON = "main.xstudio.palette.macro-tag-large"; //$NON-NLS-1$
ReferencedIcons ri = new ReferencedIcons();
private XStudioIcons studioicons = new XStudioIcons();
public LargeReferencedIcons() {}
public int getHash(XModelObject obj) {
- String x = obj.getAttributeValue("large icon");
+ String x = obj.getAttributeValue("large icon"); //$NON-NLS-1$
if (x == null || x.trim().length() == 0) {
- x = obj.getAttributeValue("icon");
+ x = obj.getAttributeValue("icon"); //$NON-NLS-1$
if (x == null || x.trim().length() == 0) {
return DEFAULT_LARGE_ICON.hashCode();
}
return ri.getHash(obj);
}
XModelObject r = obj.getModel().getByPath(x);
- return (r == null) ? "defaultimage".hashCode() : 718 + x.hashCode() + studioicons.getHash(r);
+ return (r == null) ? "defaultimage".hashCode() : 718 + x.hashCode() + studioicons.getHash(r); //$NON-NLS-1$
}
public Image getImage(XModelObject obj) {
- String v = obj.getAttributeValue("large icon");
+ String v = obj.getAttributeValue("large icon"); //$NON-NLS-1$
if(v == null || v.trim().length() == 0) {
- v = obj.getAttributeValue("icon");
+ v = obj.getAttributeValue("icon"); //$NON-NLS-1$
if(v == null || v.trim().length() == 0) {
return obj.getModelEntity().getMetaModel().getIconList().getImage(DEFAULT_LARGE_ICON);
}
@@ -49,7 +49,7 @@
XModelObject ic = (v == null || v.trim().length() == 0) ? null : obj.getModel().getByPath(v);
Image res = (ic == null || ic == obj) ? null : new XModelObjectIcon(ic).getEclipseImage();
if(res != null) return res;
- return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown");
+ return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ModifiersIcon.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ModifiersIcon.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ModifiersIcon.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -24,16 +24,16 @@
static {
XIconList list = XModelMetaDataImpl.getInstance().getIconList();
- ABS = list.getImage("modifiers.abstract");
- FIN = list.getImage("modifiers.final");
- PBC = list.getImage("modifiers.public");
- PTC = list.getImage("modifiers.protected");
- PLC = list.getImage("modifiers.package_local");
- PVC = list.getImage("modifiers.private");
- PBS = list.getImage("modifiers.public_static");
- PTS = list.getImage("modifiers.protected_static");
- PLS = list.getImage("modifiers.package_local_static");
- PVS = list.getImage("modifiers.private_static");
+ ABS = list.getImage("modifiers.abstract"); //$NON-NLS-1$
+ FIN = list.getImage("modifiers.final"); //$NON-NLS-1$
+ PBC = list.getImage("modifiers.public"); //$NON-NLS-1$
+ PTC = list.getImage("modifiers.protected"); //$NON-NLS-1$
+ PLC = list.getImage("modifiers.package_local"); //$NON-NLS-1$
+ PVC = list.getImage("modifiers.private"); //$NON-NLS-1$
+ PBS = list.getImage("modifiers.public_static"); //$NON-NLS-1$
+ PTS = list.getImage("modifiers.protected_static"); //$NON-NLS-1$
+ PLS = list.getImage("modifiers.package_local_static"); //$NON-NLS-1$
+ PVS = list.getImage("modifiers.private_static"); //$NON-NLS-1$
}
static Image add(Image front, Image back) {
@@ -70,25 +70,25 @@
public int getHash(XModelObject obj) {
if(!isShowingModifiers(obj)) return 0;
- String mod = obj.getAttributeValue("modifiers");
+ String mod = obj.getAttributeValue("modifiers"); //$NON-NLS-1$
return (mod == null) ? 0 : mod.hashCode();
}
public Image getImage(XModelObject obj) {
if(!isShowingModifiers(obj)) return null;
- String mod = obj.getAttributeValue("modifiers");
- int access = (mod.indexOf("public") >= 0) ? 0 :
- (mod.indexOf("protected") >= 0) ? 2 :
- (mod.indexOf("private") >= 0) ? 3 : 1;
- boolean isStatic = (mod.indexOf("static") >= 0);
- int override = (mod.indexOf("final") >= 0) ? 1 :
- (mod.indexOf("abstract") >= 0) ? 2 : 0;
+ String mod = obj.getAttributeValue("modifiers"); //$NON-NLS-1$
+ int access = (mod.indexOf("public") >= 0) ? 0 : //$NON-NLS-1$
+ (mod.indexOf("protected") >= 0) ? 2 : //$NON-NLS-1$
+ (mod.indexOf("private") >= 0) ? 3 : 1; //$NON-NLS-1$
+ boolean isStatic = (mod.indexOf("static") >= 0); //$NON-NLS-1$
+ int override = (mod.indexOf("final") >= 0) ? 1 : //$NON-NLS-1$
+ (mod.indexOf("abstract") >= 0) ? 2 : 0; //$NON-NLS-1$
return getModifiersIcon(access, isStatic, override);
}
private boolean isShowingModifiers(XModelObject obj) {
- XModelObject o = obj.getModel().getRoot("Preferences");
- return (o == null) ? true : XModelObjectConstants.YES.equals(o.getAttributeValue("show modifiers"));
+ XModelObject o = obj.getModel().getRoot("Preferences"); //$NON-NLS-1$
+ return (o == null) ? true : XModelObjectConstants.YES.equals(o.getAttributeValue("show modifiers")); //$NON-NLS-1$
}
private Image getModifiersIcon(int access, boolean isStatic, int override) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ReferencedIcons.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ReferencedIcons.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/ReferencedIcons.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,23 +20,23 @@
public ReferencedIcons() {}
public int getHash(XModelObject obj) {
- String x = obj.getAttributeValue("icon");
+ String x = obj.getAttributeValue("icon"); //$NON-NLS-1$
if (x == null || x.trim().length() == 0) return
- ((XEntityRendererImpl)obj.getModelEntity().getRenderer()).getIconInfo("imageref").hashCode();
+ ((XEntityRendererImpl)obj.getModelEntity().getRenderer()).getIconInfo("imageref").hashCode(); //$NON-NLS-1$
XModelObject r = obj.getModel().getByPath(x);
- return (r == null) ? "defaultimage".hashCode() : 718 + x.hashCode() + studioicons.getHash(r);
+ return (r == null) ? "defaultimage".hashCode() : 718 + x.hashCode() + studioicons.getHash(r); //$NON-NLS-1$
}
public Image getImage(XModelObject obj) {
- String v = obj.getAttributeValue("icon");
+ String v = obj.getAttributeValue("icon"); //$NON-NLS-1$
if(v == null || v.trim().length() == 0) {
- String s = ((XEntityRendererImpl)obj.getModelEntity().getRenderer()).getIconInfo("imageref");
+ String s = ((XEntityRendererImpl)obj.getModelEntity().getRenderer()).getIconInfo("imageref"); //$NON-NLS-1$
return obj.getModelEntity().getMetaModel().getIconList().getImage(s);
}
XModelObject ic = (v == null || v.trim().length() == 0) ? null : obj.getModel().getByPath(v);
Image res = (ic == null || ic == obj) ? null : new XModelObjectIcon(ic).getEclipseImage();
if(res != null) return res;
- return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown");
+ return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XIconListImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XIconListImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XIconListImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -50,7 +50,7 @@
}
public void load(Element element) {
- load("", element);
+ load("", element); //$NON-NLS-1$
}
protected void load(String prefix, Element element) {
@@ -65,11 +65,11 @@
String nm = prefix + c.getAttribute(NAME);
String pt = c.getAttribute(ICON_PATH);
iconnames.put(nm, pt);
- } else if(dp.equals("GROUP")) {
+ } else if(dp.equals("GROUP")) { //$NON-NLS-1$
String nm = c.getAttribute(NAME);
- load(prefix + nm + ".", c);
+ load(prefix + nm + ".", c); //$NON-NLS-1$
} else {
- load(prefix + dp + ".", c);
+ load(prefix + dp + ".", c); //$NON-NLS-1$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
if(components != null || object == null) return;
components = new Hashtable<String,ImageComponent>();
XModel model = object.getModel();
- XMapping mapping = model.getMetaData().getMapping("Icons");
+ XMapping mapping = model.getMetaData().getMapping("Icons"); //$NON-NLS-1$
if(mapping == null) return;
String[] keys = mapping.getKeys();
for (int i = 0; i < keys.length; i++) {
@@ -43,7 +43,7 @@
public Image getIcon1(String[] types) {
if(object == null) return null;
- String code = "" + getIconHash(types);
+ String code = "" + getIconHash(types); //$NON-NLS-1$
Image ii = cacheEclipse.get(code);
if(ii != null) return ii;
Vector<Image> v = new Vector<Image>(3);
@@ -84,7 +84,7 @@
public Image getEclipseImage0(String[] types) {
if(object == null) return null;
- String code = "" + getIconHash(types);
+ String code = "" + getIconHash(types); //$NON-NLS-1$
Image iie = cacheEclipse.get(code);
if(iie != null) return iie;
Image ii = getIcon1(types);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,13 +20,13 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
public class XStudioIcons implements ImageComponent {
- private static final String code = "abcdefghijklmnop";
+ private static final String code = "abcdefghijklmnop"; //$NON-NLS-1$
public XStudioIcons() {}
public String getImageString(String filename) {
byte[] b = getBytes(filename);
- return (b == null) ? "" : encode(b);
+ return (b == null) ? "" : encode(b); //$NON-NLS-1$
}
public String encode(byte[] b) {
@@ -79,12 +79,12 @@
}
public int getHash(XModelObject obj) {
- String s = obj.getAttributeValue("image");
- return (s == null || s.trim().length() == 0) ? "defaultimage".hashCode() : s.hashCode();
+ String s = obj.getAttributeValue("image"); //$NON-NLS-1$
+ return (s == null || s.trim().length() == 0) ? "defaultimage".hashCode() : s.hashCode(); //$NON-NLS-1$
}
public Image getImage(XModelObject obj) {
- String s = obj.getAttributeValue("image");
+ String s = obj.getAttributeValue("image"); //$NON-NLS-1$
byte[] b = decode(s);
if(b != null) {
try {
@@ -98,7 +98,7 @@
ModelPlugin.getPluginLog().logError(e);
}
}
- return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown");
+ return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,22 +20,22 @@
public String getPresentationString() {
String value = AnyElementPresentationManager.instance.getValue(this);
- return value != null ? value : "" + get("tag");
+ return value != null ? value : "" + get("tag"); //$NON-NLS-1$ //$NON-NLS-2$
}
public String name() {
- return "" + get("tag") + get(XModelObjectLoaderUtil.ATTR_ID_NAME);
+ return "" + get("tag") + get(XModelObjectLoaderUtil.ATTR_ID_NAME); //$NON-NLS-1$ //$NON-NLS-2$
}
public String[][] getAttributes() {
- String attrs = getAttributeValue("attributes");
- StringTokenizer st = new StringTokenizer(attrs, "" + SEPARATOR);
+ String attrs = getAttributeValue("attributes"); //$NON-NLS-1$
+ StringTokenizer st = new StringTokenizer(attrs, "" + SEPARATOR); //$NON-NLS-1$
int length = st.countTokens();
String[][] as = new String[length][2];
for (int i = 0; i < length; i++) {
String t = st.nextToken();
int k = t.indexOf('=');
- String n = k < 0 ? "" : t.substring(0, k);
+ String n = k < 0 ? "" : t.substring(0, k); //$NON-NLS-1$
String v = t.substring(k + 1);
as[i][0] = n;
as[i][1] = v;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementPresentationManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementPresentationManager.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/AnyElementPresentationManager.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -41,7 +41,7 @@
}
public String getValue(XModelObject object) {
- String tag = object.get("tag");
+ String tag = object.get("tag"); //$NON-NLS-1$
if(tag == null) return null;
String classname = tags.get(tag);
if(classname == null) return null;
@@ -62,12 +62,12 @@
}
private void init() {
- XMapping m = XModelMetaDataImpl.getInstance().getMapping("AnyElementPresentation");
+ XMapping m = XModelMetaDataImpl.getInstance().getMapping("AnyElementPresentation"); //$NON-NLS-1$
if(m == null) return;
String[] ks = m.getKeys();
for (int i = 0; i < ks.length; i++) {
String cn = m.getValue(ks[i]);
- String[] qs = ks[i].split(",");
+ String[] qs = ks[i].split(","); //$NON-NLS-1$
for (int j = 0; j < qs.length; j++) {
tags.put(qs[j], cn);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/CustomizedObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/CustomizedObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/CustomizedObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,25 +22,25 @@
if(attribute != null) return attribute;
XAttribute[] as = getModelEntity().getAttributes();
for (int i = 0; i < as.length; i++) {
- if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id"))) {
+ if(XModelObjectConstants.TRUE.equals(as[i].getProperty("id"))) { //$NON-NLS-1$
attribute = as[i].getName();
return attribute;
}
}
- ModelPlugin.getPluginLog().logInfo("No id attribute set for entity " + getModelEntity().getName());
+ ModelPlugin.getPluginLog().logInfo("No id attribute set for entity " + getModelEntity().getName()); //$NON-NLS-1$
attribute = as[0].getName();
return attribute;
}
public String name() {
- return "" + getAttributeValue(getAttribute());
+ return "" + getAttributeValue(getAttribute()); //$NON-NLS-1$
}
protected RegularChildren createChildren() {
- String children = getModelEntity().getProperty("children");
+ String children = getModelEntity().getProperty("children"); //$NON-NLS-1$
if(children == null || children.length() == 0) return new RegularChildren();
- if(children.equals("%Ordered%")) return new OrderedChildren();
- if(children.equals("%EntityOrdered%")) return new OrderedByEntityChildren();
+ if(children.equals("%Ordered%")) return new OrderedChildren(); //$NON-NLS-1$
+ if(children.equals("%EntityOrdered%")) return new OrderedByEntityChildren(); //$NON-NLS-1$
//
return new RegularChildren();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/EntityComparator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/EntityComparator.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/EntityComparator.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -47,8 +47,8 @@
if(ignoreCase) {
String p1 = s1.getPathPart();
String p2 = s2.getPathPart();
- p1 = (p1 == null) ? "" : p1.toLowerCase();
- p2 = (p2 == null) ? "" : p2.toLowerCase();
+ p1 = (p1 == null) ? "" : p1.toLowerCase(); //$NON-NLS-1$
+ p2 = (p2 == null) ? "" : p2.toLowerCase(); //$NON-NLS-1$
return p1.compareTo(p2);
}
return s1.getPathPart().compareTo(s2.getPathPart());
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/ExtraRootImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/ExtraRootImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/ExtraRootImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,7 +20,7 @@
}
public String getPathPart() {
- return "root:" + super.getPathPart();
+ return "root:" + super.getPathPart(); //$NON-NLS-1$
}
public String getLongPath() {
return getPathPart();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/OpenedProjectsImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/OpenedProjectsImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/OpenedProjectsImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -28,7 +28,7 @@
if(!reopen) {
Properties p = new Properties();
p.setProperty(XModelObjectConstants.ATTR_NAME, name);
- c = getModel().createModelObject("Workspace", p);
+ c = getModel().createModelObject("Workspace", p); //$NON-NLS-1$
addChild_0(c);
}
int i = getIndexOfChild(c);
@@ -43,7 +43,7 @@
XModelObject[] os = children.getObjects();
if(os.length > MAX_PROJECT_COUNT)
for (int q = MAX_PROJECT_COUNT; q < os.length; q++) os[q].removeFromParent();
- set("OPEN", XModelObjectConstants.YES);
+ set("OPEN", XModelObjectConstants.YES); //$NON-NLS-1$
}
public XModelObject getChildByFile(String name) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/PropertyObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/PropertyObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/PropertyObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,19 +20,19 @@
public String getPathPart() {
String name = name();
- if(name == null || !XModelObjectConstants.NO.equals(get("ENABLED"))) return super.getPathPart();
- return "#" + name + '=' + get("VALUE");
+ if(name == null || !XModelObjectConstants.NO.equals(get("ENABLED"))) return super.getPathPart(); //$NON-NLS-1$
+ return "#" + name + '=' + get("VALUE"); //$NON-NLS-1$ //$NON-NLS-2$
}
public String getPresentationString() {
String name = name();
- if(name == null) return "";
- if(XModelObjectConstants.NO.equals(get("ENABLED"))) name = "#" + name;
- String value = get("VALUE");
- if(value == null) value = "";
- if(value.indexOf("\n") >= 0) value = value.substring(0, value.indexOf("\n")) + "...";
+ if(name == null) return ""; //$NON-NLS-1$
+ if(XModelObjectConstants.NO.equals(get("ENABLED"))) name = "#" + name; //$NON-NLS-1$ //$NON-NLS-2$
+ String value = get("VALUE"); //$NON-NLS-1$
+ if(value == null) value = ""; //$NON-NLS-1$
+ if(value.indexOf("\n") >= 0) value = value.substring(0, value.indexOf("\n")) + "..."; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(value.length() > MAX_VISIBLE_VALUE_LENGTH)
- value = value.substring(0, MAX_VISIBLE_VALUE_LENGTH) + "...";
+ value = value.substring(0, MAX_VISIBLE_VALUE_LENGTH) + "..."; //$NON-NLS-1$
return name + '=' + value;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RegularObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.meta.*;
@@ -110,7 +111,7 @@
if(getModelEntity().getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null) {
int k = 1;
while(c != null) {
- super.set(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + k);
+ super.set(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + k); //$NON-NLS-1$
npp = getPathPart();
c = p.children.change(this, opp, npp);
k++;
@@ -132,14 +133,14 @@
protected void elementExists(XModelObject o, String name, String value) {
if(getModel().getService() == null) return;
- String mes = "Cannot set " + getAttrNameByXMLName(name) + " = " + value +
- " for " + title(this) + "\n" +
- "because " + title(o) + " exists in the " + title(getParent());
+ String mes = MessageFormat.format(
+ "Cannot set {0} = {1} for {2}\nbecause {3} exists in the {4}",
+ getAttrNameByXMLName(name), value, title(this), title(o), title(getParent()));
getModel().getService().showDialog("Error", mes, new String[]{"OK"}, null, 1);
}
private static String title(XModelObject o) {
- return o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
+ return o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + //$NON-NLS-1$
o.getModelEntity().getRenderer().getTitle(o);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RootImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RootImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/RootImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,15 +21,15 @@
}
public String getLongPath() {
- return "";
+ return ""; //$NON-NLS-1$
}
public String getPath() {
- return "";
+ return ""; //$NON-NLS-1$
}
public String getPresentationString() {
- String s = getAttributeValue("project name");
+ String s = getAttributeValue("project name"); //$NON-NLS-1$
s = (s == null || s.length() == 0) ? super.getPresentationString() : s;
if(s == null) s = "Workspace";
return s;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -12,6 +12,7 @@
import java.io.File;
import java.io.PrintWriter;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -138,7 +139,7 @@
public XModelObject getRoot(String name) {
if(name == null || name.length() == 0) return getRoot();
- XMapping m = getMetaData().getMapping("Roots");
+ XMapping m = getMetaData().getMapping("Roots"); //$NON-NLS-1$
String path = m.getValue(name);
return (path == null || path.length() == 0) ? null :
getRoot().getChildByPath(path);
@@ -150,7 +151,7 @@
public XModelObject getByPath(String path) {
if(path == null || path.length() == 0) return getRoot();
- if(path.startsWith("root:")) {
+ if(path.startsWith("root:")) { //$NON-NLS-1$
int i = path.indexOf('/');
if(i < 0) return extraroots.get(path);
XModelObject r = extraroots.get(path.substring(0, i));
@@ -158,8 +159,8 @@
}
if(path.startsWith(XModelObjectConstants.SEPARATOR)) {
return getByPathInFileSystem(path.substring(1));
- } else if(path.startsWith("%")) {
- int i = path.indexOf("%"), j = path.lastIndexOf("%");
+ } else if(path.startsWith("%")) { //$NON-NLS-1$
+ int i = path.indexOf("%"), j = path.lastIndexOf("%"); //$NON-NLS-1$ //$NON-NLS-2$
if(i == j) return null;
String rt = path.substring(i + 1, j);
XModelObject ro = getRoot(rt);
@@ -184,10 +185,10 @@
if(o == null) o = model.getByPath(path);
if(o == null || !path.startsWith(XModelObjectConstants.SEPARATOR)) return o;
XModelObject p = o;
- while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent();
+ while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent(); //$NON-NLS-1$
if(p == null) return o;
path = o.getPath().substring(p.getPath().length());
- if(p.getModelEntity().getName().equals("FileFolder")) {
+ if(p.getModelEntity().getName().equals("FileFolder")) { //$NON-NLS-1$
XModelObject fs = findMountedFileSystem(p);
if(fs != null && path.length() > 1) {
XModelObject c = fs.getChildByPath(path.substring(1));
@@ -287,9 +288,9 @@
if(a == null) return null;
if(a.isTrimmable() && value != null) value = value.trim();
String ov = object.getAttributeValue(attributeName);
- ov = (ov == null) ? "" : ov;
- if(value.length() == 0 && XModelObjectConstants.TRUE.equals(a.getProperty("required"))) {
- String mes = "Attribute " + a.getName() + " is required.";
+ ov = (ov == null) ? "" : ov; //$NON-NLS-1$
+ if(value.length() == 0 && XModelObjectConstants.TRUE.equals(a.getProperty("required"))) { //$NON-NLS-1$
+ String mes = MessageFormat.format("Attribute {0} is required.", a.getName());
return mes;
}
XAttributeConstraint c = a.getConstraint();
@@ -312,10 +313,10 @@
if(a == null) return;
if(a.isTrimmable() && value != null) value = value.trim();
String ov = object.getAttributeValue(attributeName);
- ov = (ov == null) ? "" : ov;
+ ov = (ov == null) ? "" : ov; //$NON-NLS-1$
if(!isDifferent(ov, value)) return;
- if(value.length() == 0 && XModelObjectConstants.TRUE.equals(a.getProperty("required"))) {
- String mes = "Attribute " + a.getName() + " is required.";
+ if(value.length() == 0 && XModelObjectConstants.TRUE.equals(a.getProperty("required"))) { //$NON-NLS-1$
+ String mes = MessageFormat.format("Attribute {0} is required.", a.getName());
service.showDialog("Error",
mes, new String[]{"OK"}, null, ServiceDialog.ERROR);
return;
@@ -347,7 +348,7 @@
}
}
String nv = object.setAttributeValue(attributeName, value);
- nv = (nv == null) ? "" : nv;
+ nv = (nv == null) ? "" : nv; //$NON-NLS-1$
ent.setDependentValues(object, attributeName);
XChangeUndo cu = new XChangeUndo(object, attributeName, ov);
undoer.addUndoable(cu);
@@ -413,13 +414,13 @@
////ProjectWatcher
private void loadWatcher() {
if(getProperties().get(XModelObjectConstants.PROJECT) == null) return;
- XObjectLoader l = (XObjectLoader)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.project.WatcherLoader");
+ XObjectLoader l = (XObjectLoader)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.project.WatcherLoader"); //$NON-NLS-1$
XModelObject fs = getByPath(FileSystemsHelper.FILE_SYSTEMS);
if(l != null && fs != null) l.load(fs);
}
public boolean isDummy() {
- return "RootDummy".equals(getRoot().getModelEntity().getName());
+ return "RootDummy".equals(getRoot().getModelEntity().getName()); //$NON-NLS-1$
}
private String reduceURLPath(String p) {
@@ -444,9 +445,9 @@
XModelObjectImpl r = (XModelObjectImpl)getRoot();
String project = getProjectName();
if(project == null) {
- r.setEntityName_0("RootDummy");
+ r.setEntityName_0("RootDummy"); //$NON-NLS-1$
} else {
- r.setAttributeValue("project name", project);
+ r.setAttributeValue("project name", project); //$NON-NLS-1$
r.setEntityName_0(rootEntity);
}
}
@@ -458,19 +459,19 @@
public void save() {
XModelObject r = getRoot();
- r.set("isSaveOn", XModelObjectConstants.TRUE);
+ r.set("isSaveOn", XModelObjectConstants.TRUE); //$NON-NLS-1$
XModelObjectLoaderUtil.getObjectLoader(r).save(r);
- r.set("isSaveOn", "");
+ r.set("isSaveOn", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
public void saveOptions() {
- XModelObject o = getRoot("XStudio");
+ XModelObject o = getRoot("XStudio"); //$NON-NLS-1$
if(o != null) XModelObjectLoaderUtil.getObjectLoader(o).save(o);
}
public void setExtraRoot(XModelObject r) {
String pathpart = r.getPathPart();
- if(!pathpart.startsWith("root:")) throw new IllegalArgumentException("Not extra root: " + pathpart);
+ if(!pathpart.startsWith("root:")) throw new IllegalArgumentException("Not extra root: " + pathpart); //$NON-NLS-1$ //$NON-NLS-2$
extraroots.put(pathpart, r);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -65,9 +65,9 @@
public void changeEntity(String name) {
if(entity.getName().equals(name)) return;
XModelEntity newEntity = entity.getMetaModel().getEntity(name);
- if(newEntity == null) throw new IllegalArgumentException("Entity " + name + " does not exist.");
+ if(newEntity == null) throw new IllegalArgumentException("Entity " + name + " does not exist."); //$NON-NLS-1$ //$NON-NLS-2$
if(entity.getImplementingClass() != newEntity.getImplementingClass()) {
- throw new IllegalArgumentException("Cannot convert entity " + entity.getName() + " to " + name + " because they have different implementations.");
+ throw new IllegalArgumentException("Cannot convert entity " + entity.getName() + " to " + name + " because they have different implementations."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
Properties p = new Properties();
XAttribute[] as = entity.getAttributes();
@@ -82,7 +82,7 @@
String n = as[i].getName();
String v = p.getProperty(n);
if(v == null) v = as[i].getDefaultValue();
- if(v == null) v = "";
+ if(v == null) v = ""; //$NON-NLS-1$
setAttributeValue(n, v);
}
}
@@ -164,7 +164,7 @@
}
public String setAttributeValue(String name, String value) {
- if(getModelEntity().getAttribute(name) == null) return "";
+ if(getModelEntity().getAttribute(name) == null) return ""; //$NON-NLS-1$
String ov = getAttributeValue(name);
if(value != null && value.equals(ov)) return ov;
String path = getPath();
@@ -286,12 +286,12 @@
public String getPath() {
String lp = getLongPath();
if(lp == null) return null;
- XMapping m = getModel().getMetaData().getMapping("Roots");
- String h = "" + lp;
+ XMapping m = getModel().getMetaData().getMapping("Roots"); //$NON-NLS-1$
+ String h = "" + lp; //$NON-NLS-1$
do {
int ib = h.lastIndexOf('/');
String q = h.substring(ib + 1), r = m.getValue(q);
- if(r != null && h.equals(r)) return "%" + q + "%" + lp.substring(r.length());
+ if(r != null && h.equals(r)) return "%" + q + "%" + lp.substring(r.length()); //$NON-NLS-1$ //$NON-NLS-2$
if(ib >= 0) h = h.substring(0, ib); else h = null;
} while(h != null);
return lp;
@@ -305,11 +305,11 @@
public XModelObject getChildByPath(String path) {
int i = path.indexOf(XModelObjectConstants.SEPARATOR);
String n = (i < 0) ? path : path.substring(0, i);
- String f = (i < 0) ? "" : path.substring(i + 1);
+ String f = (i < 0) ? "" : path.substring(i + 1); //$NON-NLS-1$
XModelObject me = getChildByPathPart(n);
if(me == null) {
- if(n.equals("..")) me = getParent();
- else if(n.equals(".")) me = this;
+ if(n.equals("..")) me = getParent(); //$NON-NLS-1$
+ else if(n.equals(".")) me = this; //$NON-NLS-1$
}
return (me == null || i < 0) ? me : ((XModelObjectImpl)me).getChildByPath(f);
}
@@ -399,9 +399,9 @@
public String getMainIconName() {
try {
- return getModelEntity().getRenderer().getIconInfo("main");
+ return getModelEntity().getRenderer().getIconInfo("main"); //$NON-NLS-1$
} catch (NullPointerException e) {
- return "main.closedbox";
+ return "main.closedbox"; //$NON-NLS-1$
}
}
@@ -445,7 +445,7 @@
static ModelObjectAdapterExtensionPoint ep = ModelObjectAdapterExtensionPoint.getInstance();
- private static IModelObjectAdapter propertySource = ep.getAdapter("IPropertySource");
+ private static IModelObjectAdapter propertySource = ep.getAdapter("IPropertySource"); //$NON-NLS-1$
public Object getAdapter(Class adapter) {
if(XModelObject.class == adapter) return this;
@@ -458,7 +458,7 @@
} else if(adapter == IJavaElement.class) {
return EclipseResourceUtil.findJavaElement(this);
} else if(adapter == IActionFilter.class) {
- IModelObjectAdapter af = ep.getAdapter("IActionFilter");
+ IModelObjectAdapter af = ep.getAdapter("IActionFilter"); //$NON-NLS-1$
if(af != null) af.setModelObject(this);
return af;
} else if (adapter == IPropertySource.class) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/BundleItemObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/BundleItemObjectImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/BundleItemObjectImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
private static final long serialVersionUID = 1L;
public String name() {
- return "" + getAttributeValue("language") + ":" + getAttributeValue("country");
+ return "" + getAttributeValue("language") + ":" + getAttributeValue("country"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/CountriesHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/CountriesHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/bundle/CountriesHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -34,21 +34,21 @@
if(countries != null) return;
countries = new TreeMap<String,String>();
}
- countries.put("", "default");
+ countries.put("", "default"); //$NON-NLS-1$ //$NON-NLS-2$
languages = new TreeMap<String,String>();
- languages.put("", "default");
- loadMap(countries, "meta/countries.txt");
- loadMap(languages, "meta/languages.txt");
- loadEntity(model, "ValidationFormset");
- loadEntity(model, "ValidationFormset11");
+ languages.put("", "default"); //$NON-NLS-1$ //$NON-NLS-2$
+ loadMap(countries, "meta/countries.txt"); //$NON-NLS-1$
+ loadMap(languages, "meta/languages.txt"); //$NON-NLS-1$
+ loadEntity(model, "ValidationFormset"); //$NON-NLS-1$
+ loadEntity(model, "ValidationFormset11"); //$NON-NLS-1$
// loadEntity(model, "BundleList");
}
private static void loadEntity(XModel model, String entityName) {
XModelEntity entity = model.getMetaData().getEntity(entityName);
if(entity == null) return;
- loadAttribute(countries, entity, "country");
- loadAttribute(languages, entity, "language");
+ loadAttribute(countries, entity, "country"); //$NON-NLS-1$
+ loadAttribute(languages, entity, "language"); //$NON-NLS-1$
}
private static void loadAttribute(Map<String,String> map, XModelEntity entity, String attr) {
@@ -60,7 +60,7 @@
try {
URL url = CountriesHelper.class.getClassLoader().getResource(resource);
String s = FileUtil.readStream(url.openStream());
- StringTokenizer st = new StringTokenizer(s, "\n");
+ StringTokenizer st = new StringTokenizer(s, "\n"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String t = st.nextToken();
int i = t.indexOf('.'), j = t.lastIndexOf('.');
@@ -69,7 +69,7 @@
map.put(code, name);
}
} catch (IOException e) {
- ModelPlugin.getPluginLog().logError("CountiesHelper:loadMap:" + e.getMessage());
+ ModelPlugin.getPluginLog().logError("CountiesHelper:loadMap:" + e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/AllResourcesTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/AllResourcesTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/AllResourcesTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -94,20 +94,20 @@
}
public String getValue(XModelObject object) {
- if(object == root) return "";
+ if(object == root) return ""; //$NON-NLS-1$
IResource resource = (IResource)object.getAdapter(IResource.class);
if(resource == null) {
XFilteredTree tree = getSubTree(object.getModel());
return XModelObjectConstants.SEPARATOR + EclipseResourceUtil.getProject(object).getName() + XModelObjectConstants.SEPARATOR + tree.getValue(object);
}
- return (resource == null) ? "" : resource.getFullPath().toString();
+ return (resource == null) ? "" : resource.getFullPath().toString(); //$NON-NLS-1$
}
public void setConstraint(Object object) {
Object[] os = (Object[])object;
XAttribute a = (XAttribute)os[0];
XAttributeConstraintT tc = (XAttributeConstraintT)a.getConstraint();
- String nature = tc.getProperties().getProperty("nature");
+ String nature = tc.getProperties().getProperty("nature"); //$NON-NLS-1$
IProject[] ps = ModelPlugin.getWorkspace().getRoot().getProjects();
for (int i = 0; i < ps.length; i++) {
if(!ps[i].isOpen()) continue;
@@ -115,7 +115,7 @@
if(nature != null && !ps[i].hasNature(nature)) continue;
} catch (CoreException e) {
if(ModelPlugin.isDebugEnabled()){
- ModelPlugin.getPluginLog().logInfo("AllResourcesTree:" + e.getMessage());
+ ModelPlugin.getPluginLog().logInfo("AllResourcesTree:" + e.getMessage()); //$NON-NLS-1$
}
continue;
}
@@ -140,10 +140,10 @@
public XModelObject find(String value) {
if(value == null || value.length() == 0) return root;
- if(value.indexOf("//") >= 0) {
- String pn = value.substring(1, value.indexOf("//"));
+ if(value.indexOf("//") >= 0) { //$NON-NLS-1$
+ String pn = value.substring(1, value.indexOf("//")); //$NON-NLS-1$
XFilteredTree tree = trees.get(pn);
- return (tree == null) ? null : tree.getRoot().getModel().getByPath(value.substring(value.indexOf("//") + 1));
+ return (tree == null) ? null : tree.getRoot().getModel().getByPath(value.substring(value.indexOf("//") + 1)); //$NON-NLS-1$
}
if(value.indexOf(XModelObjectConstants.SEPARATOR, 1) < 0) return null;
IResource r = ModelPlugin.getWorkspace().getRoot().getFolder(new Path(value));
@@ -167,9 +167,9 @@
}
public String getPath(XModelObject object) {
- if(object == root) return "";
+ if(object == root) return ""; //$NON-NLS-1$
IResource resource = (IResource)object.getAdapter(IResource.class);
- return (resource == null) ? "" : resource.getFullPath().toString();
+ return (resource == null) ? "" : resource.getFullPath().toString(); //$NON-NLS-1$
}
public void dispose() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultFilteredTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultFilteredTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultFilteredTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -89,7 +89,7 @@
}
public String getValue(XModelObject object) {
- return belongs(object) ? object.getPath() : "";
+ return belongs(object) ? object.getPath() : ""; //$NON-NLS-1$
}
public boolean belongs(XModelObject object) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSiftedTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSiftedTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSiftedTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -41,17 +41,17 @@
}
public boolean isSelectable(XModelObject object) {
- throw new MethodNotImplementedException("Not implemented");
+ throw new MethodNotImplementedException("Not implemented"); //$NON-NLS-1$
}
public String getValue(XModelObject object) {
- throw new MethodNotImplementedException("Not implemented");
+ throw new MethodNotImplementedException("Not implemented"); //$NON-NLS-1$
}
public void setConstraint(Object object) {}
public XModelObject find(String value) {
- throw new MethodNotImplementedException("Not implemented");
+ throw new MethodNotImplementedException("Not implemented"); //$NON-NLS-1$
}
public XModelObject getParent(XModelObject object) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSubTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSubTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/DefaultSubTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -38,14 +38,14 @@
}
public String getValue(XModelObject object) {
- if(object == root) return "";
+ if(object == root) return ""; //$NON-NLS-1$
String sr = root.getPath() + XModelObjectConstants.SEPARATOR;
String so = object.getPath();
return (so.startsWith(sr)) ? so.substring(sr.length()) : so;
}
public XModelObject find(String value) {
- return ("".equals(value)) ? root : root.getChildByPath(value);
+ return ("".equals(value)) ? root : root.getChildByPath(value); //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceBundleTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceBundleTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceBundleTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,13 +18,13 @@
public void setConstraint(Object object) {
extensions = new HashSet<String>();
- extensions.add("properties");
+ extensions.add("properties"); //$NON-NLS-1$
javaRootsOnly = true;
}
public String getValue(XModelObject object) {
String p = getPath(object);
- if(p != null && p.endsWith(".properties")) {
+ if(p != null && p.endsWith(".properties")) { //$NON-NLS-1$
p = p.substring(1, p.length() - 11).replace('/', '.');
}
return p;
@@ -32,7 +32,7 @@
public XModelObject find(String value) {
return (value == null || value.length() == 0) ? null :
- model.getByPath(XModelObjectConstants.SEPARATOR + value.replace('.', '/') + ".properties");
+ model.getByPath(XModelObjectConstants.SEPARATOR + value.replace('.', '/') + ".properties"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemResourceTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -49,19 +49,19 @@
Object[] os = (Object[])object;
XAttribute a = (XAttribute)os[0];
XAttributeConstraintT tc = (XAttributeConstraintT)a.getConstraint();
- String ext = tc.getProperties().getProperty("extensions");
+ String ext = tc.getProperties().getProperty("extensions"); //$NON-NLS-1$
if(ext != null) {
extensions = new HashSet<String>();
- StringTokenizer st = new StringTokenizer(ext, ",");
+ StringTokenizer st = new StringTokenizer(ext, ","); //$NON-NLS-1$
while(st.hasMoreTokens()) extensions.add(st.nextToken());
}
- String ent = tc.getProperties().getProperty("entities");
+ String ent = tc.getProperties().getProperty("entities"); //$NON-NLS-1$
if(ent != null) {
entities = new HashSet<String>();
- StringTokenizer st = new StringTokenizer(ent, ",");
+ StringTokenizer st = new StringTokenizer(ent, ","); //$NON-NLS-1$
while(st.hasMoreTokens()) entities.add(st.nextToken());
}
- String jro = tc.getProperties().getProperty("java_roots_only");
+ String jro = tc.getProperties().getProperty("java_roots_only"); //$NON-NLS-1$
if(XModelObjectConstants.TRUE.equals(jro)) {
javaRootsOnly = true;
}
@@ -92,7 +92,7 @@
public String getPath(XModelObject object) {
String p = object.getPath();
- if(p == null || !p.startsWith("FileSystems/")) return p;
+ if(p == null || !p.startsWith("FileSystems/")) return p; //$NON-NLS-1$
return XModelObjectLoaderUtil.getResourcePath(object);
}
@@ -115,7 +115,7 @@
protected boolean accepts0(XModelObject o) {
int type = o.getFileType();
- if(type == XModelObject.FOLDER) return !XModelObjectConstants.TRUE.equals(o.get("overlapped"));
+ if(type == XModelObject.FOLDER) return !XModelObjectConstants.TRUE.equals(o.get("overlapped")); //$NON-NLS-1$
if(type != XModelObject.FILE) return false;
String pathpart = o.getPathPart();
String pp = pathpart.substring(pathpart.lastIndexOf('.') + 1);
@@ -132,7 +132,7 @@
for (int i = 0; i < fs.length; i++) {
if(javaRootsOnly) {
if(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER.equals(fs[i].getModelEntity().getName())
- && !fs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME).startsWith("src")) {
+ && !fs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME).startsWith("src")) { //$NON-NLS-1$
continue;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -45,7 +45,7 @@
}
private void load() {
- XMapping m = model.getMetaData().getMapping("FilteredTreeConstraints");
+ XMapping m = model.getMetaData().getMapping("FilteredTreeConstraints"); //$NON-NLS-1$
if(m == null) return;
ArrayList<XFilteredTreeConstraint> l = new ArrayList<XFilteredTreeConstraint>();
String[] ks = m.getKeys();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/IconsTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/IconsTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/IconsTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,9 +15,9 @@
public IconsTree() {}
protected void onSetModel() {
- setRoot(model.getRoot("Icons"));
- addEntities(new String[]{"SharableIcons"});
- addEntities(new String[]{"SharableIcon"}, true);
+ setRoot(model.getRoot("Icons")); //$NON-NLS-1$
+ addEntities(new String[]{"SharableIcons"}); //$NON-NLS-1$
+ addEntities(new String[]{"SharableIcon"}, true); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/NavigationTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/NavigationTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/NavigationTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,8 +18,8 @@
private static final Set<String> escape = new HashSet<String>(2);
static {
- escape.add("SharableXStudio");
- escape.add("PrimitiveTypes");
+ escape.add("SharableXStudio"); //$NON-NLS-1$
+ escape.add("PrimitiveTypes"); //$NON-NLS-1$
// escape.put("Workspaces", "Workspaces");
}
@@ -33,7 +33,7 @@
public XModelObject[] getChildren(XModelObject object) {
if((object == model.getRoot() || object.getParent() == model.getRoot())
- && !"full".equals(System.getProperty("glory"))) {
+ && !"full".equals(System.getProperty("glory"))) { //$NON-NLS-1$ //$NON-NLS-2$
XModelObject[] c = object.getChildren();
ArrayList<XModelObject> v = new ArrayList<XModelObject>(c.length);
for (int i = 0; i < c.length; i++) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/PaletteTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/PaletteTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/PaletteTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,14 +19,14 @@
public void dispose() {}
public XModelObject getRoot() {
- return model.getRoot("XStudio");
+ return model.getRoot("XStudio"); //$NON-NLS-1$
}
public XModelObject[] getChildren(XModelObject object) {
return(object == getRoot())
? new XModelObject[]{
- object.getChildByPath("Icons"),
- object.getChildByPath("Palette")}
+ object.getChildByPath("Icons"), //$NON-NLS-1$
+ object.getChildByPath("Palette")} //$NON-NLS-1$
: super.getChildren(object);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/SearchTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/SearchTree.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/SearchTree.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
public void dispose() {}
public XModelObject getRoot() {
- return model.getRoot("Search");
+ return model.getRoot("Search"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/java/handlers/OpenJavaSourceHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/java/handlers/OpenJavaSourceHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/java/handlers/OpenJavaSourceHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -42,21 +42,21 @@
}
protected String getAttribute() {
- return action.getProperty("attribute");
+ return action.getProperty("attribute"); //$NON-NLS-1$
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
String type = getType(object);
- type = type.replace('.', '/') + ".java";
+ type = type.replace('.', '/') + ".java"; //$NON-NLS-1$
- if(p == null || p.getProperty("property") == null) {
- String n = action.getProperty("property");
+ if(p == null || p.getProperty("property") == null) { //$NON-NLS-1$
+ String n = action.getProperty("property"); //$NON-NLS-1$
if(n != null) {
String v = object.getAttributeValue(n);
if(v != null) {
if(p == null) p = new Properties();
- p.put("property", v);
+ p.put("property", v); //$NON-NLS-1$
}
}
}
@@ -74,14 +74,14 @@
IJavaElement javaElement = javaProject.findElement(new Path(type));
if (javaElement == null) {
String message = "Cannot find java source.";
- if(p != null && XModelObjectConstants.TRUE.equals(p.getProperty("ignoreWarning"))) {
- p.setProperty("error", message);
+ if(p != null && XModelObjectConstants.TRUE.equals(p.getProperty("ignoreWarning"))) { //$NON-NLS-1$
+ p.setProperty("error", message); //$NON-NLS-1$
} else {
ServiceDialog d = model.getService();
d.showDialog(ModelMessages.WARNING, message, new String[]{"Close"}, null, ServiceDialog.WARNING);
}
} else {
- if(p != null && XModelObjectConstants.TRUE.equals(p.getProperty("onlySelectIfOpen"))) {
+ if(p != null && XModelObjectConstants.TRUE.equals(p.getProperty("onlySelectIfOpen"))) { //$NON-NLS-1$
IEditorInput ii = EditorUtility.getEditorInput(javaElement);
IWorkbenchPage page = getWorkbenchPage();
if(page == null) return;
@@ -99,7 +99,7 @@
private static IJavaElement getElement(IJavaElement javaElement, Properties p) {
if(p == null || !(javaElement instanceof IParent)) return null;
- String childName = p.getProperty("property");
+ String childName = p.getProperty("property"); //$NON-NLS-1$
if(childName == null) return null;
IJavaElement[] cs = null;
try {
@@ -111,7 +111,7 @@
if(cs[i] instanceof IType) {
IType t = (IType)cs[i];
if(childName.length() > 0) {
- String getter = "get" + childName.substring(0, 1).toUpperCase() + childName.substring(1);
+ String getter = "get" + childName.substring(0, 1).toUpperCase() + childName.substring(1); //$NON-NLS-1$
IMethod m = t.getMethod(getter, new String[0]);
if(m != null && m.exists()) return m;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -49,10 +49,10 @@
object.setModified(true);
return true;
} catch (IOException exc) {
- ModelPlugin.getPluginLog().logError("DefaultEntityLoader:save(" + object.getPresentationString() + "):" + exc.getMessage());
+ ModelPlugin.getPluginLog().logError("DefaultEntityLoader:save(" + object.getPresentationString() + "):" + exc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
return false;
} catch (XModelException e2) {
- ModelPlugin.getPluginLog().logError("DefaultEntityLoader:save(" + object.getPresentationString() + "):" + e2.getMessage());
+ ModelPlugin.getPluginLog().logError("DefaultEntityLoader:save(" + object.getPresentationString() + "):" + e2.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
/**
* V.K.
*/
- private String encoding = "8859_1";
+ private String encoding = "8859_1"; //$NON-NLS-1$
/**
* Creates an empty property list with no default values.
@@ -107,7 +107,7 @@
}
private String readStream(InputStream is) {
- StringBuffer sb = new StringBuffer("");
+ StringBuffer sb = new StringBuffer(""); //$NON-NLS-1$
try {
byte[] b = new byte[4096];
while(true) {
@@ -273,7 +273,7 @@
break;
default:
throw new IllegalArgumentException(
- "Malformed \\uxxxx encoding.");
+ "Malformed \\uxxxx encoding."); //$NON-NLS-1$
}
}
out[outLen++] = (char)value;
@@ -357,8 +357,8 @@
BufferedWriter awriter;
awriter = new BufferedWriter(new OutputStreamWriter(out, encoding));
if (comments != null)
- writeln(awriter, "#" + comments);
- writeln(awriter, "#" + new Date().toString());
+ writeln(awriter, "#" + comments); //$NON-NLS-1$
+ writeln(awriter, "#" + new Date().toString()); //$NON-NLS-1$
for (Enumeration e = keys(); e.hasMoreElements();) {
String key = (String)e.nextElement();
String val = (String)get(key);
@@ -368,7 +368,7 @@
* pass false to flag.
*/
val = saveConvert(val, false);
- writeln(awriter, key + "=" + val);
+ writeln(awriter, key + "=" + val); //$NON-NLS-1$
}
awriter.flush();
}
@@ -392,7 +392,7 @@
};
public static void main(String[] args) {
- String ps = "p1:v1 \\\n hh \\\n gg\n\np2=v2\\u0034\\u0055";
+ String ps = "p1:v1 \\\n hh \\\n gg\n\np2=v2\\u0034\\u0055"; //$NON-NLS-1$
EncodedProperties p = new EncodedProperties();
ByteArrayInputStream s = new ByteArrayInputStream(ps.getBytes());
try {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/FileRootLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/FileRootLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/FileRootLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -49,7 +49,7 @@
}
protected String fileName(XModelObject object) {
- return object.getModelEntity().getName().toLowerCase() + ".pex";
+ return object.getModelEntity().getName().toLowerCase() + ".pex"; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,19 +16,20 @@
public class MappedEntityRecognizer implements EntityRecognizer {
private Map<String,String> map = new HashMap<String,String>();
- public MappedEntityRecognizer() {
- map.put("bpf", "FileProcess");
- map.put("htm", "FileHTML");
- map.put("flow", "FileFlow");
- map.put("jspx", "FileJSP");
- map.put("jspf", "FileJSP");
- map.put("jsf", "FileHTML");
+ public MappedEntityRecognizer() {
+ map.put("bpf", "FileProcess"); //$NON-NLS-1$ //$NON-NLS-2$
+ map.put("htm", "FileHTML"); //$NON-NLS-1$ //$NON-NLS-2$
+ map.put("flow", "FileFlow"); //$NON-NLS-1$ //$NON-NLS-2$
+ map.put("jspx", "FileJSP"); //$NON-NLS-1$ //$NON-NLS-2$
+ map.put("jspf", "FileJSP"); //$NON-NLS-1$ //$NON-NLS-2$
+ map.put("jsf", "FileHTML"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ // NB i18n: there is code that depends on these entity names (in English)
public String getEntityName(String ext, String body) {
if(ext == null) return null;
String s = (String)map.get(ext.toLowerCase());
- return (s != null) ? s : "File" + ext.toUpperCase();
+ return (s != null) ? s : "File" + ext.toUpperCase(); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,7 +33,7 @@
public String getEntityName(String ext, String body) {
if(ext != null) ext = ext.toLowerCase();
EntityRecognizer[] list = recognizers.get(ext);
- if(list == null || list.length == 0) return "FileAny";
+ if(list == null || list.length == 0) return "FileAny"; //$NON-NLS-1$
for (int i = 0; i < list.length; i++) {
String n = list[i].getEntityName(ext, body);
if(n != null) return n;
@@ -42,7 +42,7 @@
}
private void load() {
- XMapping m = meta.getMapping("Recognizers");
+ XMapping m = meta.getMapping("Recognizers"); //$NON-NLS-1$
if(m == null) return;
HashMap<String,RL> ext_list = new HashMap<String,RL>();
HashMap<String,EntityRecognizer> cls_recw = new HashMap<String,EntityRecognizer>();
@@ -82,7 +82,7 @@
try {
return (EntityRecognizer)ModelFeatureFactory.getInstance().createFeatureInstance(clsname);
} catch (ClassCastException e) {
- ModelPlugin.getPluginLog().logError("Entity recognizer " + clsname + " must be instanceof EntityRecognizer", e);
+ ModelPlugin.getPluginLog().logError("Entity recognizer " + clsname + " must be instanceof EntityRecognizer", e); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,14 +14,10 @@
import java.io.IOException;
import java.util.*;
-import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.loaders.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.impl.*;
@@ -29,15 +25,15 @@
import org.jboss.tools.common.util.FileUtil;
public class PropertiesLoader implements XObjectLoader {
- static String INTERNAL_SEPARATOR = "@";
- String defaultLineSeparator = "\r\n";
+ static String INTERNAL_SEPARATOR = "@"; //$NON-NLS-1$
+ String defaultLineSeparator = "\r\n"; //$NON-NLS-1$
public PropertiesLoader() {}
public static String getEncoding(XModelObject object) {
if(!object.isActive()) {
- String encoding = object.get("_encoding_");
- return encoding != null && encoding.length() > 0 ? encoding : "8859_1";
+ String encoding = object.get("_encoding_"); //$NON-NLS-1$
+ return encoding != null && encoding.length() > 0 ? encoding : "8859_1"; //$NON-NLS-1$
}
IResource resource = (IResource)object.getAdapter(IResource.class);
if(!(resource instanceof IFile)) return null;
@@ -48,7 +44,7 @@
public void load(XModelObject object) {
String encoding = getEncoding(object);
- object.setAttributeValue("encoding", encoding);
+ object.setAttributeValue("encoding", encoding); //$NON-NLS-1$
String body = XModelObjectLoaderUtil.getTempBody(object);
EncodedProperties properties = new EncodedProperties();
properties.setEncoding(encoding);
@@ -66,25 +62,25 @@
//ignore
}
- StringTokenizer st = new StringTokenizer(body, "\n\r", true);
+ StringTokenizer st = new StringTokenizer(body, "\n\r", true); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
StringBuilder lineEnd = new StringBuilder();
int state = 0;
XModelObject c = null;
while(st.hasMoreTokens()) {
String s = st.nextToken();
- if(s.equals("\r")) {
+ if(s.equals("\r")) { //$NON-NLS-1$
if(state != 2) sb.append(s); else lineEnd.append(s);
continue;
}
- if(s.equals("\n")) {
+ if(s.equals("\n")) { //$NON-NLS-1$
if(state != 2) sb.append(s); else lineEnd.append(s);
if(state == 0) {
state = 1;
} else if(state == 2) {
state = 0;
- c.setAttributeValue("dirtyvalue", sb.toString());
- c.setAttributeValue("line-end", lineEnd.toString());
+ c.setAttributeValue("dirtyvalue", sb.toString()); //$NON-NLS-1$
+ c.setAttributeValue("line-end", lineEnd.toString()); //$NON-NLS-1$
sb.setLength(0);
lineEnd.setLength(0);
}
@@ -92,7 +88,7 @@
}
lineEnd.setLength(0);
if(state == 3) {
- if(!s.endsWith("\\")) {
+ if(!s.endsWith("\\")) { //$NON-NLS-1$
sb.append(s);
state = 2;
} else {
@@ -119,19 +115,19 @@
String value = properties.getProperty(visualName);
Properties p = new Properties();
p.setProperty(XModelObjectConstants.ATTR_NAME, visualName);
- p.setProperty("dirtyname", dirtyName);
- p.setProperty("value", value);
+ p.setProperty("dirtyname", dirtyName); //$NON-NLS-1$
+ p.setProperty("value", value); //$NON-NLS-1$
- p.setProperty("name-value-separator", i == s.length() ? " " : "" + s.charAt(i));
- p.setProperty("comments", comments);
- p.setProperty("separator", "#"); //obsolete
- p.setProperty("line-end", "");
+ p.setProperty("name-value-separator", i == s.length() ? " " : "" + s.charAt(i)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ p.setProperty("comments", comments); //$NON-NLS-1$
+ p.setProperty("separator", "#"); //obsolete //$NON-NLS-1$ //$NON-NLS-2$
+ p.setProperty("line-end", ""); //$NON-NLS-1$ //$NON-NLS-2$
- c = object.getModel().createModelObject("Property", p);
+ c = object.getModel().createModelObject("Property", p); //$NON-NLS-1$
object.addChild(c);
- String dirtyvalue = (i < s.length()) ? s.substring(i + 1) : "";
- if(s.endsWith("\\")) {
+ String dirtyvalue = (i < s.length()) ? s.substring(i + 1) : ""; //$NON-NLS-1$
+ if(s.endsWith("\\")) { //$NON-NLS-1$
state = 3;
sb.append(dirtyvalue.substring(0, dirtyvalue.length() - 1)).append(INTERNAL_SEPARATOR);
} else {
@@ -140,18 +136,18 @@
}
}
if(state == 1 && sb.length() > 0) {
- object.set("conclusion", sb.toString());
+ object.set("conclusion", sb.toString()); //$NON-NLS-1$
}
if(state == 2) {
- c.setAttributeValue("dirtyvalue", sb.toString());
- c.setAttributeValue("line-end", lineEnd.toString());
+ c.setAttributeValue("dirtyvalue", sb.toString()); //$NON-NLS-1$
+ c.setAttributeValue("line-end", lineEnd.toString()); //$NON-NLS-1$
}
}
public boolean update(XModelObject object) throws XModelException {
String encoding = getEncoding(object);
XModelObject c = object.copy(0);
- if(encoding != null) c.set("_encoding_", encoding);
+ if(encoding != null) c.set("_encoding_", encoding); //$NON-NLS-1$
XModelObjectLoaderUtil.setTempBody(c, XModelObjectLoaderUtil.getTempBody(object));
load(c);
////EnginesLoader.merge(object, c, false);
@@ -180,48 +176,48 @@
StringBuffer sb = new StringBuffer();
XModelObject[] cs = object.getChildren();
for (int i = 0; i < cs.length; i++) {
- String name_value_separator = cs[i].getAttributeValue("name-value-separator");
- if(name_value_separator == null || name_value_separator.length() != 1 || " \t=:".indexOf(name_value_separator) < 0) {
- name_value_separator = "=";
+ String name_value_separator = cs[i].getAttributeValue("name-value-separator"); //$NON-NLS-1$
+ if(name_value_separator == null || name_value_separator.length() != 1 || " \t=:".indexOf(name_value_separator) < 0) { //$NON-NLS-1$
+ name_value_separator = "="; //$NON-NLS-1$
}
- appendComments(sb, cs[i].get("COMMENTS"), cs[i].get("SEPARATOR"), lineSeparator);
- if(XModelObjectConstants.NO.equals(cs[i].get("ENABLED"))) sb.append('#');
- String dirtyname = cs[i].getAttributeValue("dirtyname");
+ appendComments(sb, cs[i].get("COMMENTS"), cs[i].get("SEPARATOR"), lineSeparator); //$NON-NLS-1$ //$NON-NLS-2$
+ if(XModelObjectConstants.NO.equals(cs[i].get("ENABLED"))) sb.append('#'); //$NON-NLS-1$
+ String dirtyname = cs[i].getAttributeValue("dirtyname"); //$NON-NLS-1$
String name = EncodedProperties.saveConvert(cs[i].get(XModelObjectConstants.XML_ATTR_NAME), true); // convertName(cs[i].get(XModelObjectConstants.XML_ATTR_NAME));
- String value = cs[i].get("VALUE");
- String dirtyvalue = cs[i].getAttributeValue("dirtyvalue");
+ String value = cs[i].get("VALUE"); //$NON-NLS-1$
+ String dirtyvalue = cs[i].getAttributeValue("dirtyvalue"); //$NON-NLS-1$
if(value == null || dirtyvalue == null || !value.equals(dirtyvalue.trim())) {
value = EncodedProperties.saveConvert(value, false); // convertValue(value);
}
String resolved = resolveValue(value, dirtyvalue);
//preserve one white space after separator
- if(dirtyvalue != null && dirtyvalue.startsWith(" ")
- && resolved != null && resolved.length() > 0 && !resolved.startsWith(" ")
- && !name_value_separator.endsWith(" ")) {
- resolved = " " + resolved;
+ if(dirtyvalue != null && dirtyvalue.startsWith(" ") //$NON-NLS-1$
+ && resolved != null && resolved.length() > 0 && !resolved.startsWith(" ") //$NON-NLS-1$
+ && !name_value_separator.endsWith(" ")) { //$NON-NLS-1$
+ resolved = " " + resolved; //$NON-NLS-1$
}
if(dirtyname != null && name.equals(dirtyname.trim())) name = dirtyname;
//preserve one white space before separator
- if(dirtyname != null && dirtyname.endsWith(" ")
- && name != null && name.length() > 0 && !name.endsWith(" ")
- && !name_value_separator.startsWith(" ")) {
- name = name + " ";
+ if(dirtyname != null && dirtyname.endsWith(" ") //$NON-NLS-1$
+ && name != null && name.length() > 0 && !name.endsWith(" ") //$NON-NLS-1$
+ && !name_value_separator.startsWith(" ")) { //$NON-NLS-1$
+ name = name + " "; //$NON-NLS-1$
}
sb.append(name);
- if(!" ".equals(name_value_separator) || resolved.length() > 0) {
+ if(!" ".equals(name_value_separator) || resolved.length() > 0) { //$NON-NLS-1$
sb.append(name_value_separator);
}
sb.append(resolved);
- String ls = cs[i].get("line-end");
+ String ls = cs[i].get("line-end"); //$NON-NLS-1$
if(ls.length() > 0) {
- if(ls.equals("\\r\\n")) ls = defaultLineSeparator;
+ if(ls.equals("\\r\\n")) ls = defaultLineSeparator; //$NON-NLS-1$
sb.append(ls);
} else if(i < cs.length - 1) {
ls = defaultLineSeparator;
sb.append(ls);
}
}
- String conclusion = object.get("conclusion");
+ String conclusion = object.get("conclusion"); //$NON-NLS-1$
if(conclusion != null) sb.append(conclusion);
return sb.toString();
}
@@ -233,17 +229,17 @@
StringTokenizer st = new StringTokenizer(dirtyvalue, INTERNAL_SEPARATOR, true);
StringBuffer cv = new StringBuffer();
StringBuffer dv = new StringBuffer();
- String rightWhites = "";
+ String rightWhites = ""; //$NON-NLS-1$
while(st.hasMoreTokens()) {
String t = st.nextToken();
if(t.equals(INTERNAL_SEPARATOR)) {
if(rightWhites.length() > 0) {
cv.append(rightWhites);
- rightWhites = "";
+ rightWhites = ""; //$NON-NLS-1$
}
- dv.append("\\");
+ dv.append("\\"); //$NON-NLS-1$
} else {
- if(t.startsWith("#")) cv.append("\\");
+ if(t.startsWith("#")) cv.append("\\"); //$NON-NLS-1$ //$NON-NLS-2$
String app = t.trim();
int off = t.indexOf(app);
rightWhites = t.substring(off + app.length());
@@ -304,12 +300,12 @@
((XModelImpl)o1.getModel()).fireStructureChanged(o1);
}
- String conclusion1 = o1.get("conclusion");
- if(conclusion1 == null) conclusion1 = "";
- String conclusion2 = o2.get("conclusion");
- if(conclusion2 == null) conclusion2 = "";
+ String conclusion1 = o1.get("conclusion"); //$NON-NLS-1$
+ if(conclusion1 == null) conclusion1 = ""; //$NON-NLS-1$
+ String conclusion2 = o2.get("conclusion"); //$NON-NLS-1$
+ if(conclusion2 == null) conclusion2 = ""; //$NON-NLS-1$
if(!conclusion1.equals(conclusion2)) {
- o1.set("conclusion", conclusion2);
+ o1.set("conclusion", conclusion2); //$NON-NLS-1$
mod = true;
}
if(ch || mod) o1.setModified(true);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.loaders.impl;
import java.io.*;
+import java.text.MessageFormat;
import org.w3c.dom.*;
@@ -57,9 +58,9 @@
//String namespace =
loadNamespace(element, object);
//// String postfix = (namespace == null) ? "" : ":" + namespace;
- String postfix = "";
+ String postfix = ""; //$NON-NLS-1$
element.setAttribute(XModelObjectConstants.XML_ATTR_NAME + postfix, object.getAttributeValue(XModelObjectConstants.ATTR_NAME));
- element.setAttribute("EXTENSION" + postfix, object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION));
+ element.setAttribute("EXTENSION" + postfix, object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION)); //$NON-NLS-1$
util.load(element, object);
String loadingError = util.getError();
@@ -67,13 +68,13 @@
setEncoding(object, body);
loadPublicId(object, doc);
- object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
((AbstractXMLFileImpl)object).setLoaderError(loadingError);
if(!((AbstractXMLFileImpl)object).isIncorrect() && loadingError != null) {
object.setAttributeValue(XModelObjectConstants.ATTR_NAME_IS_INCORRECT, XModelObjectConstants.YES);
- object.setAttributeValue("incorrectBody", body);
- object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ object.setAttributeValue("incorrectBody", body); //$NON-NLS-1$
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -84,15 +85,15 @@
XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
if(errors != null && errors.length > 0) {
object.setAttributeValue(XModelObjectConstants.ATTR_NAME_IS_INCORRECT, XModelObjectConstants.YES);
- object.set("correctBody", "");
- object.setAttributeValue("incorrectBody", body);
- object.set("actualBodyTimeStamp", "-1");
+ object.set("correctBody", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ object.setAttributeValue("incorrectBody", body); //$NON-NLS-1$
+ object.set("actualBodyTimeStamp", "-1"); //$NON-NLS-1$ //$NON-NLS-2$
// return;
} else {
object.setAttributeValue(XModelObjectConstants.ATTR_NAME_IS_INCORRECT, XModelObjectConstants.NO);
- object.set("correctBody", body);
- object.set("actualBodyTimeStamp", "0");
- object.setAttributeValue("incorrectBody", "");
+ object.set("correctBody", body); //$NON-NLS-1$
+ object.set("actualBodyTimeStamp", "0"); //$NON-NLS-1$ //$NON-NLS-2$
+ object.setAttributeValue("incorrectBody", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
return XMLUtil.getDocument(new StringReader(body));
}
@@ -103,28 +104,28 @@
if(rootName.indexOf(':') > 0) namespace = rootName.substring(0, rootName.indexOf(':'));
if(namespace != null) {
util.setNamespace(namespace);
- object.setAttributeValue("namespace", namespace);
+ object.setAttributeValue("namespace", namespace); //$NON-NLS-1$
} else {
util.setNamespace(null);
- object.setAttributeValue("namespace", "");
+ object.setAttributeValue("namespace", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
return namespace;
}
protected void loadPublicId(XModelObject object, Document doc) {
XModelEntity entity = object.getModelEntity();
- if(entity.getAttribute("publicId") != null) {
+ if(entity.getAttribute("publicId") != null) { //$NON-NLS-1$
NodeList nl = doc.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node n = nl.item(i);
if(n instanceof DocumentType) {
DocumentType dt = (DocumentType)n;
String s = dt.getSystemId();
- if(s == null) s = "";
- object.setAttributeValue("systemId", s);
+ if(s == null) s = ""; //$NON-NLS-1$
+ object.setAttributeValue("systemId", s); //$NON-NLS-1$
s = dt.getPublicId();
- if(s == null) s = "";
- object.setAttributeValue("publicId", s);
+ if(s == null) s = ""; //$NON-NLS-1$
+ object.setAttributeValue("publicId", s); //$NON-NLS-1$
}
}
}
@@ -132,7 +133,7 @@
protected void setEncoding(XModelObject object, String body) {
String encoding = XModelObjectLoaderUtil.getEncoding(body);
- if(encoding == null) encoding = "";
+ if(encoding == null) encoding = ""; //$NON-NLS-1$
object.setAttributeValue(XModelObjectConstants.ATTR_NAME_ENCODING, encoding);
}
@@ -157,7 +158,7 @@
public boolean save(XModelObject object) {
if (!object.isModified()) return true;
if(XModelObjectConstants.YES.equals(object.get(XModelObjectConstants.ATTR_NAME_IS_INCORRECT))) {
- XModelObjectLoaderUtil.setTempBody(object, object.get("incorrectBody"));
+ XModelObjectLoaderUtil.setTempBody(object, object.get("incorrectBody")); //$NON-NLS-1$
return true;
}
String main = object.get(XModelObjectConstants.ATTR_NAME_BODY);
@@ -167,19 +168,19 @@
}
public String serializeObject(XModelObject object) {
- String systemId = object.getAttributeValue("systemId");
- String publicId = object.getAttributeValue("publicId");
+ String systemId = object.getAttributeValue("systemId"); //$NON-NLS-1$
+ String publicId = object.getAttributeValue("publicId"); //$NON-NLS-1$
String rootName = getRootName(object);
Element element = createRootElement(rootName, publicId, systemId);
return serializeToElement(element, object);
}
protected String getRootName(XModelObject object) {
- String namespace = object.getAttributeValue("namespace");
+ String namespace = object.getAttributeValue("namespace"); //$NON-NLS-1$
String rootName = object.getModelEntity().getXMLSubPath();
if(namespace != null && namespace.length() > 0) {
util.setNamespace(namespace);
- rootName = namespace + ":" + rootName;
+ rootName = namespace + ":" + rootName; //$NON-NLS-1$
} else {
util.setNamespace(null);
}
@@ -200,7 +201,7 @@
util.saveFinalComment(element, object);
//// String postfix = (namespace == null) ? "" : ":" + namespace;
element.removeAttribute(XModelObjectConstants.XML_ATTR_NAME);
- element.removeAttribute("EXTENSION");
+ element.removeAttribute("EXTENSION"); //$NON-NLS-1$
return serialize(element, object);
} catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
@@ -211,7 +212,7 @@
}
protected String getDocName() {
- return "taglib";///TLD_DOC_QUALIFIEDNAME
+ return "taglib";///TLD_DOC_QUALIFIEDNAME //$NON-NLS-1$
}
/**
@@ -227,16 +228,19 @@
try {
XModelObjectLoaderUtil.serialize(element.getOwnerDocument(), sw, encoding);
} catch (UnsupportedEncodingException uee) {
- if("UTF-8".equals(encoding)) return null;
+ if("UTF-8".equals(encoding)) return null; //$NON-NLS-1$
ServiceDialog d = object.getModel().getService();
XEntityData data = XEntityDataImpl.create(new String[][]{
{object.getModelEntity().getName(), XModelObjectConstants.YES},
{XModelObjectConstants.ATTR_NAME_ENCODING, XModelObjectConstants.NO}
});
- data.setValue(XModelObjectConstants.ATTR_NAME_ENCODING, "UTF-8");
- String message = "Encoding " + encoding + " is not supported. Please enter correct value.";
+ data.setValue(XModelObjectConstants.ATTR_NAME_ENCODING, "UTF-8"); //$NON-NLS-1$
+ String message = MessageFormat
+ .format(
+ "Encoding {0} is not supported. Please enter correct value.",
+ encoding);
int q = d.showDialog("Error", message, new String[]{"OK"}, data, ServiceDialog.ERROR);
- encoding = (q != 0) ? "UTF-8" : data.getValue(XModelObjectConstants.ATTR_NAME_ENCODING);
+ encoding = (q != 0) ? "UTF-8" : data.getValue(XModelObjectConstants.ATTR_NAME_ENCODING); //$NON-NLS-1$
object.setAttributeValue(XModelObjectConstants.ATTR_NAME_ENCODING, encoding);
return serialize(element, object);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/ResourceMarkers.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/ResourceMarkers.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/ResourceMarkers.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -29,9 +29,9 @@
import org.jboss.tools.common.model.util.PositionHolder;
public class ResourceMarkers {
- public static String TEXT_PROBLEM = "org.jboss.tools.common.model.textproblemmarker";
- public static String CONSTRAINT_PROBLEM = "org.jboss.tools.common.model.web.ui.constraintsmarker";
- public static String JST_WEB_PROBLEM = "org.jboss.tools.jst.web.ui.strutsmarker";
+ public static String TEXT_PROBLEM = "org.jboss.tools.common.model.textproblemmarker"; //$NON-NLS-1$
+ public static String CONSTRAINT_PROBLEM = "org.jboss.tools.common.model.web.ui.constraintsmarker"; //$NON-NLS-1$
+ public static String JST_WEB_PROBLEM = "org.jboss.tools.jst.web.ui.strutsmarker"; //$NON-NLS-1$
private XModelObject object;
String type;
@@ -88,9 +88,9 @@
marker = r.createMarker(type);
marker.setAttribute(IMarker.MESSAGE, message);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
- marker.setAttribute("path", path);
+ marker.setAttribute("path", path); //$NON-NLS-1$
if(attr != null && attr.length() > 0) {
- marker.setAttribute("attribute", attr);
+ marker.setAttribute("attribute", attr); //$NON-NLS-1$
}
updateLocation(marker, location, getStart(i), getEnd(i));
}
@@ -119,9 +119,9 @@
for (int i = 0; i < ms.length; i++) {
try {
if(!message.equals(ms[i].getAttribute(IMarker.MESSAGE))) continue;
- if(attr != null && !attr.equals(ms[i].getAttribute("attribute"))) continue;
- if(!path.equals(ms[i].getAttribute("path"))) {
- ms[i].setAttribute("path", path);
+ if(attr != null && !attr.equals(ms[i].getAttribute("attribute"))) continue; //$NON-NLS-1$
+ if(!path.equals(ms[i].getAttribute("path"))) { //$NON-NLS-1$
+ ms[i].setAttribute("path", path); //$NON-NLS-1$
}
return ms[i];
} catch (CoreException e) {
@@ -200,7 +200,7 @@
if(m == null) return false;
String _type = m.getType();
if(_type == null) return true;
- if(_type.startsWith("org.jboss.tools.")) {
+ if(_type.startsWith("org.jboss.tools.")) { //$NON-NLS-1$
return _type.equals(type);
}
return m.isSubtypeOf(IMarker.TEXT) || m.isSubtypeOf(IMarker.PROBLEM);
@@ -242,14 +242,14 @@
try {
IMarker[] ms = r.findMarkers(ResourceMarkers.JST_WEB_PROBLEM, true, 1);
if(ms != null) for (int i = 0; i < ms.length; i++) {
- String path = ms[i].getAttribute("path", null);
+ String path = ms[i].getAttribute("path", null); //$NON-NLS-1$
if(path == null) continue;
XModelObject o = file.getModel().getByPath(path);
if(o == null) {
ms[i].delete();
continue;
}
- String attr = ms[i].getAttribute("attribute", null);
+ String attr = ms[i].getAttribute("attribute", null); //$NON-NLS-1$
PositionHolder h = PositionHolder.getPosition(o, attr);
h.update();
ResourceMarkers.updateLocation(ms[i], h.getLine(), h.getStart(), h.getEnd());
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -44,7 +44,7 @@
if(ResourcesPlugin.getWorkspace().isTreeLocked()) {
XJob.addRunnable(new XRunnable() {
public String getId() {
- return "XMarkerManager";
+ return "XMarkerManager"; //$NON-NLS-1$
}
public void run() {
reload();
@@ -74,11 +74,11 @@
XModelObject o = EclipseResourceUtil.getObjectByResource(r);
if(o == null) o = EclipseResourceUtil.createObjectForResource(r);
if(o == null) continue;
- String path = ms[i].getAttribute("path", null);
+ String path = ms[i].getAttribute("path", null); //$NON-NLS-1$
o = (path == null) ? o : o.getModel().getByPath(path);
if(o == null) continue;
es.add(o);
- String attr = ms[i].getAttribute("attribute", null);
+ String attr = ms[i].getAttribute("attribute", null); //$NON-NLS-1$
if(attr != null && attr.length() > 0) ((XModelObjectImpl)o).addErrorAttributeDirty(attr);
}
synchronized(objects) {
@@ -145,10 +145,10 @@
if(ms == null) return null;
for (int i = 0; i < ms.length; i++) {
XModelObject o = object;
- String path = ms[i].getAttribute("path", null);
+ String path = ms[i].getAttribute("path", null); //$NON-NLS-1$
o = (path == null) ? o : o.getModel().getByPath(path);
if(o == null) continue;
- String attr = ms[i].getAttribute("attribute", null);
+ String attr = ms[i].getAttribute("attribute", null); //$NON-NLS-1$
if(attr != null && attr.equals(attribute)) {
return ms[i].getAttribute(IMarker.MESSAGE, null);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,9 +21,9 @@
public class Preference {
private String option;
private String attributeName;
- public static final String OPTIONS_PATH = "%Options%";
- public static String EDITOR_PATH = "%Options%/Struts Studio/Editors";
- public static final Preference SHOW_NATURE_WARNING = new Preference(EDITOR_PATH, "natureWarning");
+ public static final String OPTIONS_PATH = "%Options%"; //$NON-NLS-1$
+ public static String EDITOR_PATH = "%Options%/Struts Studio/Editors"; //$NON-NLS-1$
+ public static final Preference SHOW_NATURE_WARNING = new Preference(EDITOR_PATH, "natureWarning"); //$NON-NLS-1$
protected Preference(String optionPath, String attributeName) {
option = optionPath;
@@ -34,16 +34,16 @@
XModelObject obj = PreferenceModelUtilities.getPreferenceModel().getByPath(option);
if(obj == null) {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo(option + " does not exist");
+ ModelPlugin.getPluginLog().logInfo(option + " does not exist"); //$NON-NLS-1$
}
- return "";
+ return ""; //$NON-NLS-1$
}
XAttribute attribute = obj.getModelEntity().getAttribute(attributeName);
if(attribute == null) {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo(attributeName + " in " + option + " does not exist");
+ ModelPlugin.getPluginLog().logInfo(attributeName + " in " + option + " does not exist"); //$NON-NLS-1$ //$NON-NLS-2$
}
- return "";
+ return ""; //$NON-NLS-1$
}
return obj.getAttributeValue(attributeName);
}
@@ -60,7 +60,7 @@
XModelObject obj = PreferenceModelUtilities.getPreferenceModel().getByPath(option);
if(obj == null) {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo(option + " does not exist");
+ ModelPlugin.getPluginLog().logInfo(option + " does not exist"); //$NON-NLS-1$
}
return;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public class PreferenceModelUtilities {
- static final String ENT_OPTION_ROOT = "OptionRoot";
+ static final String ENT_OPTION_ROOT = "OptionRoot"; //$NON-NLS-1$
private static class PreferenceModelHolder {
public static XModel preferenceModel;
@@ -34,7 +34,7 @@
}
private static ServiceDialog createServiceDialog() {
- return (ServiceDialog)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.wizards.one.ServiceDialogImpl");
+ return (ServiceDialog)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.wizards.one.ServiceDialogImpl"); //$NON-NLS-1$
}
}
@@ -52,7 +52,7 @@
public static void initPreferenceValue(XModel initialModel, Preference preference)
throws XModelException {
String value = preference.getValue();
- if (value == null || "".equals(value))
+ if (value == null || "".equals(value)) //$NON-NLS-1$
{
XModelObject object = initialModel.getByPath(preference.getModelPath());
if (object != null)
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -30,7 +30,7 @@
* @param attributeName
*/
public SwitchPreference(String attributeName) {
- super("", attributeName);
+ super("", attributeName); //$NON-NLS-1$
// TODO Auto-generated constructor stub
}
@@ -44,16 +44,16 @@
}
public String getValue() {
- if(switchPreference==null) throw new IllegalStateException("switchPreference cannot be null, call setSwitchPreferenceFirst.");
+ if(switchPreference==null) throw new IllegalStateException("switchPreference cannot be null, call setSwitchPreferenceFirst."); //$NON-NLS-1$
Preference preference = (Preference)preferencesMap.get(switchPreference.getValue());
- if(preference==null) throw new IllegalStateException("Preference in't added for switch value '" + switchPreference.getValue() + "'");
+ if(preference==null) throw new IllegalStateException("Preference in't added for switch value '" + switchPreference.getValue() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
return preference.getValue();
}
public void setValue(String value) throws XModelException {
- if(switchPreference==null) throw new IllegalStateException("switchPreference cannot be null, call setSwitchPreferenceFirst.");
+ if(switchPreference==null) throw new IllegalStateException("switchPreference cannot be null, call setSwitchPreferenceFirst."); //$NON-NLS-1$
Preference preference = (Preference)preferencesMap.get(switchPreference.getValue());
- if(preference==null) throw new IllegalStateException("Preference in't added for switch value '" + switchPreference.getValue() + "'");
+ if(preference==null) throw new IllegalStateException("Preference in't added for switch value '" + switchPreference.getValue() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
preference.setValue(value);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/HiddenPaletteTabsHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/HiddenPaletteTabsHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/HiddenPaletteTabsHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
import org.jboss.tools.common.meta.action.impl.*;
public class HiddenPaletteTabsHandler extends AbstractHandler {
- SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.views.palette.editor.HiddenPaletteTabsWizard");
+ SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.views.palette.editor.HiddenPaletteTabsWizard"); //$NON-NLS-1$
public HiddenPaletteTabsHandler() {}
@@ -29,16 +29,16 @@
public void executeHandler(XModelObject object, Properties p) throws XModelException {
if(!isEnabled(object)) return;
- wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.views.palette.editor.HiddenPaletteTabsWizard");
+ wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.views.palette.editor.HiddenPaletteTabsWizard"); //$NON-NLS-1$
Map<String,XModelObject> objects = new HashMap<String,XModelObject>();
List<String[]> dataList = new ArrayList<String[]>();
- collect(object, "", objects, dataList);
+ collect(object, "", objects, dataList); //$NON-NLS-1$
String[][] vs = dataList.toArray(new String[0][]);
if(p == null) p = new Properties();
- p.put("data", vs);
- p.setProperty("help", "SharablePalette_HiddenTabs");
- p.setProperty("expandingLevel", "1");
+ p.put("data", vs); //$NON-NLS-1$
+ p.setProperty("help", "SharablePalette_HiddenTabs"); //$NON-NLS-1$ //$NON-NLS-2$
+ p.setProperty("expandingLevel", "1"); //$NON-NLS-1$ //$NON-NLS-2$
wizard.setObject(p);
if(wizard.execute() != 0) return;
execute(object.getModel(), vs, objects);
@@ -48,36 +48,36 @@
XModelObject[] cs = object.getChildren();
for (int i = 0; i < cs.length; i++) {
String path = prefix + XModelObjectConstants.SEPARATOR + cs[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
- String hidden = cs[i].getAttributeValue("hidden");
+ String hidden = cs[i].getAttributeValue("hidden"); //$NON-NLS-1$
if(hidden == null) hidden = XModelObjectConstants.NO;
dataList.add(new String[]{path, hidden});
objects.put(path, cs[i]);
String kind = cs[i].getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE);
- if("group".equals(kind)) collect(cs[i], path, objects, dataList);
+ if("group".equals(kind)) collect(cs[i], path, objects, dataList); //$NON-NLS-1$
}
}
public void execute(XModel model, String[][] vs, Map objects) throws XModelException {
- fireTransactionEvent("transaction_begin");
+ fireTransactionEvent("transaction_begin"); //$NON-NLS-1$
try {
XUndoManager undo = model.getUndoManager();
undo.beginTransaction();
for (int i = 0; i < vs.length; i++) {
XModelObject o = (XModelObject)objects.get(vs[i][0]);
- if(o != null) o.getModel().changeObjectAttribute(o, "hidden", vs[i][1]);
+ if(o != null) o.getModel().changeObjectAttribute(o, "hidden", vs[i][1]); //$NON-NLS-1$
}
undo.commitTransaction();
model.saveOptions();
} finally {
- fireTransactionEvent("transaction_end");
+ fireTransactionEvent("transaction_end"); //$NON-NLS-1$
}
}
private void fireTransactionEvent(String kind) {
XModelImpl m = (XModelImpl)PreferenceModelUtilities.getPreferenceModel();
- m.fireStructureChanged(m.getByPath("%Palette%"), 2, kind);
+ m.fireStructureChanged(m.getByPath("%Palette%"), 2, kind); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PaletteAdopt.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PaletteAdopt.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PaletteAdopt.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,11 +21,11 @@
private static XAdoptManager[] managers = null;
protected String getExtensionPoint() {
- return "org.jboss.tools.common.model.paletteAdopt";
+ return "org.jboss.tools.common.model.paletteAdopt"; //$NON-NLS-1$
}
public XAdoptManager[] getManagers() {
- if(managers == null) managers = loadManagers("org.jboss.tools.common.model.paletteAdopt");
+ if(managers == null) managers = loadManagers("org.jboss.tools.common.model.paletteAdopt"); //$NON-NLS-1$
return managers;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PreferenceImportExport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PreferenceImportExport.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/PreferenceImportExport.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
import org.jboss.tools.common.util.FileUtil;
public class PreferenceImportExport implements Preferences.IPropertyChangeListener {
- static String MODEL_PREFERENCES = "model_preferences";
+ static String MODEL_PREFERENCES = "model_preferences"; //$NON-NLS-1$
static PreferenceImportExport instance;
public static PreferenceImportExport getInstance() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableContainerImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableContainerImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableContainerImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -52,7 +52,7 @@
String ov = super.getAttributeValue(attributeName);
if(ov != null && ov.equals(value)) return value;
String s = super.setAttributeValue(attributeName, value);
- if("scope".equals(attributeName) && !ov.equals(s)) {
+ if("scope".equals(attributeName) && !ov.equals(s)) { //$NON-NLS-1$
((XModelImpl)getModel()).fireStructureChanged(this);
}
return s;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableElementImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableElementImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableElementImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -21,8 +21,8 @@
private static final Map<String,String> singular = new HashMap<String,String>(3);
static {
- singular.put("scope", "scope");
- singular.put("sharing", "sharing");
+ singular.put("scope", "scope"); //$NON-NLS-1$ //$NON-NLS-2$
+ singular.put("sharing", "sharing"); //$NON-NLS-1$ //$NON-NLS-2$
}
static boolean isSingular(String property) {
@@ -35,7 +35,7 @@
protected XScope scope = project_;
private Map<String,SharableElement> children = new HashMap<String,SharableElement>();
private SharableComparator comparator = null;
- protected String name = "";
+ protected String name = ""; //$NON-NLS-1$
public SharableElementImpl() {
super();
@@ -157,20 +157,20 @@
////////////////// override ////////////////
public String get(String name) {
- if("scope".equals(name)) {
+ if("scope".equals(name)) { //$NON-NLS-1$
return getScope();
- } else if("sharing".equals(name)) {
- String x = (general_.exists() ? GENERAL + "," : "")
- + (project_.exists() ? PROJECT + "," : "");
+ } else if("sharing".equals(name)) { //$NON-NLS-1$
+ String x = (general_.exists() ? GENERAL + "," : "") //$NON-NLS-1$ //$NON-NLS-2$
+ + (project_.exists() ? PROJECT + "," : ""); //$NON-NLS-1$ //$NON-NLS-2$
int c = x.length() - 1;
- return (c < 0) ? "" : x.substring(0, c);
+ return (c < 0) ? "" : x.substring(0, c); //$NON-NLS-1$
}
return (XModelObjectConstants.XML_ATTR_NAME.equals(name)) ? name()
: scope.getProperty(name);
}
public void set(String name, String value) {
- if("scope".equals(name)) {
+ if("scope".equals(name)) { //$NON-NLS-1$
String ov = get(name);
if(ov.equals(value)) return;
String max = XStudioLoaderPeer.getMaxScope(ov, value);
@@ -178,7 +178,7 @@
setScope0(value);
if(!scope.exists())
setScopeExists(scope.getName(), true);
- } else if("sharing".equals(name)) {
+ } else if("sharing".equals(name)) { //$NON-NLS-1$
setScopeExists(GENERAL, value.indexOf(GENERAL) >= 0);
setScopeExists(PROJECT, value.indexOf(PROJECT) >= 0);
} else if(XModelObjectConstants.XML_ATTR_NAME.equals(name)) {
@@ -206,7 +206,7 @@
}
protected String getEntityName() {
- return "SharableDefault";
+ return "SharableDefault"; //$NON-NLS-1$
}
public String name() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -45,7 +45,7 @@
String xml = an[i].getXMLName();
if(xml == null || xml.trim().length() == 0) continue;
String v = loader.getAttribute(element, xml);
- if(v != null && "Note2".equals(an[i].getEditor().getName())) {
+ if(v != null && "Note2".equals(an[i].getEditor().getName())) { //$NON-NLS-1$
v = XModelObjectLoaderUtil.loadFromXMLAttribute(v);
}
if(v != null) sharable.setAttributeValue(an[i].getName(), v);
@@ -92,7 +92,7 @@
if(!sharable.scopeExists(scopename)) return;
XModelEntity entity = sharable.getModelEntity();
String en = entity.getName();
- if(en.startsWith("Sharable")) en = en.substring(8);
+ if(en.startsWith("Sharable")) en = en.substring(8); //$NON-NLS-1$
Element element = parent.getOwnerDocument().createElement(en);
parent.appendChild(element);
saveAttributes(element, sharable, scopename);
@@ -109,7 +109,7 @@
String xml = as[i].getXMLName();
if(xml == null || xml.trim().length() == 0) continue;
String v = sharable.getAttributeValue(as[i].getName(), scopename);
- if(v != null && "Note2".equals(as[i].getEditor().getName())) {
+ if(v != null && "Note2".equals(as[i].getEditor().getName())) { //$NON-NLS-1$
v = XModelObjectLoaderUtil.saveToXMLAttribute(v);
}
loader.saveAttribute(element, xml, v);
@@ -144,7 +144,7 @@
if(children[i].isRequired()) {
SharableElement c = (SharableElement)sharable.getModel().createModelObject(children[i].getName(), new Properties());
if(c == null) {
- ModelPlugin.getPluginLog().logInfo("Could not create sharable folder " + children[i].getName());
+ ModelPlugin.getPluginLog().logInfo("Could not create sharable folder " + children[i].getName()); //$NON-NLS-1$
continue;
}
c.setScope(PROJECT);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,6 +15,7 @@
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
+import java.text.MessageFormat;
import org.w3c.dom.*;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.model.*;
@@ -82,7 +83,7 @@
private void saveProject() {
File[] fs = peer.getFilesForScope(PROJECT);
- boolean isPaletteModified = studio.getChildByPath("Palette").isModified() || studio.getChildByPath("Icons").isModified();
+ boolean isPaletteModified = studio.getChildByPath("Palette").isModified() || studio.getChildByPath("Icons").isModified(); //$NON-NLS-1$ //$NON-NLS-2$
boolean isPreferencesModified = studio.getChildByPath(OPTIONS).isModified();
if(!fs[0].exists() || isPaletteModified) savePalette(fs[0]);
if(!fs[1].exists() || isPreferencesModified) savePreferences(fs[1]);
@@ -91,8 +92,8 @@
private void savePalette(File f) {
if(handleReadOnly(studio, PROJECT, f) != 0) return;
save(studio, PROJECT, f, new String[]{"Palette", "XStudioIcons"});
- studio.getChildByPath("Palette").setModified(false);
- studio.getChildByPath("Icons").setModified(false);
+ studio.getChildByPath("Palette").setModified(false); //$NON-NLS-1$
+ studio.getChildByPath("Icons").setModified(false); //$NON-NLS-1$
}
private void savePreferences(File f) {
@@ -106,10 +107,10 @@
try {
if(!f.exists()) f.createNewFile();
} catch (IOException e1) {
- ModelPlugin.getPluginLog().logError("XStudioDataLoaderImpl:save:Cannot create file:" + e1.getMessage());
+ ModelPlugin.getPluginLog().logError("XStudioDataLoaderImpl:save:Cannot create file:" + e1.getMessage()); //$NON-NLS-1$
return;
}
- Element e = XMLUtil.createDocumentElement("dummyroot");
+ Element e = XMLUtil.createDocumentElement("dummyroot"); //$NON-NLS-1$
new SharableLoaderImpl().saveSharable(e, q, scopename);
NodeList x = e.getElementsByTagName(XSTUDIO);
if(x == null || x.getLength() == 0) return;
@@ -149,14 +150,16 @@
}
private String getReadOnlyMessage(File f) {
- return "File " + f.getAbsolutePath() + " is read-only.\n" +
- "Please make it writable to allow for saving options.";
+ return MessageFormat
+ .format(
+ "File {0} is read-only.\nPlease make it writable to allow for saving options.",
+ f.getAbsolutePath());
}
private InputStream readGeneral() {
try {
Bundle b = Platform.getBundle(ModelPlugin.PLUGIN_ID);
- URL u = b.getResource("meta/options_general.xml");
+ URL u = b.getResource("meta/options_general.xml"); //$NON-NLS-1$
URLConnection c = u.openConnection();
return c.getInputStream();
} catch (IOException e) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -37,7 +37,7 @@
import org.osgi.framework.BundleContext;
public class ModelPlugin extends BaseUIPlugin implements IModelPlugin, IWindowListener {
- public static final String PLUGIN_ID = "org.jboss.tools.common.model";
+ public static final String PLUGIN_ID = "org.jboss.tools.common.model"; //$NON-NLS-1$
private static ModelPlugin plugin;
private ResourceBundle resourceBundle;
private XModelSaveParticipant save = new XModelSaveParticipant();
@@ -96,15 +96,15 @@
private void cleanTempFiles() {
try {
- File f = File.createTempFile("efs_", ".x");
+ File f = File.createTempFile("efs_", ".x"); //$NON-NLS-1$ //$NON-NLS-2$
f = f.getParentFile();
File[] fs = f.listFiles();
if(fs != null) for (int i = 0; i < fs.length; i++) {
String n = fs[i].getName();
- if(n.startsWith("efs_")) fs[i].delete();
+ if(n.startsWith("efs_")) fs[i].delete(); //$NON-NLS-1$
}
} catch (IOException e) {
- getPluginLog().logError("ModelPlugin:cleanTempFiles:" + e.getMessage());
+ getPluginLog().logError("ModelPlugin:cleanTempFiles:" + e.getMessage()); //$NON-NLS-1$
}
}
@@ -138,7 +138,7 @@
byte[] bom= (byte[]) description.getProperty(IContentDescription.BYTE_ORDER_MARK);
if (bom != null) {
if (bom != IContentDescription.BOM_UTF_8)
- throw new CoreException(new Status(IStatus.ERROR, ModelPlugin.PLUGIN_ID, IStatus.OK,"wrongByteOrderMark", null));
+ throw new CoreException(new Status(IStatus.ERROR, ModelPlugin.PLUGIN_ID, IStatus.OK,"wrongByteOrderMark", null)); //$NON-NLS-1$
return true;
}
}
@@ -153,7 +153,7 @@
if (skipUTF8BOM) {
for (int i= 0; i < 3; i++)
if (contentStream.read() == -1) {
- throw new IOException("notEnoughBytesForBOM");
+ throw new IOException("notEnoughBytesForBOM"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -37,9 +37,9 @@
public void setModel(XModel model) {
String entity = model.getRoot().getModelEntity().getName();
- if("RootDummy".equals(entity)) {
- String pn = (project == null) ? "?" : project.getName();
- throw new IllegalArgumentException("Struts Project " + pn + " is corrupted.");
+ if("RootDummy".equals(entity)) { //$NON-NLS-1$
+ String pn = (project == null) ? "?" : project.getName(); //$NON-NLS-1$
+ throw new IllegalArgumentException("Struts Project " + pn + " is corrupted."); //$NON-NLS-1$ //$NON-NLS-2$
}
this.model = model;
}
@@ -116,22 +116,22 @@
}
private void createSrcFolders() {
- XModelObject web = model.getByPath("Web");
+ XModelObject web = model.getByPath("Web"); //$NON-NLS-1$
if(web == null) return;
- XModelObject[] children = model.getByPath("Web").getChildren();
+ XModelObject[] children = model.getByPath("Web").getChildren(); //$NON-NLS-1$
List<String> srcPaths = new ArrayList<String>();
Set<String> set = new HashSet<String>();
for (int i = 0; i < children.length; i++) {
- String objectPaths = children[i].getAttributeValue("src file system"/*WebModuleConstants.ATTR_SRC_FS*/);
+ String objectPaths = children[i].getAttributeValue("src file system"/*WebModuleConstants.ATTR_SRC_FS*/); //$NON-NLS-1$
if(objectPaths == null || objectPaths.length() == 0) continue;
- StringTokenizer st = new StringTokenizer(objectPaths, ",;");
+ StringTokenizer st = new StringTokenizer(objectPaths, ",;"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String objectPath = st.nextToken().trim();
if(objectPath.length() == 0) continue;
- XModelObject srcObject = model.getByPath("FileSystems/" + objectPath);
+ XModelObject srcObject = model.getByPath("FileSystems/" + objectPath); //$NON-NLS-1$
if (srcObject == null) continue;
String osPath = XModelObjectUtil.getExpandedValue(srcObject, XModelObjectConstants.ATTR_NAME_LOCATION, null);
- if (osPath != null && !"".equals(osPath) && !set.contains(osPath)) {
+ if (osPath != null && !"".equals(osPath) && !set.contains(osPath)) { //$NON-NLS-1$
srcPaths.add(osPath);
set.add(osPath);
}
@@ -150,8 +150,8 @@
}
private void createOutputFolder() {
- XModelObject classesObject = model.getByPath("FileSystems/classes");
- String classesPath = "";
+ XModelObject classesObject = model.getByPath("FileSystems/classes"); //$NON-NLS-1$
+ String classesPath = ""; //$NON-NLS-1$
if (classesObject != null)
classesPath = XModelObjectUtil.getExpandedValue(classesObject, XModelObjectConstants.ATTR_NAME_LOCATION, null);
else if(classes != null)
@@ -190,12 +190,12 @@
private void addLibJars() {
XModelObject fss = FileSystemsHelper.getFileSystems(model);
- XModelObject[] children = fss == null ? new XModelObject[0] : fss.getChildren("FileSystemJar");
+ XModelObject[] children = fss == null ? new XModelObject[0] : fss.getChildren("FileSystemJar"); //$NON-NLS-1$
List<String> srcPaths = new ArrayList<String>();
for (int i = 0; i < children.length; i++) {
if(XModelObjectConstants.TRUE.equals(children[i].get(FileSystemsLoader.IS_ADDED_TO_CLASSPATH))) continue;
String osPath = XModelObjectUtil.getExpandedValue(children[i], XModelObjectConstants.ATTR_NAME_LOCATION, null);
- if (osPath != null && !"".equals(osPath) && new File(osPath).isFile()) srcPaths.add(osPath);
+ if (osPath != null && !"".equals(osPath) && new File(osPath).isFile()) srcPaths.add(osPath); //$NON-NLS-1$
children[i].set(FileSystemsLoader.IS_ADDED_TO_CLASSPATH, XModelObjectConstants.TRUE);
}
@@ -213,7 +213,7 @@
addServletSupport();
}
- static SpecialWizard addServletSupportWizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.jst.web.project.AddServletSupportWizard");
+ static SpecialWizard addServletSupportWizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.jst.web.project.AddServletSupportWizard"); //$NON-NLS-1$
private void addServletSupport() {
// if(addServletSupportWizard == null) return;
// addServletSupportWizard.setObject(this);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdateWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdateWizard.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdateWizard.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,11 +25,11 @@
public void setObject(Object object) {
u = new ClassPathUpdate();
Properties p = (Properties)object;
- XModel model = (XModel)p.get("model");
+ XModel model = (XModel)p.get("model"); //$NON-NLS-1$
u.setProject((IProject)model.getProperties().get(XModelObjectConstants.PROJECT));
u.setModel(model);
- u.setReplacedSrc((Map)p.get("replacedSrc"));
- IPath classes = (IPath)p.get("classes");
+ u.setReplacedSrc((Map)p.get("replacedSrc")); //$NON-NLS-1$
+ IPath classes = (IPath)p.get("classes"); //$NON-NLS-1$
if(classes != null) u.setClasses(classes);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IModelNature.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IModelNature.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IModelNature.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -13,12 +13,12 @@
import org.jboss.tools.common.model.XModel;
public interface IModelNature {
- static String PROJECT_FILE_NANE = "org.jboss.tools.jst.web.xml";
- static String PROJECT_FILE = ".settings/" + PROJECT_FILE_NANE;
- static String PROJECT_TEMP = "org.jboss.tools.common.model.temp";
+ static String PROJECT_FILE_NANE = "org.jboss.tools.jst.web.xml"; //$NON-NLS-1$
+ static String PROJECT_FILE = ".settings/" + PROJECT_FILE_NANE; //$NON-NLS-1$
+ static String PROJECT_TEMP = "org.jboss.tools.common.model.temp"; //$NON-NLS-1$
- static String ECLIPSE_PROJECT = "eclipse.project";
- static String ECLIPSE_PROJECT_OLD = "exadel.eclipse.project";
+ static String ECLIPSE_PROJECT = "eclipse.project"; //$NON-NLS-1$
+ static String ECLIPSE_PROJECT_OLD = "exadel.eclipse.project"; //$NON-NLS-1$
XModel getModel();
String getID();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IPromptingProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IPromptingProvider.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/IPromptingProvider.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,20 +15,20 @@
import org.jboss.tools.common.model.XModelObjectConstants;
public interface IPromptingProvider {
- static String ERROR = "error";
+ static String ERROR = "error"; //$NON-NLS-1$
static List<Object> EMPTY_LIST = Collections.unmodifiableList(new ArrayList<Object>());
- static String PROPERTY_TYPE = "propertyType";
- static String FILE = "file";
- static String KEY = "key";
- static String MODULE = "module";
- static String ACTION = "action";
- static String TYPE = "type";
- static String PROPERTY = "property";
- static String MODEL_OBJECT_PATH = "model-path";
+ static String PROPERTY_TYPE = "propertyType"; //$NON-NLS-1$
+ static String FILE = "file"; //$NON-NLS-1$
+ static String KEY = "key"; //$NON-NLS-1$
+ static String MODULE = "module"; //$NON-NLS-1$
+ static String ACTION = "action"; //$NON-NLS-1$
+ static String TYPE = "type"; //$NON-NLS-1$
+ static String PROPERTY = "property"; //$NON-NLS-1$
+ static String MODEL_OBJECT_PATH = "model-path"; //$NON-NLS-1$
static String NAME = XModelObjectConstants.ATTR_NAME;
- static String ATTRIBUTE = "attribute";
- static String LOCALE = "locale";
+ static String ATTRIBUTE = "attribute"; //$NON-NLS-1$
+ static String LOCALE = "locale"; //$NON-NLS-1$
public boolean isSupporting(String id);
public List getList(XModel model, String id, String prefix, Properties properties);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public abstract class ModelNature extends PlatformObject implements IProjectNature, IModelNature {
- public static final String NATURE_ID = ModelPlugin.PLUGIN_ID + ".modelnature";
+ public static final String NATURE_ID = ModelPlugin.PLUGIN_ID + ".modelnature"; //$NON-NLS-1$
static Map<IProject,XModel> models = new HashMap<IProject,XModel>();
static IResourceChangeListener listener = null;
protected String workspaceHome = null;
@@ -95,24 +95,24 @@
if(result) {
p.put(XModelConstants.AUTOLOAD, auto);
} else {
- p.setProperty(XModelConstants.WORKSPACE, "");
- p.setProperty(XModelConstants.WORKSPACE_OLD, "");
+ p.setProperty(XModelConstants.WORKSPACE, ""); //$NON-NLS-1$
+ p.setProperty(XModelConstants.WORKSPACE_OLD, ""); //$NON-NLS-1$
}
}
p.setProperty(ECLIPSE_PROJECT, project.getLocation().toString());
p.setProperty(ECLIPSE_PROJECT_OLD, project.getLocation().toString());
p.put(XModelObjectConstants.PROJECT, project);
- p.setProperty("nature", getID());
+ p.setProperty("nature", getID()); //$NON-NLS-1$
model = (XModel)models.get(project);
if(model != null) {
home = p.getProperty(XModelConstants.WORKSPACE);
String h = XModelConstants.getWorkspace(model);
if(home == null || !home.equals(h)) {
- ModelPlugin.getPluginLog().logInfo("WARNING:" + " workspace home changed from " + h + " to " + home);
+ ModelPlugin.getPluginLog().logInfo("WARNING:" + " workspace home changed from " + h + " to " + home); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
model.getProperties().setProperty(XModelConstants.WORKSPACE, home);
model.getProperties().setProperty(XModelConstants.WORKSPACE_OLD, home);
- model.getProperties().setProperty("nature", getID());
+ model.getProperties().setProperty("nature", getID()); //$NON-NLS-1$
model.load();
}
return;
@@ -151,8 +151,8 @@
}
}
- static String EXTERNAL_TOOL_BUILDER = "org.eclipse.ui.externaltools.ExternalToolBuilder";
- static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle";
+ static String EXTERNAL_TOOL_BUILDER = "org.eclipse.ui.externaltools.ExternalToolBuilder"; //$NON-NLS-1$
+ static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
protected void removeFromBuildSpec(String builderID) throws CoreException {
IProjectDescription description = getProject().getDescription();
@@ -183,9 +183,9 @@
private ServiceDialog createServiceDialog() {
try {
- return (ServiceDialog)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.wizards.one.ServiceDialogImpl");
+ return (ServiceDialog)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.wizards.one.ServiceDialogImpl"); //$NON-NLS-1$
} catch (ClassCastException e) {
- ModelPlugin.getPluginLog().logError("Cannot create service dialog.");
+ ModelPlugin.getPluginLog().logError("Cannot create service dialog."); //$NON-NLS-1$
}
return null;
}
@@ -202,10 +202,10 @@
if(project == null || !project.isOpen()) return false;
String nature = null;
try {
- if(project.hasNature("org.jboss.tools.jsf.jsfnature")) {
- nature = "org.jboss.tools.jsf.jsfnature";
- } else if(project.hasNature("org.jboss.tools.struts.strutsnature")) {
- nature = "org.jboss.tools.struts.strutsnature";
+ if(project.hasNature("org.jboss.tools.jsf.jsfnature")) { //$NON-NLS-1$
+ nature = "org.jboss.tools.jsf.jsfnature"; //$NON-NLS-1$
+ } else if(project.hasNature("org.jboss.tools.struts.strutsnature")) { //$NON-NLS-1$
+ nature = "org.jboss.tools.struts.strutsnature"; //$NON-NLS-1$
}
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -39,7 +39,7 @@
return getLocation(location);
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
- return "";
+ return ""; //$NON-NLS-1$
}
}
@@ -53,24 +53,24 @@
return getLocationFrom_strutsstudio_File(location, ep);
}
if(f.isFile()) return getLocationFrom_struts_File(location, f);
- return "";
+ return ""; //$NON-NLS-1$
}
private String getLocationFrom_strutsstudio_File(String location, File ss) {
Element element = XMLUtil.getElement(ss);
- String path = "";
- if(element.hasAttribute("workspace-home")) {
- path = element.getAttribute("workspace-home");
- } else if(element.hasAttribute("WORKSPACE_HOME")) {
- path = element.getAttribute("WORKSPACE_HOME");
+ String path = ""; //$NON-NLS-1$
+ if(element.hasAttribute("workspace-home")) { //$NON-NLS-1$
+ path = element.getAttribute("workspace-home"); //$NON-NLS-1$
+ } else if(element.hasAttribute("WORKSPACE_HOME")) { //$NON-NLS-1$
+ path = element.getAttribute("WORKSPACE_HOME"); //$NON-NLS-1$
}
- String q = (path.equals(".")) ? location : (path.startsWith("./")) ? location + path.substring(1) : path;
+ String q = (path.equals(".")) ? location : (path.startsWith("./")) ? location + path.substring(1) : path; //$NON-NLS-1$ //$NON-NLS-2$
return q;
}
private String getLocationFrom_struts_File(String location, File s) {
String path = XModelObjectLoaderUtil.getCDATA(XMLUtil.getElement(s));
- String q = (path.equals(".")) ? location : (path.startsWith("./")) ? location + path.substring(1) : path;
+ String q = (path.equals(".")) ? location : (path.startsWith("./")) ? location + path.substring(1) : path; //$NON-NLS-1$ //$NON-NLS-2$
s.delete();
return q;
}
@@ -97,7 +97,7 @@
//Taken from J2EEUtils and modified
public static IPath getWebInfPath(IProject project) {
IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF"));
+ IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF")); //$NON-NLS-1$
IPath modulePath = webInfDir.getWorkspaceRelativePath();
return (!webInfDir.exists()) ? null : modulePath;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/PromptingProviderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/PromptingProviderFactory.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/PromptingProviderFactory.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public static IPromptingProvider WEB;
static {
try {
- WEB = (IPromptingProvider)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.project.list.WebPromptingProvider");
+ WEB = (IPromptingProvider)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.project.list.WebPromptingProvider"); //$NON-NLS-1$
} catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,16 +22,16 @@
public class Watcher implements XModelTreeListener {
static String[][] CONTRIBUTORS = new String[][]{
- {"org.jboss.tools.struts.webprj.model.helpers.sync.SyncProjectContext", "org.jboss.tools.struts.strutsnature"},
- {"org.jboss.tools.jsf.web.JSFWatcherContributor", "org.jboss.tools.jsf.jsfnature"}
+ {"org.jboss.tools.struts.webprj.model.helpers.sync.SyncProjectContext", "org.jboss.tools.struts.strutsnature"}, //$NON-NLS-1$ //$NON-NLS-2$
+ {"org.jboss.tools.jsf.web.JSFWatcherContributor", "org.jboss.tools.jsf.jsfnature"} //$NON-NLS-1$ //$NON-NLS-2$
};
public static Watcher getInstance(XModel model) {
- Watcher instance = (Watcher)model.getManager("Watcher");
+ Watcher instance = (Watcher)model.getManager("Watcher"); //$NON-NLS-1$
if(instance == null) {
instance = new Watcher();
instance.setModel(model);
- model.addManager("Watcher", instance);
+ model.addManager("Watcher", instance); //$NON-NLS-1$
model.addModelTreeListener(instance);
}
return instance;
@@ -42,7 +42,7 @@
private boolean lock = false;
class WatcherRunnable implements XJob.XRunnable {
- String id = "Watcher - " + XModelConstants.getWorkspace(model);
+ String id = "Watcher - " + XModelConstants.getWorkspace(model); //$NON-NLS-1$
public String getId() {
return id;
@@ -71,7 +71,7 @@
c.init(model);
contributors.put(nature, c);
} else if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!");
+ ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!"); //$NON-NLS-1$
}
}
} else {
@@ -127,7 +127,7 @@
event.getModelObject() == model.getRoot()) {
model.removeModelTreeListener(this);
/// stopped = true;
- model.removeManager("Watcher");
+ model.removeManager("Watcher"); //$NON-NLS-1$
return;
}
forceUpdate();
@@ -138,7 +138,7 @@
}
- String error = "initial";
+ String error = "initial"; //$NON-NLS-1$
ResourceMarkers markers = null;
class RM extends ResourceMarkers {
@@ -166,10 +166,10 @@
private void setCorrect(boolean correct) {
XModelObject fs = FileSystemsHelper.getFileSystems(model);
if(fs == null) return;
- boolean b = !XModelObjectConstants.YES.equals(fs.get("_hasErrors_"));
+ boolean b = !XModelObjectConstants.YES.equals(fs.get("_hasErrors_")); //$NON-NLS-1$
if(b == correct) return;
- fs.set("_hasErrors_", (correct) ? "" : XModelObjectConstants.YES);
- fs.fireObjectChanged("_hasErrors_");
+ fs.set("_hasErrors_", (correct) ? "" : XModelObjectConstants.YES); //$NON-NLS-1$ //$NON-NLS-2$
+ fs.fireObjectChanged("_hasErrors_"); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/WatcherLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/WatcherLoader.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/WatcherLoader.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
import org.jboss.tools.common.model.*;
public class WatcherLoader implements XObjectLoader {
- public static QualifiedName LOCK = new QualifiedName("", "lock-model");
+ public static QualifiedName LOCK = new QualifiedName("", "lock-model"); //$NON-NLS-1$ //$NON-NLS-2$
public void load(XModelObject object) {
if(EclipseResourceUtil.isProjectFragment(object.getModel())) return;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -105,13 +105,13 @@
public Element toXML(Element parent, Properties context) {
Element element = XMLUtilities.createElement(parent, XMLStoreConstants.TAG_VALUE_INFO);
if(value != null) element.setAttribute(XMLStoreConstants.ATTR_VALUE, value);
- if(valueStartPosition != 0) element.setAttribute(ATTR_START, "" + valueStartPosition);
- if(valueLength != 0) element.setAttribute(ATTR_LENGTH, "" + valueLength);
+ if(valueStartPosition != 0) element.setAttribute(ATTR_START, "" + valueStartPosition); //$NON-NLS-1$
+ if(valueLength != 0) element.setAttribute(ATTR_LENGTH, "" + valueLength); //$NON-NLS-1$
return element;
}
- static String ATTR_START = "start";
- static String ATTR_LENGTH = "length";
+ static String ATTR_START = "start"; //$NON-NLS-1$
+ static String ATTR_LENGTH = "length"; //$NON-NLS-1$
public void loadXML(Element element, Properties context) {
value = element.getAttribute(XMLStoreConstants.ATTR_VALUE);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -16,26 +16,26 @@
* @author Viacheslav Kabanovich
*/
public interface XMLStoreConstants {
- public String TAG_VALUE_INFO = "value-info";
- public String TAG_ID = "id";
- public String TAG_ENTRY = "entry";
+ public String TAG_VALUE_INFO = "value-info"; //$NON-NLS-1$
+ public String TAG_ID = "id"; //$NON-NLS-1$
+ public String TAG_ENTRY = "entry"; //$NON-NLS-1$
- public String CLS_XML = "xml";
- public String CLS_MODEL_OBJECT = "model-object";
- public String CLS_FIELD = "field";
- public String CLS_STRING = "string";
- public String CLS_TYPE = "type";
- public String CLS_METHOD = "method";
+ public String CLS_XML = "xml"; //$NON-NLS-1$
+ public String CLS_MODEL_OBJECT = "model-object"; //$NON-NLS-1$
+ public String CLS_FIELD = "field"; //$NON-NLS-1$
+ public String CLS_STRING = "string"; //$NON-NLS-1$
+ public String CLS_TYPE = "type"; //$NON-NLS-1$
+ public String CLS_METHOD = "method"; //$NON-NLS-1$
- public String ATTR_VALUE = "value";
- public String ATTR_PATH = "path";
- public String ATTR_CLASS = "class";
+ public String ATTR_VALUE = "value"; //$NON-NLS-1$
+ public String ATTR_PATH = "path"; //$NON-NLS-1$
+ public String ATTR_CLASS = "class"; //$NON-NLS-1$
public String ATTR_NAME = XModelObjectConstants.ATTR_NAME;
- public String ATTR_PROJECT = "project";
- public String ATTR_TYPE = "type";
- public String ATTR_PARAMS = "params";
+ public String ATTR_PROJECT = "project"; //$NON-NLS-1$
+ public String ATTR_TYPE = "type"; //$NON-NLS-1$
+ public String ATTR_PARAMS = "params"; //$NON-NLS-1$
- public String KEY_MODEL_OBJECT = "model-object";
+ public String KEY_MODEL_OBJECT = "model-object"; //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/ModelRenameProcessor.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.refactoring;
+import java.text.MessageFormat;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.internal.corext.refactoring.tagging.*;
@@ -51,7 +52,7 @@
}
public String getProcessorName() {
- String message = "Rename " + getCurrentElementName() + " to " + getNewElementName();
+ String message = MessageFormat.format("Rename {0} to {1}", getCurrentElementName(), getNewElementName());
return message;
}
@@ -98,7 +99,7 @@
return RefactoringStatus.createFatalErrorStatus("Object is removed from model.");
if (c.getChildByPath(newName) != null)
- return RefactoringStatus.createFatalErrorStatus("Object " + newName + " already exists.");
+ return RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Object {0} already exists.", newName));
return RefactoringStatus.create(Status.OK_STATUS);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RefactoringHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RefactoringHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RefactoringHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -37,7 +37,7 @@
if(body == null || replacements.size() == 0) return;
ReplaceEdit[] edits = RefactoringHelper.getEdits(replacements, body);
if(edits != null && edits.length > 0) {
- TextFileChange change = new TextFileChange("TextFileChange", f);
+ TextFileChange change = new TextFileChange("TextFileChange", f); //$NON-NLS-1$
for (int j = 0; j < edits.length; j++) {
TextChangeCompatibility.addTextEdit(change, "Update Reference", edits[j]);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameModelObjectChange.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.refactoring;
+import java.text.MessageFormat;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -101,7 +102,7 @@
}
public String getName() {
- return "Edit " + attributeName;
+ return MessageFormat.format("Edit {0}", attributeName);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -26,7 +26,7 @@
initialize(refactoring, name, 0);
Shell shell = ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
RenameUserInterfaceStarter starter = new RenameUserInterfaceStarter();
- RenameRefactoringWizard wizard = new RenameRefactoringWizard(refactoring, "Rename", "", null, "");
+ RenameRefactoringWizard wizard = new RenameRefactoringWizard(refactoring, "Rename", "", null, ""); //$NON-NLS-2$ //$NON-NLS-3$
starter.initialize(wizard);
try {
starter.activate(refactoring, shell, RefactoringSaveHelper.SAVE_ALL);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,14 +25,14 @@
public void prepare() {
super.prepare();
- matching = (SearchConstraint)getChildren("SearchMatch")[0];
- insight = (SearchConstraint)getChildren("SearchRecursion")[0];
+ matching = (SearchConstraint)getChildren("SearchMatch")[0]; //$NON-NLS-1$
+ insight = (SearchConstraint)getChildren("SearchRecursion")[0]; //$NON-NLS-1$
}
public XModelObject[] execute() {
prepare();
ArrayList<XModelObject> list = new ArrayList<XModelObject>();
- String[] roots = XModelObjectUtil.asStringArray(getAttributeValue("root"));
+ String[] roots = XModelObjectUtil.asStringArray(getAttributeValue("root")); //$NON-NLS-1$
ArrayList<XModelObject> os = new ArrayList<XModelObject>();
if(roots.length == 0) {
os.add(getModel().getRoot());
@@ -50,10 +50,10 @@
}
public void validate() {
- String rootpath = getAttributeValue("root");
- if(rootpath.length() == 0) throw new IllegalStateException("Attribute 'root' of search command must be set.");
+ String rootpath = getAttributeValue("root"); //$NON-NLS-1$
+ if(rootpath.length() == 0) throw new IllegalStateException("Attribute 'root' of search command must be set."); //$NON-NLS-1$
XModelObject root = getModel().getByPath(rootpath);
- if(root == null) throw new IllegalStateException("Root of search command is not found in model.");
+ if(root == null) throw new IllegalStateException("Root of search command is not found in model."); //$NON-NLS-1$
}
protected void execute(XModelObject o, ArrayList<XModelObject> list) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -31,7 +31,7 @@
}
public void prepare() {
- not = XModelObjectConstants.TRUE.equals(getAttributeValue("not"));
+ not = XModelObjectConstants.TRUE.equals(getAttributeValue("not")); //$NON-NLS-1$
SharableElement[] cs = getSharableChildren();
constraints = new SearchConstraint[cs.length];
for (int i = 0; i < cs.length; i++) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintValueImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintValueImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchConstraintValueImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -23,7 +23,7 @@
public SearchConstraintValueImpl() {}
public boolean accepts(XModelObject object) {
- if("*".equals(propertyname)) {
+ if("*".equals(propertyname)) { //$NON-NLS-1$
XAttribute[] as = object.getModelEntity().getAttributes();
for (int i = 0; i < as.length; i++) {
if(matches(object, as[i].getName()) ? !not : not) return true;
@@ -47,14 +47,14 @@
}
public void prepare() {
- propertyname = getAttributeValue("property name");
- propertyvalue = getAttributeValue("text to find");
- not = XModelObjectConstants.TRUE.equals(getAttributeValue("not"));
- ignorecase = XModelObjectConstants.TRUE.equals(getAttributeValue("ignore case"));
+ propertyname = getAttributeValue("property name"); //$NON-NLS-1$
+ propertyvalue = getAttributeValue("text to find"); //$NON-NLS-1$
+ not = XModelObjectConstants.TRUE.equals(getAttributeValue("not")); //$NON-NLS-1$
+ ignorecase = XModelObjectConstants.TRUE.equals(getAttributeValue("ignore case")); //$NON-NLS-1$
if(ignorecase) propertyvalue = propertyvalue.toLowerCase();
- String eq = getAttributeValue("equality");
- equality = ("coincides".equals(eq)) ? 0 :
- ("contains".equals(eq)) ? 1 : -1;
+ String eq = getAttributeValue("equality"); //$NON-NLS-1$
+ equality = ("coincides".equals(eq)) ? 0 : //$NON-NLS-1$
+ ("contains".equals(eq)) ? 1 : -1; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchDefaultHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchDefaultHandler.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchDefaultHandler.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.search.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.plugin.ModelMessages;
@@ -19,7 +20,7 @@
import org.jboss.tools.common.meta.action.impl.handlers.*;
//TODO check if this class is still needed
public class SearchDefaultHandler extends AbstractHandler {
- static String CONSTRAINT_ENTITY = "SearchValue";
+ static String CONSTRAINT_ENTITY = "SearchValue"; //$NON-NLS-1$
static SpecialWizard wizard = null;
static SpecialWizard wizard() {
@@ -53,7 +54,7 @@
if(i != 0) return null;
Properties p = DefaultCreateHandler.extractProperties(ed);
Enumeration en = p.keys();
- XModelObject vc = sc.getChildByPath("Match/value constraint");
+ XModelObject vc = sc.getChildByPath("Match/value constraint"); //$NON-NLS-1$
while(en.hasMoreElements()) {
String n = (String)en.nextElement();
String v = p.getProperty(n);
@@ -65,30 +66,30 @@
private XModelObject findOrCreateDefaultSearch(XModelObject object, XModelObject[] objects) throws XModelException {
XModel model = object.getModel();
- XModelObject sr = model.getByPath("XStudio/Search");
- XModelObject ds = sr.getChildByPath("Default");
+ XModelObject sr = model.getByPath("XStudio/Search"); //$NON-NLS-1$
+ XModelObject ds = sr.getChildByPath("Default"); //$NON-NLS-1$
Properties p = new Properties();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < objects.length; i++) {
- if(i > 0) sb.append(";");
+ if(i > 0) sb.append(";"); //$NON-NLS-1$
sb.append(objects[i].getPath());
}
if(ds == null) {
- p.setProperty(XModelObjectConstants.ATTR_NAME, "Default");
- p.setProperty("root", sb.toString());
- ds = XModelObjectLoaderUtil.createValidObject(model, "SearchCommand", p);
+ p.setProperty(XModelObjectConstants.ATTR_NAME, "Default"); //$NON-NLS-1$
+ p.setProperty("root", sb.toString()); //$NON-NLS-1$
+ ds = XModelObjectLoaderUtil.createValidObject(model, "SearchCommand", p); //$NON-NLS-1$
sr.addChild(ds);
sr.setModified(true);
} else {
- model.changeObjectAttribute(ds, "root", sb.toString());
+ model.changeObjectAttribute(ds, "root", sb.toString()); //$NON-NLS-1$
}
- XModelObject match = ds.getChildByPath("Match");
+ XModelObject match = ds.getChildByPath("Match"); //$NON-NLS-1$
XModelObject v = null;
if(match.getChildren(CONSTRAINT_ENTITY).length > 0) {
v = match.getChildren(CONSTRAINT_ENTITY)[0];
} else {
p.clear();
- p.setProperty(XModelObjectConstants.ATTR_NAME, "value constraint");
+ p.setProperty(XModelObjectConstants.ATTR_NAME, "value constraint"); //$NON-NLS-1$
v = XModelObjectLoaderUtil.createValidObject(model, CONSTRAINT_ENTITY, p);
match.addChild(v);
match.setModified(true);
@@ -97,18 +98,18 @@
}
private String getDialogTitle(XModelObject[] os) {
- if(os.length == 1) return "Find in path " + os[0].getPath();
+ if(os.length == 1) return MessageFormat.format("Find in path {0}", os[0].getPath());
StringBuffer sb = new StringBuffer("Find in paths:");
- for (int i = 0; i < os.length; i++) sb.append("\n").append(os[i].getPath());
+ for (int i = 0; i < os.length; i++) sb.append("\n").append(os[i].getPath()); //$NON-NLS-1$
return sb.toString();
}
private XEntityData getSearchEntityData(XModelObject sc) {
- XModelObject c = sc.getChildByPath("Match/value constraint");
- String[][] ds = new String[][]{{"SearchValue", XModelObjectConstants.YES},
- {"text to find", XModelObjectConstants.YES},
- {"property name", XModelObjectConstants.NO},
- {"ignore case", XModelObjectConstants.NO}};
+ XModelObject c = sc.getChildByPath("Match/value constraint"); //$NON-NLS-1$
+ String[][] ds = new String[][]{{"SearchValue", XModelObjectConstants.YES}, //$NON-NLS-1$
+ {"text to find", XModelObjectConstants.YES}, //$NON-NLS-1$
+ {"property name", XModelObjectConstants.NO}, //$NON-NLS-1$
+ {"ignore case", XModelObjectConstants.NO}}; //$NON-NLS-1$
XEntityData d = XEntityDataImpl.create(ds);
XAttributeData[] as = d.getAttributeData();
for (int i = 0; i < as.length; i++) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeSetUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeSetUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeSetUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -25,7 +25,7 @@
for (int i = 0; i < attr.length; i++)
this.attr[i][2] = object.getAttributeValue(attr[i][0]);
String[] types = object.getModelEntity().getRenderer().getIconNames();
- String iconType = types.length == 0 ? "main" : object.getModelEntity().getRenderer().getIconNames()[0];
+ String iconType = types.length == 0 ? "main" : object.getModelEntity().getRenderer().getIconNames()[0]; //$NON-NLS-1$
icon = new XModelObjectIcon(object).getEclipseImage0(new String[]{iconType});
description = createDescription(object);
kind = EDIT;
@@ -60,7 +60,7 @@
}
protected String createDescription(XModelObject o) {
- return o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
+ return o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + //$NON-NLS-1$
o.getModelEntity().getRenderer().getTitle(o);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XChangeUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,12 +15,12 @@
public class XChangeUndo extends XChangeSetUndo {
public XChangeUndo(XModelObject object, String attr, String oldvalue) {
- super(object, new String[][]{{attr, oldvalue, ""}});
+ super(object, new String[][]{{attr, oldvalue, ""}}); //$NON-NLS-1$
}
protected String createDescription(XModelObject o) {
- return "'" + attr[0][0] + "' of " +
- o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
+ return "'" + attr[0][0] + "' of " + //$NON-NLS-1$ //$NON-NLS-2$
+ o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + //$NON-NLS-1$
o.getModelEntity().getRenderer().getTitle(o);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XCreateUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XCreateUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XCreateUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.undo;
+import java.text.MessageFormat;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.icons.impl.XModelObjectIcon;
@@ -23,12 +24,11 @@
this.model = parent.getModel();
parentpath = parent.getPath();
childpath = child.getPathPart();
- description = child.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
- child.getModelEntity().getRenderer().getTitle(child) + " in " +
- parent.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
- parent.getModelEntity().getRenderer().getTitle(parent);
+ description = MessageFormat.format("{0} {1} in {2} {3}",
+ child.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE), child.getModelEntity().getRenderer().getTitle(child),
+ parent.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE), parent.getModelEntity().getRenderer().getTitle(parent));
String[] types = child.getModelEntity().getRenderer().getIconNames();
- String iconType = types.length == 0 ? "main" : child.getModelEntity().getRenderer().getIconNames()[0];
+ String iconType = types.length == 0 ? "main" : child.getModelEntity().getRenderer().getIconNames()[0]; //$NON-NLS-1$
icon = new XModelObjectIcon(child).getEclipseImage0(new String[]{iconType});
kind = ADD;
}
@@ -53,7 +53,7 @@
}
protected String getActionIcon() {
- return "images/java/newattribute.gif";
+ return "images/java/newattribute.gif"; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XMoveUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XMoveUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XMoveUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.undo;
+import java.text.MessageFormat;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.impl.*;
@@ -24,14 +25,14 @@
path = object.getPath();
this.from = from;
this.to = to;
- op = object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
+ op = object.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + //$NON-NLS-1$
object.getModelEntity().getRenderer().getTitle(object);
resetDescription();
}
private void resetDescription() {
- description = "" + (from + 1) + "-th child of " +
- op + " moved to " + (to + 1) + "-th position";
+ description = MessageFormat.format("{0}-th child of {1} moved to {2}-th position",
+ (from + 1), op, (to + 1));
}
public void doUndo() {
@@ -51,7 +52,7 @@
}
protected String getActionIcon() {
- return "images/actions/undo.gif";
+ return "images/actions/undo.gif"; //$NON-NLS-1$
}
protected boolean merge(XUndoableImpl u) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XProtectedTransaction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XProtectedTransaction.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XProtectedTransaction.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -51,11 +51,11 @@
}
protected void doUndo() {
- mi.fireStructureChanged(object, XModelTreeEvent.STRUCTURE_CHANGED, "transaction_end");
+ mi.fireStructureChanged(object, XModelTreeEvent.STRUCTURE_CHANGED, "transaction_end"); //$NON-NLS-1$
}
protected void doRedo() {
- mi.fireStructureChanged(object, XModelTreeEvent.STRUCTURE_CHANGED, "transaction_begin");
+ mi.fireStructureChanged(object, XModelTreeEvent.STRUCTURE_CHANGED, "transaction_begin"); //$NON-NLS-1$
}
public void fire() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XRemoveUndo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XRemoveUndo.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XRemoveUndo.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.undo;
+import java.text.MessageFormat;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.icons.impl.XModelObjectIcon;
@@ -24,12 +25,11 @@
parentpath = parent.getPath();
childpath = child.getPathPart();
this.child = child.copy(false);
- description = child.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
- child.getModelEntity().getRenderer().getTitle(child) + " in " +
- parent.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " +
- parent.getModelEntity().getRenderer().getTitle(parent);
+ description = MessageFormat.format("{0} {1} in {2} {3}",
+ child.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE), child.getModelEntity().getRenderer().getTitle(child),
+ parent.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE), parent.getModelEntity().getRenderer().getTitle(parent));
String[] types = child.getModelEntity().getRenderer().getIconNames();
- String iconType = types.length == 0 ? "main" : child.getModelEntity().getRenderer().getIconNames()[0];
+ String iconType = types.length == 0 ? "main" : child.getModelEntity().getRenderer().getIconNames()[0]; //$NON-NLS-1$
icon = new XModelObjectIcon(child).getEclipseImage0(new String[]{iconType});
kind = REMOVE;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoItem.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoItem.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoItem.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,7 +14,7 @@
public class XUndoItem {
private Image[] icons = null;
- private String description = "";
+ private String description = ""; //$NON-NLS-1$
public XUndoItem(String description) {
this.description = description;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -70,10 +70,10 @@
if(transaction >= 0) return;
int capacity = 10;
- XModelObject root = model.getRoot("Preferences");
+ XModelObject root = model.getRoot("Preferences"); //$NON-NLS-1$
if(root!=null) {
- String c = root.getAttributeValue("undo capacity");
+ String c = root.getAttributeValue("undo capacity"); //$NON-NLS-1$
try {
capacity = Integer.parseInt(c);
} catch (NumberFormatException e) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoableImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoableImpl.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoableImpl.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -22,7 +22,7 @@
protected XUndoableImpl prev = null;
protected boolean undone = false;
- protected String description = "";
+ protected String description = ""; //$NON-NLS-1$
protected Image icon = null;
public XUndoableImpl() {}
@@ -70,9 +70,9 @@
}
protected String getActionIcon() {
- return (kind == ADD) ? "images/java/newattribute.gif" :
- (kind == REMOVE) ? "images/actions/delete.gif" :
- "images/file/redhat_file.gif";
+ return (kind == ADD) ? "images/java/newattribute.gif" : //$NON-NLS-1$
+ (kind == REMOVE) ? "images/actions/delete.gif" : //$NON-NLS-1$
+ "images/file/redhat_file.gif"; //$NON-NLS-1$
}
protected boolean merge(XUndoableImpl u) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AbstractTableHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AbstractTableHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AbstractTableHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -49,7 +49,7 @@
public String getValueAt(int r, int c) {
XModelObject f = getModelObject(r);
- return (f == null) ? "" : f.getAttributeValue(getHeader()[c]);
+ return (f == null) ? "" : f.getAttributeValue(getHeader()[c]); //$NON-NLS-1$
}
public void setValueAt(int r, int c, String value) throws XModelException {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleBundles.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleBundles.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleBundles.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -19,7 +19,7 @@
}
protected String extensions() {
- return ".properties.";
+ return ".properties."; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleClasses.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleClasses.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleClasses.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -74,7 +74,7 @@
}
}
- private static String exts = ".class.bo.java.cls.";
+ private static String exts = ".class.bo.java.cls."; //$NON-NLS-1$
protected String extensions() {
return exts;
@@ -82,8 +82,8 @@
private boolean buildPackage(SortedSet<String> list, String packagename) {
String pkg = packagename.toLowerCase();
- if(pkg.endsWith(".cvs")) return false;
- if(pkg.endsWith(".svn")) return false;
+ if(pkg.endsWith(".cvs")) return false; //$NON-NLS-1$
+ if(pkg.endsWith(".svn")) return false; //$NON-NLS-1$
boolean exists = false;
XModelObject fs = FileSystemsHelper.getFileSystems(model);
if(fs == null) return false;
@@ -98,8 +98,8 @@
private boolean getChildren(SortedSet<String> list, String packagename) throws JavaModelException {
if(javaProject == null || !javaProject.exists()) return false;
boolean exists = false;
- boolean r = "%root%".equals(packagename);
- String jp = (r) ? "" : packagename;
+ boolean r = "%root%".equals(packagename); //$NON-NLS-1$
+ String jp = (r) ? "" : packagename; //$NON-NLS-1$
IPackageFragmentRoot[] rs = javaProject.getPackageFragmentRoots();
for (int i = 0; i < rs.length; i++) {
IParent pf = (r) ? rs[i] : rs[i].getPackageFragment(packagename);
@@ -121,13 +121,13 @@
} else {
if(isp) {
if(n.indexOf('.') >= 0) continue;
- n += ".";
+ n += "."; //$NON-NLS-1$
} else {
int d = n.lastIndexOf('.');
if(d >= 0) {
String ext = n.substring(d + 1);
n = n.substring(0, d);
- if(!extensions().contains("." + ext + ".")) continue;
+ if(!extensions().contains("." + ext + ".")) continue; //$NON-NLS-1$ //$NON-NLS-2$
}
}
if(accepts(jp, n)) {
@@ -139,18 +139,18 @@
private void process2(SortedSet<String> list, IJavaElement[] cs, String jp) throws JavaModelException {
for (int j = 0; j < cs.length; j++) {
String n = cs[j].getElementName();
- if(!n.startsWith(jp + ".")) continue;
+ if(!n.startsWith(jp + ".")) continue; //$NON-NLS-1$
n = n.substring(jp.length() + 1);
boolean isp = cs[j] instanceof IPackageFragment;
if(isp) {
if(n.indexOf('.') >= 0) continue;
- n += ".";
+ n += "."; //$NON-NLS-1$
} else {
int d = n.lastIndexOf('.');
if(d >= 0) {
String ext = n.substring(d + 1);
n = n.substring(0, d);
- if(!extensions().contains("." + ext + ".")) continue;
+ if(!extensions().contains("." + ext + ".")) continue; //$NON-NLS-1$ //$NON-NLS-2$
}
}
if(accepts(jp, n)) {
@@ -160,7 +160,7 @@
}
protected boolean accepts(String packagename, String n) {
- return !n.equalsIgnoreCase("CVS.") && !n.equalsIgnoreCase("svn.");
+ return !n.equalsIgnoreCase("CVS.") && !n.equalsIgnoreCase("svn."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -169,8 +169,8 @@
public int compare(Object o1, Object o2) {
String s1 = (String)o1;
String s2 = (String)o2;
- if(s1.endsWith(".") && !s2.endsWith(".")) return -1;
- if(s2.endsWith(".") && !s1.endsWith(".")) return 1;
+ if(s1.endsWith(".") && !s2.endsWith(".")) return -1; //$NON-NLS-1$ //$NON-NLS-2$
+ if(s2.endsWith(".") && !s1.endsWith(".")) return 1; //$NON-NLS-1$ //$NON-NLS-2$
return s1.compareToIgnoreCase(s2);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleJava.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleJava.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/AccessibleJava.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -48,12 +48,12 @@
}
private String getJavaLib() {
- String rt = System.getProperty("java.home") + "/lib/rt.jar";
+ String rt = System.getProperty("java.home") + "/lib/rt.jar"; //$NON-NLS-1$ //$NON-NLS-2$
return rt;
}
protected String extension() {
- return ".class";
+ return ".class"; //$NON-NLS-1$
}
private void load() {
@@ -75,7 +75,7 @@
try {
addJar(new JarFile(t));
} catch (IOException e) {
- ModelPlugin.getPluginLog().logError("addJars:" + e.getClass().getName());
+ ModelPlugin.getPluginLog().logError("addJars:" + e.getClass().getName()); //$NON-NLS-1$
}
}
}
@@ -98,14 +98,14 @@
try {
jar.close();
} catch (IOException exc) {
- ModelPlugin.getPluginLog().logError("AccessibleJava:Cannot close jar.");
+ ModelPlugin.getPluginLog().logError("AccessibleJava:Cannot close jar."); //$NON-NLS-1$
}
}
- private static String[] serviceroots = {"CVS/", "META-INF/", ".svn"};
+ private static String[] serviceroots = {"CVS/", "META-INF/", ".svn"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private void register(String path, Map<String,SortedSet<String>> map) {
- if(path == null || path.indexOf("$") >= 0 || path.equals(XModelObjectConstants.SEPARATOR)) return;
+ if(path == null || path.indexOf("$") >= 0 || path.equals(XModelObjectConstants.SEPARATOR)) return; //$NON-NLS-1$
for (int j = 0; j < serviceroots.length; j++)
if(path.indexOf(serviceroots[j]) >= 0) return;
boolean isPackage = path.endsWith(XModelObjectConstants.SEPARATOR);
@@ -128,7 +128,7 @@
parent = path.substring(0, i);
name = path.substring(i + 1);
} else {
- parent = "%root%";
+ parent = "%root%"; //$NON-NLS-1$
name = path;
}
if(!isJavaName(name)) return;
@@ -137,7 +137,7 @@
list = new TreeSet<String>();
map.put(parent, list);
}
- String pname = name + ".";
+ String pname = name + "."; //$NON-NLS-1$
if(list.contains(name) || list.contains(pname)) return;
list.add((isPackage) ? pname : name);
if(i > 0) register0(parent, true, map);
@@ -193,10 +193,10 @@
private void addJarManifest(JarFile jf) throws IOException {
Manifest m = jf.getManifest();
Attributes as = m.getMainAttributes();
- String classpath = as.getValue("Class-Path");
+ String classpath = as.getValue("Class-Path"); //$NON-NLS-1$
if(classpath == null) return;
String r = new File(jf.getName()).getParentFile().getCanonicalPath() + File.separatorChar;
- StringTokenizer st = new StringTokenizer(classpath, " ");
+ StringTokenizer st = new StringTokenizer(classpath, " "); //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
while(st.hasMoreElements()) {
String t = st.nextToken().trim();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/BrowserHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/BrowserHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/BrowserHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.util;
import java.io.*;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.engines.impl.XProcess;
@@ -22,13 +23,13 @@
import org.jboss.tools.common.meta.action.impl.handlers.*;
public class BrowserHelper {
- static String ATTRIBUTE = "Browser Path";
+ static String ATTRIBUTE = "Browser Path"; //$NON-NLS-1$
public BrowserHelper() {}
public static void startExplorer(XModel model, String url) throws XModelException {
- XModelObject editor = PreferenceModelUtilities.getPreferenceModel().getByPath("%Options%/Struts Studio/Running");
+ XModelObject editor = PreferenceModelUtilities.getPreferenceModel().getByPath("%Options%/Struts Studio/Running"); //$NON-NLS-1$
if(editor == null) throw new XModelException("External Program 'Internet Browser' is not set in Options.");
if(validatePath(PreferenceModelUtilities.getPreferenceModel().getService(), editor)) new OWEProcess(editor, url).start();
}
@@ -52,16 +53,16 @@
return true;
}
} catch (XModelException e) {
- ModelPlugin.getPluginLog().logError("BrowserHelper:" + e.getMessage());
+ ModelPlugin.getPluginLog().logError("BrowserHelper:" + e.getMessage()); //$NON-NLS-1$
}
- int i = d.showDialog("Run", "Enter valid path for " + o.getPresentationString(),
+ int i = d.showDialog("Run", MessageFormat.format("Enter valid path for {0}", o.getPresentationString()),
new String[]{ModelMessages.OK, ModelMessages.Cancel}, dt[0], ServiceDialog.QUESTION);
if(i != 0) return false;
}
}
static String[] getEnvironmentPaths() {
- String jlp = OSHelper.getProperty("PATH", "");
+ String jlp = OSHelper.getProperty("PATH", ""); //$NON-NLS-1$ //$NON-NLS-2$
StringTokenizer st = new StringTokenizer(jlp, File.pathSeparator);
String[] ps = new String[st.countTokens()];
for (int i = 0; i < ps.length; i++) ps[i] = st.nextToken();
@@ -90,7 +91,7 @@
}
protected String getRoot() {
- return ".";
+ return "."; //$NON-NLS-1$
}
protected void write(String s) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ClassLoaderUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ClassLoaderUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ClassLoaderUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -30,26 +30,26 @@
}
private static String[][] activation = {
- {"org.jboss.tools.jst.web.ui", "org.jboss.tools.jst.web.ui.WebUiPlugin", "required"},
- {"org.jboss.tools.jst.web", "org.jboss.tools.jst.web.WebModelPlugin", "required"},
- {"org.jboss.tools.jsf.ui", "org.jboss.tools.jsf.ui.JsfUiPlugin", "required"},
- {"org.jboss.tools.struts.ui", "org.jboss.tools.struts.ui.StrutsUIPlugin", "optional"},
- {"org.jboss.tools.common.verification.ui", "org.jboss.tools.common.verification.ui.XStudioVerificationPlugin", "optional"},
+ {"org.jboss.tools.jst.web.ui", "org.jboss.tools.jst.web.ui.WebUiPlugin", "required"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ {"org.jboss.tools.jst.web", "org.jboss.tools.jst.web.WebModelPlugin", "required"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ {"org.jboss.tools.jsf.ui", "org.jboss.tools.jsf.ui.JsfUiPlugin", "required"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ {"org.jboss.tools.struts.ui", "org.jboss.tools.struts.ui.StrutsUIPlugin", "optional"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ {"org.jboss.tools.common.verification.ui", "org.jboss.tools.common.verification.ui.XStudioVerificationPlugin", "optional"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
};
private static void activate(int from, int to) {
for (int i = from; i < activation.length && i < to; i++) {
Bundle b = Platform.getBundle(activation[i][0]);
if(b == null) {
- if(activation[i].length >= 2 && "required".equals(activation[i][2])) {
- ModelPlugin.getPluginLog().logInfo("ClassLoaderUtil:activate: Cannot find required plugin " + activation[i][0]);
+ if(activation[i].length >= 2 && "required".equals(activation[i][2])) { //$NON-NLS-1$
+ ModelPlugin.getPluginLog().logInfo("ClassLoaderUtil:activate: Cannot find required plugin " + activation[i][0]); //$NON-NLS-1$
}
} else if(b.getState() != Bundle.ACTIVE) {
String n = activation[i][1];
try {
b.loadClass(n);
} catch (ClassNotFoundException e) {
- ModelPlugin.getPluginLog().logError("ClassLoaderUtil:activate: Cannot find class " + n);
+ ModelPlugin.getPluginLog().logError("ClassLoaderUtil:activate: Cannot find class " + n); //$NON-NLS-1$
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseJavaUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseJavaUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseJavaUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -51,7 +51,7 @@
return resolveType(type, typeName);
}
- static String NULL = ";;;";
+ static String NULL = ";;;"; //$NON-NLS-1$
static class Resolved {
IType type;
@@ -74,7 +74,7 @@
if(jp == null) return n;
IProject p = jp.getProject();
if(p == null || !p.isAccessible()) return n;
- return p.getName() + ":" + n;
+ return p.getName() + ":" + n; //$NON-NLS-1$
}
public static String resolveType(IType type, String typeName) {
if(type == null) return null;
@@ -86,7 +86,7 @@
r = new Resolved(type);
resolved.put(n, r);
if(resolved.size() % 100 == 0) {
- System.out.println("-->" + resolved.size() + " " + n);
+ System.out.println("-->" + resolved.size() + " " + n); //$NON-NLS-1$ //$NON-NLS-2$
}
}
if(r.type != type) {
@@ -117,9 +117,9 @@
String resolvedArray[][] = type.resolveType(typeName);
// resolvedArray == null for primitive types
if(resolvedArray == null) return typeName;
- typeName = "";
+ typeName = ""; //$NON-NLS-1$
for (int i = 0; i < resolvedArray[0].length; i++)
- typeName += (!"".equals(typeName) ? "." : "") + resolvedArray[0][i];
+ typeName += (!"".equals(typeName) ? "." : "") + resolvedArray[0][i]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return typeName;
} catch (JavaModelException e) {
ModelPlugin.getPluginLog().logError(e);
@@ -132,7 +132,7 @@
IType type = javaProject.findType(qualifiedName);
if(type != null) return type;
int dot = qualifiedName.lastIndexOf('.');
- String packageName = (dot < 0) ? "" : qualifiedName.substring(0, dot);
+ String packageName = (dot < 0) ? "" : qualifiedName.substring(0, dot); //$NON-NLS-1$
String shortName = qualifiedName.substring(dot + 1);
IPackageFragmentRoot[] rs = javaProject.getPackageFragmentRoots();
for (int i = 0; i < rs.length; i++) {
@@ -149,7 +149,7 @@
public static boolean isDerivedClass(String type, String superType, IProject project) {
if(type == null) return false;
- if(superType == null || superType.equals("java.lang.Object")) return true;
+ if(superType == null || superType.equals("java.lang.Object")) return true; //$NON-NLS-1$
if(type.equals(superType)) return true;
IType t = EclipseResourceUtil.getValidType(project, type);
try {
@@ -173,10 +173,10 @@
}
if(type.isInterface()) return false;
String f = type.getSuperclassName();
- if(f == null || f.length() == 0 || "java.lang.Object".equals(f)) return false;
+ if(f == null || f.length() == 0 || "java.lang.Object".equals(f)) return false; //$NON-NLS-1$
if(f.equals(superType)) return true;
f = EclipseJavaUtil.resolveType(type, f);
- if(f == null || f.length() == 0 || "java.lang.Object".equals(f)) return false;
+ if(f == null || f.length() == 0 || "java.lang.Object".equals(f)) return false; //$NON-NLS-1$
if(f.equals(superType)) return true;
if(checked.contains(f)) return false;
type = EclipseResourceUtil.getValidType(type.getJavaProject().getProject(), f);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -49,7 +49,7 @@
}
public static boolean isProjectFragment(XModel model) {
- return (XModelObjectConstants.TRUE.equals(model.getProperties().getProperty("isProjectFragment")));
+ return (XModelObjectConstants.TRUE.equals(model.getProperties().getProperty("isProjectFragment"))); //$NON-NLS-1$
}
public static IResource getResource(XModelObject object) {
@@ -60,10 +60,10 @@
public static String getJavaClassQualifiedName(XModelObject object) {
if(object.getFileType() != XFileObject.FILE) return null;
String ext = object.getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION);
- if(!"java".equals(ext) && !"class".equals(ext)) return null;
+ if(!"java".equals(ext) && !"class".equals(ext)) return null; //$NON-NLS-1$ //$NON-NLS-2$
String q = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
String p = getJavaPackageName(object.getParent());
- return (p == null) ? q : p + "." + q;
+ return (p == null) ? q : p + "." + q; //$NON-NLS-1$
}
public static String getJavaPackageName(XModelObject object) {
@@ -71,7 +71,7 @@
String q = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
XModelObject o = object.getParent();
while(o != null && o.getFileType() == XFileObject.FOLDER) {
- q = o.getAttributeValue(XModelObjectConstants.ATTR_NAME) + "." + q;
+ q = o.getAttributeValue(XModelObjectConstants.ATTR_NAME) + "." + q; //$NON-NLS-1$
o = o.getParent();
}
return q;
@@ -79,7 +79,7 @@
public static String getIconPath(XModelObject o) {
String s = o.getMainIconName();
- return o.getModelEntity().getMetaModel().getIconList().getIconPath(s, "default.unknown");
+ return o.getModelEntity().getMetaModel().getIconList().getIconPath(s, "default.unknown"); //$NON-NLS-1$
}
public static Image getImage(String path) {
@@ -111,7 +111,7 @@
XModelObject o = findResourceInFileSystem(s, resource);
if(o != null) return o;
}
- fs = fso.getChildren("FileSystemJar");
+ fs = fso.getChildren("FileSystemJar"); //$NON-NLS-1$
String location = path == null ? null : path.toString().replace('\\', '/');
if(location != null && isJar(location)) {
for (int i = 0; i < fs.length; i++) {
@@ -159,7 +159,7 @@
Properties properties = new Properties();
String fsLoc = resource.getLocation().toString();
if(resource == resource.getProject()) {
- fsLoc = "%" + IModelNature.ECLIPSE_PROJECT + "%";
+ fsLoc = "%" + IModelNature.ECLIPSE_PROJECT + "%"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
fsLoc = getRelativeLocation(model, fsLoc);
}
@@ -186,11 +186,11 @@
static {
List<String> natures = new ArrayList<String>();
- if(Platform.getBundle("org.jboss.tools.struts") != null) {
- natures.add("org.jboss.tools.struts.strutsnature");
+ if(Platform.getBundle("org.jboss.tools.struts") != null) { //$NON-NLS-1$
+ natures.add("org.jboss.tools.struts.strutsnature"); //$NON-NLS-1$
}
- if(Platform.getBundle("org.jboss.tools.jsf") != null) {
- natures.add("org.jboss.tools.jsf.jsfnature");
+ if(Platform.getBundle("org.jboss.tools.jsf") != null) { //$NON-NLS-1$
+ natures.add("org.jboss.tools.jsf.jsfnature"); //$NON-NLS-1$
}
MODEL_NATURES = natures.toArray(new String[0]);
}
@@ -229,7 +229,7 @@
if(n == null) return null;
n = testNature(n);
if(n == null) {
- ModelPlugin.getPluginLog().logWarning("Project " + p + " has corrupted nature: " + natures[i]);
+ ModelPlugin.getPluginLog().logWarning("Project " + p + " has corrupted nature: " + natures[i]); //$NON-NLS-1$ //$NON-NLS-2$
removeNatureFromProject(p, natures[i]);
}
return n;
@@ -261,7 +261,7 @@
if(n == null) return null;
n = testNature(n);
if(n == null) {
- ModelPlugin.getPluginLog().logWarning("Project " + p + " has corrupted nature: " + id);
+ ModelPlugin.getPluginLog().logWarning("Project " + p + " has corrupted nature: " + id); //$NON-NLS-1$ //$NON-NLS-2$
removeNatureFromProject(p, id);
}
return n;
@@ -331,13 +331,13 @@
properties.setProperty(XModelConstants.WORKSPACE, r.getParent().getLocation().toString());
properties.setProperty(IModelNature.ECLIPSE_PROJECT, project.getLocation().toString());
properties.put(XModelObjectConstants.PROJECT, project);
- properties.put("isProjectFragment", XModelObjectConstants.TRUE);
+ properties.put("isProjectFragment", XModelObjectConstants.TRUE); //$NON-NLS-1$
model = XModelFactory.getModel(properties);
models.put(project, model);
XModelObject fs = FileSystemsHelper.getFileSystems(model);
if(fs == null) {
- ModelPlugin.getPluginLog().logInfo("Cannot create file systems for project " + project);
+ ModelPlugin.getPluginLog().logInfo("Cannot create file systems for project " + project); //$NON-NLS-1$
return null;
}
String fsLoc = null;
@@ -354,7 +354,7 @@
if(webRoot != null && webRoot.exists() && webRoot != project) {
fsLoc = webRoot.getLocation().toString();
properties.setProperty(XModelObjectConstants.ATTR_NAME_LOCATION, fsLoc);
- properties.setProperty(XModelObjectConstants.ATTR_NAME, "WEB-ROOT");
+ properties.setProperty(XModelObjectConstants.ATTR_NAME, "WEB-ROOT"); //$NON-NLS-1$
s = (FileSystemImpl)model.createModelObject(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER, properties);
fs.addChild(s);
}
@@ -405,10 +405,10 @@
private static void validateJarSystem(XModelObject fs, IResource resource) {
if(fs == null || !isJar(resource)) return;
- String jsname = "lib-" + resource.getName().toLowerCase();
+ String jsname = "lib-" + resource.getName().toLowerCase(); //$NON-NLS-1$
String location = resource.getLocation().toString().replace('\\', '/');
if(fs.getChildByPath(jsname) == null) {
- XModelObject q = fs.getModel().createModelObject("FileSystemJar", null);
+ XModelObject q = fs.getModel().createModelObject("FileSystemJar", null); //$NON-NLS-1$
q.setAttributeValue(XModelObjectConstants.ATTR_NAME, jsname);
q.setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, location);
fs.addChild(q);
@@ -434,7 +434,7 @@
}
if(o == null) return null;
XModelObject p = o;
- while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent();
+ while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent(); //$NON-NLS-1$
if(p == null) {
IResource r = (IResource)o.getAdapter(IResource.class);
if(r == null || !resource.getLocation().equals(r.getLocation())) {
@@ -447,7 +447,7 @@
public static boolean isOverlapped(XModelObject object) {
XModelObject p = object;
- while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent();
+ while(p != null && !XModelObjectConstants.TRUE.equals(p.get("overlapped"))) p = p.getParent(); //$NON-NLS-1$
return (p != null);
}
@@ -463,11 +463,11 @@
properties.putAll(System.getProperties());
properties.setProperty(XModelConstants.WORKSPACE, f.getParent());
- properties.put("isProjectFragment", XModelObjectConstants.TRUE);
+ properties.put("isProjectFragment", XModelObjectConstants.TRUE); //$NON-NLS-1$
XModel model = XModelFactory.getModel(properties);
XModelObject fs = FileSystemsHelper.getFileSystems(model);
if(fs == null) {
- ModelPlugin.getPluginLog().logInfo("Cannot create file systems for model at " + location);
+ ModelPlugin.getPluginLog().logInfo("Cannot create file systems for model at " + location); //$NON-NLS-1$
return null;
}
properties = new Properties();
@@ -605,7 +605,7 @@
try {
String s = null;
String path = es[i].getPath().toString();
- if(path.startsWith(XModelObjectConstants.SEPARATOR + project.getName() + XModelObjectConstants.SEPARATOR)) { //$NON-NLS-1$ //$NON-NLS-2$
+ if(path.startsWith(XModelObjectConstants.SEPARATOR + project.getName() + XModelObjectConstants.SEPARATOR)) {
s = project.findMember(es[i].getPath().removeFirstSegments(1)).getLocation().toString();
} else if(new java.io.File(path).isFile()) {
s = path;
@@ -637,7 +637,7 @@
} else {
String p = getJavaClassQualifiedName(object);
if(p == null) return null;
- path = new Path(p.replace('.', '/') + ".java");
+ path = new Path(p.replace('.', '/') + ".java"); //$NON-NLS-1$
}
return javaProject.findElement(path);
} catch (CoreException ex) {
@@ -664,9 +664,9 @@
}
return t;
} catch (JavaModelException t) {
- ModelPlugin.getPluginLog().logError("Error while obtaining type " + className, t);
+ ModelPlugin.getPluginLog().logError("Error while obtaining type " + className, t); //$NON-NLS-1$
} catch (CoreException t) {
- ModelPlugin.getPluginLog().logError("Error occured while obtaining Java Problem markers for " + f.getLocation() , t);
+ ModelPlugin.getPluginLog().logError("Error occured while obtaining Java Problem markers for " + f.getLocation() , t); //$NON-NLS-1$
}
return null;
}
@@ -683,7 +683,7 @@
if(root == null) return null;
if(!root.getLocation().isPrefixOf(resource.getLocation())) return null;
String relative = resource.getLocation().toString().substring(root.getLocation().toString().length());
- if(!relative.endsWith(".java")) return null;
+ if(!relative.endsWith(".java")) return null; //$NON-NLS-1$
relative = relative.substring(0, relative.length() - 5);
relative = relative.replace('\\', '/');
if(relative.startsWith(XModelObjectConstants.SEPARATOR)) relative = relative.substring(1);
@@ -702,10 +702,10 @@
IResource r = project.getWorkspace().getRoot().findMember(p);
if(r == null || r.getLocation() == null) return false;
String output = r.getLocation().toString();
- String f = output + XModelObjectConstants.SEPARATOR + className.replace('.', '/') + ".class";
+ String f = output + XModelObjectConstants.SEPARATOR + className.replace('.', '/') + ".class"; //$NON-NLS-1$
return new java.io.File(f).isFile();
} catch (JavaModelException t) {
- ModelPlugin.getPluginLog().logError("Error checking class " + className, t);
+ ModelPlugin.getPluginLog().logError("Error checking class " + className, t); //$NON-NLS-1$
return false;
}
}
@@ -733,7 +733,7 @@
}
}
} catch(CoreException ce) {
- ModelPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce);
+ ModelPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce); //$NON-NLS-1$
}
return resources.toArray(new IResource[resources.size()]);
}
@@ -797,7 +797,7 @@
public static void openResource(IResource resource) {
XModelObject o = getObjectByResource(resource);
if(o == null) o = createObjectForResource(resource);
- if(o != null) XActionInvoker.invoke("Open", o, null);
+ if(o != null) XActionInvoker.invoke("Open", o, null); //$NON-NLS-1$
}
public static String getInstallPath(Plugin plugin) {
@@ -927,7 +927,7 @@
}
public static String getRelativeLocation(XModel model, String path) {
- if(path == null || path.startsWith("%")) return path;
+ if(path == null || path.startsWith("%")) return path; //$NON-NLS-1$
String workspace = XModelConstants.getWorkspace(model);
if(workspace == null) return path;
workspace = new File(workspace).getAbsolutePath().replace('\\', '/');
@@ -954,7 +954,7 @@
public static boolean isJar(String path) {
if(path == null) return false;
path = path.toLowerCase();
- return path.endsWith(".jar") || path.endsWith(".zip");
+ return path.endsWith(".jar") || path.endsWith(".zip"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -32,11 +32,11 @@
Integer i = resolved.get(entity);
if(i != null) return i.intValue();
- XAttribute a = entity.getAttribute("publicId");
+ XAttribute a = entity.getAttribute("publicId"); //$NON-NLS-1$
if(a != null) {
return resolveDTD(entity, a);
}
- a = entity.getAttribute("xsi:schemaLocation");
+ a = entity.getAttribute("xsi:schemaLocation"); //$NON-NLS-1$
if(a != null && isResolvingSchema) {
return resolveSchema(entity, a);
}
@@ -63,7 +63,7 @@
private int resolveSchema(XModelEntity entity, XAttribute a) {
String v = a.getDefaultValue();
- String[] vs = v.split(" ");
+ String[] vs = v.split(" "); //$NON-NLS-1$
if(vs == null || vs.length < 2) {
resolved.put(entity, Integer.valueOf(MISSING));
return MISSING;
@@ -89,12 +89,12 @@
public static boolean isSystemId(String body) {
if(body == null) return false;
- int i = body.indexOf("<!DOCTYPE");
+ int i = body.indexOf("<!DOCTYPE"); //$NON-NLS-1$
if(i < 0) return false;
- int j = body.indexOf(">", i);
+ int j = body.indexOf(">", i); //$NON-NLS-1$
if(j < 0) return false;
String dt = body.substring(i, j);
- return (dt.indexOf("SYSTEM") > 0);
+ return (dt.indexOf("SYSTEM") > 0); //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/FindObjectHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/FindObjectHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/FindObjectHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -29,7 +29,7 @@
private int line = -1;
public static SpecialWizard createSelectWizard() {
- return SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.select.SelectObjectWizard");
+ return SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.select.SelectObjectWizard"); //$NON-NLS-1$
}
public static int findModelObject(XModelObject o, int where) {
@@ -50,15 +50,15 @@
}
public static String makeRef(XModelObject o) {
- return "" + o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + makeRef(o.getPath(), o.getPresentationString());
+ return "" + o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + makeRef(o.getPath(), o.getPresentationString()); //$NON-NLS-1$ //$NON-NLS-2$
}
public static String makeRef(XModelObject o, int line) {
- return "" + o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + makeRef(o.getPath() + ":" + line, o.getPresentationString());
+ return "" + o.getAttributeValue(XModelObjectConstants.ATTR_ELEMENT_TYPE) + " " + makeRef(o.getPath() + ":" + line, o.getPresentationString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static String makeRef(String hidden, String visible) {
- return "@" + hidden + "@" + visible + "@";
+ return "@" + hidden + "@" + visible + "@"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public FindObjectHelper() {}
@@ -74,10 +74,10 @@
XModelObject o = findRef();
if(o == null) o = findJava();
if(o != null) {
- o.set("_error_line_", "" + line);
+ o.set("_error_line_", "" + line); //$NON-NLS-1$ //$NON-NLS-2$
select.setObject(o);
select.execute();
- o.set("_error_line_", "");
+ o.set("_error_line_", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
return 0;
}
@@ -85,15 +85,15 @@
private XModelObject findRef() {
int i = 0;
while(i < command.length()) {
- int i1 = command.indexOf("@", i);
+ int i1 = command.indexOf("@", i); //$NON-NLS-1$
if(i1 < 0 || i1 > off) return null;
- int i2 = command.indexOf("@", i1 + 1);
+ int i2 = command.indexOf("@", i1 + 1); //$NON-NLS-1$
if(i2 < 0) return null;
String p = command.substring(i1 + 1, i2);
- int i3 = command.indexOf("@", i2 + 1);
+ int i3 = command.indexOf("@", i2 + 1); //$NON-NLS-1$
if(i3 < 0) return null;
if(i3 >= off) {
- int q = p.indexOf(":");
+ int q = p.indexOf(":"); //$NON-NLS-1$
if(q >= 0) {
try {
line = Integer.parseInt(p.substring(q + 1));
@@ -134,7 +134,7 @@
f.setData(q.cls(), q.line() + 1, model);
XModelObject o = model.getByPath(f.getJPath());
if(o != null) {
- return q.getLineStart() + makeRef(o.getPath() + ":" + q.line(), q.toString());
+ return q.getLineStart() + makeRef(o.getPath() + ":" + q.line(), q.toString()); //$NON-NLS-1$
} else if(q.line() < 0) {
return st;
}
@@ -144,20 +144,20 @@
String path = s.getPath();
o = (path == null) ? null : model.getByPath(path);
if(o == null) return st;
- return q.getLineStart() + makeRef(o.getPath() + ":" + s.getLine(), q.toString());
+ return q.getLineStart() + makeRef(o.getPath() + ":" + s.getLine(), q.toString()); //$NON-NLS-1$
}
}
class FileInfo {
- private String text = "";
+ private String text = ""; //$NON-NLS-1$
private int line;
- private String jpath = "";
+ private String jpath = ""; //$NON-NLS-1$
public void setData(String cls, int ln, XModel model) {
- jpath = XModelObjectConstants.SEPARATOR + cls.replace('.', '/') + ".java";
+ jpath = XModelObjectConstants.SEPARATOR + cls.replace('.', '/') + ".java"; //$NON-NLS-1$
line = ln;
- String fn = "" + XModelObjectUtil.getExpandedValue(model.getByPath("Engines/generator"), "directory", null) + "/src" + jpath;
+ String fn = "" + XModelObjectUtil.getExpandedValue(model.getByPath("Engines/generator"), "directory", null) + "/src" + jpath; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
text = XModelObjectLoaderUtil.readFile(fn);
}
@@ -200,15 +200,15 @@
int off = getOffset(text, line);
int b = 0, e = 0;
while(true) {
- b = text.indexOf("//<!--", e);
+ b = text.indexOf("//<!--", e); //$NON-NLS-1$
if(b < 0) return;
- e = text.indexOf("//--", b);
+ e = text.indexOf("//--", b); //$NON-NLS-1$
if(e < 0) return;
if(e > off) break;
}
- b = text.indexOf("//", b + 2);
+ b = text.indexOf("//", b + 2); //$NON-NLS-1$
if(b < 0) return;
- int b2 = text.indexOf("\n", b);
+ int b2 = text.indexOf("\n", b); //$NON-NLS-1$
if(b2 < 0) return;
path = text.substring(b + 2, b2);
int q = path.lastIndexOf('.');
@@ -218,22 +218,22 @@
}
private int getOffset(String text, int ln) {
- StringTokenizer st = new StringTokenizer(text, "\n", true);
+ StringTokenizer st = new StringTokenizer(text, "\n", true); //$NON-NLS-1$
int r = 0;
while(ln > 1 && st.hasMoreTokens()) {
String s = st.nextToken();
- if("\n".equals(s)) --ln;
+ if("\n".equals(s)) --ln; //$NON-NLS-1$
r += s.length();
}
return r;
}
private void reduceLine(String text, int b) {
- StringTokenizer st = new StringTokenizer(text, "\n", true);
+ StringTokenizer st = new StringTokenizer(text, "\n", true); //$NON-NLS-1$
int r = 0;
while(r < b && st.hasMoreTokens()) {
String s = st.nextToken();
- if("\n".equals(s)) --line;
+ if("\n".equals(s)) --line; //$NON-NLS-1$
r += s.length();
}
--line;
@@ -254,7 +254,7 @@
}
class StackTraceLine {
- public static String PREFIX = "\tat ";
+ public static String PREFIX = "\tat "; //$NON-NLS-1$
private String beg = null;
private String cls = null;
private String mtd = null;
@@ -284,7 +284,7 @@
}
public String toString() {
- return cls + "." + mtd + "(" + (ln + 1) + ")";
+ return cls + "." + mtd + "(" + (ln + 1) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public String getLineStart() {
@@ -311,7 +311,7 @@
private XModelObject jf = null;
public JavacErrorHeadLine(XModel model, String command) {
- int i = command.indexOf(".java:");
+ int i = command.indexOf(".java:"); //$NON-NLS-1$
if(i < 0) return;
int j = command.indexOf(':', i + 6);
try {
@@ -321,12 +321,12 @@
}
String fn = command.substring(0, i);
fn = fn.substring(fn.indexOf(']') + 1).trim(); // Cut off ant task prefix.
- XModelObject g = model.getByPath("Engines/generator");
+ XModelObject g = model.getByPath("Engines/generator"); //$NON-NLS-1$
if(g != null) {
- String p = "" + XModelObjectUtil.getExpandedValue(g, "directory", null) + "/src/";
+ String p = "" + XModelObjectUtil.getExpandedValue(g, "directory", null) + "/src/"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
cls = fn.substring(p.length()).replace('/', '.').replace('\\', '.');
}
- findJFile(model, XModelObjectConstants.SEPARATOR + fn.replace('\\', '/') + ".java");
+ findJFile(model, XModelObjectConstants.SEPARATOR + fn.replace('\\', '/') + ".java"); //$NON-NLS-1$
}
private void findJFile(XModel model, String fn) {
@@ -339,7 +339,7 @@
private boolean isOverlapped(XModelObject o) {
while(o != null) {
- if(XModelObjectConstants.TRUE.equals(o.get("overlapped"))) return true;
+ if(XModelObjectConstants.TRUE.equals(o.get("overlapped"))) return true; //$NON-NLS-1$
o = o.getParent();
}
return false;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/IconUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/IconUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/IconUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,17 +10,14 @@
******************************************************************************/
package org.jboss.tools.common.model.util;
-import java.awt.Point;
import java.awt.image.*;
import javax.swing.*;
-import org.eclipse.core.runtime.Status;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.PaletteData;
import org.eclipse.swt.graphics.RGB;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
public class IconUtil {
public static final int PALETTE_GROUP_IMAGE_TYPE = 1;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -33,7 +33,7 @@
*
*/
public class ModelFeatureFactory {
- public static final String POINT = "org.jboss.tools.common.model.classes";
+ public static final String POINT = "org.jboss.tools.common.model.classes"; //$NON-NLS-1$
public static ModelFeatureFactory getInstance() {
return ModelFeatureFactoryHolder.INSTANCE;
@@ -53,14 +53,14 @@
for (int i = 0; i < es.length; i++) {
IConfigurationElement[] cs = es[i].getConfigurationElements();
for (int j = 0; j < cs.length; j++) {
- String id = cs[j].getAttribute("id");
+ String id = cs[j].getAttribute("id"); //$NON-NLS-1$
elements.put(id, cs[j]);
}
}
}
private boolean isActive() {
- Bundle b = Platform.getBundle("org.jboss.tools.common.model");
+ Bundle b = Platform.getBundle("org.jboss.tools.common.model"); //$NON-NLS-1$
int state = b == null ? -1 : b.getState() ;
return state == Bundle.ACTIVE;
}
@@ -71,17 +71,17 @@
if(c == null) {
instanceFailures.add(id);
classFailures.add(id);
- ModelPlugin.getPluginLog().logError(new Exception("Model feature " + id + " is not registered with extension point " + POINT));
+ ModelPlugin.getPluginLog().logError(new Exception("Model feature " + id + " is not registered with extension point " + POINT)); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
try {
- return c.createExecutableExtension("class");
+ return c.createExecutableExtension("class"); //$NON-NLS-1$
} catch (CoreException e) {
instanceFailures.add(id);
- ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e);
+ ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e); //$NON-NLS-1$ //$NON-NLS-2$
} catch (InvalidRegistryObjectException e) {
instanceFailures.add(id);
- ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e);
+ ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
}
@@ -92,18 +92,18 @@
if(c == null) {
classFailures.add(id);
instanceFailures.add(id);
- ModelPlugin.getPluginLog().logError(new Exception("Model feature " + id + " is not registered with extension point " + POINT));
+ ModelPlugin.getPluginLog().logError(new Exception("Model feature " + id + " is not registered with extension point " + POINT)); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
try {
String n = c.getNamespaceIdentifier();
Bundle b = Platform.getBundle(n);
- String cls = c.getAttribute("class");
+ String cls = c.getAttribute("class"); //$NON-NLS-1$
return b.loadClass(cls);
} catch (ClassNotFoundException e) {
classFailures.add(id);
if(!isActive()) return null;
- ModelPlugin.getPluginLog().logError("Cannot create model feature class " + c.getAttribute("class") + ".", e);
+ ModelPlugin.getPluginLog().logError("Cannot create model feature class " + c.getAttribute("class") + ".", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return null;
}
@@ -115,7 +115,7 @@
return (XModelObject)o;
} catch (ClassCastException e) {
instanceFailures.add(id);
- ModelPlugin.getPluginLog().logError("Model feature " + id + " is not instance of XModelObject", e);
+ ModelPlugin.getPluginLog().logError("Model feature " + id + " is not instance of XModelObject", e); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelImages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelImages.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelImages.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -43,16 +43,16 @@
}
public ImageDescriptor createImageDescriptor(String key) {
- if(key.startsWith("command:")) {
- key = key.substring("command:".length());
+ if(key.startsWith("command:")) { //$NON-NLS-1$
+ key = key.substring("command:".length()); //$NON-NLS-1$
IWorkbench w = ModelPlugin.getDefault().getWorkbench();
ICommandImageService s = (ICommandImageService)w.getService(ICommandImageService.class);
return s.getImageDescriptor(key);
}
URL url = baseUrl;
- if(key.startsWith("plugin:")) {
- key = key.substring("plugin:".length());
- int i = key.indexOf(":");
+ if(key.startsWith("plugin:")) { //$NON-NLS-1$
+ key = key.substring("plugin:".length()); //$NON-NLS-1$
+ int i = key.indexOf(":"); //$NON-NLS-1$
String plugin = key.substring(0, i);
key = key.substring(i + 1);
Bundle bundle = Platform.getBundle(plugin);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/NamespaceMapping.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/NamespaceMapping.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/NamespaceMapping.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,7 +18,7 @@
import org.jboss.tools.common.model.XModelObject;
public class NamespaceMapping {
- public static String ATTR_NAMESPACE_MAPPING = "namespaceMapping";
+ public static String ATTR_NAMESPACE_MAPPING = "namespaceMapping"; //$NON-NLS-1$
Map<String, String> defaultToActual = new HashMap<String, String>();
Map<String, String> actualToDefault = new HashMap<String, String>();
@@ -74,7 +74,7 @@
if(value != null) return value;
StringBuffer res = new StringBuffer();
if(name.indexOf('|') >= 0) {
- StringTokenizer st = new StringTokenizer(name, "|");
+ StringTokenizer st = new StringTokenizer(name, "|"); //$NON-NLS-1$
int i = 0;
while(st.hasMoreTokens()) {
String t = st.nextToken();
@@ -84,7 +84,7 @@
i++;
}
} else if(name.indexOf('.') >= 0) {
- StringTokenizer st = new StringTokenizer(name, ".");
+ StringTokenizer st = new StringTokenizer(name, "."); //$NON-NLS-1$
int i = 0;
while(st.hasMoreTokens()) {
String t = st.nextToken();
@@ -129,11 +129,11 @@
public static NamespaceMapping load(String s) {
if(s == null || s.length() == 0) return null;
NamespaceMapping m = new NamespaceMapping();
- StringTokenizer st = new StringTokenizer(s, " ");
+ StringTokenizer st = new StringTokenizer(s, " "); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String d = st.nextToken();
String a = st.hasMoreTokens() ? st.nextToken() : d;
- String u = st.hasMoreTokens() ? st.nextToken() : "http://";
+ String u = st.hasMoreTokens() ? st.nextToken() : "http://"; //$NON-NLS-1$
m.addNamespace(d, a, u);
}
return m;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/OSHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/OSHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/OSHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -34,37 +34,37 @@
Process p = null;
java.util.Properties envVars = new java.util.Properties();
Runtime r = Runtime.getRuntime();
- String OS = System.getProperty("os.name").toLowerCase();
+ String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
try {
// Get the Windows 95 environment variables
- if (OS.indexOf("windows 9") > -1) {
- p = r.exec( "command.com /c set" );
+ if (OS.indexOf("windows 9") > -1) { //$NON-NLS-1$
+ p = r.exec( "command.com /c set" ); //$NON-NLS-1$
}
// Get the Windows NT environment variables
- else if (OS.indexOf("nt") > -1) {
- p = r.exec( "cmd.exe /c set" );
+ else if (OS.indexOf("nt") > -1) { //$NON-NLS-1$
+ p = r.exec( "cmd.exe /c set" ); //$NON-NLS-1$
}
// Get the Windows 2000 environment variables
- else if (OS.indexOf("2000") > -1) {
- p = r.exec( "cmd.exe /c set" );
+ else if (OS.indexOf("2000") > -1) { //$NON-NLS-1$
+ p = r.exec( "cmd.exe /c set" ); //$NON-NLS-1$
}
// Get the Windows XP environment variables
- else if (OS.indexOf("xp") > -1) {
- p = r.exec( "cmd.exe /c set" );
+ else if (OS.indexOf("xp") > -1) { //$NON-NLS-1$
+ p = r.exec( "cmd.exe /c set" ); //$NON-NLS-1$
}
// Get the unix environment variables
- else if (OS.indexOf("linux") > -1) {
- p = r.exec( "env" );
+ else if (OS.indexOf("linux") > -1) { //$NON-NLS-1$
+ p = r.exec( "env" ); //$NON-NLS-1$
}
// Get the unix environment variables
- else if (OS.indexOf("unix") > -1) {
- p = r.exec( "/bin/env" );
+ else if (OS.indexOf("unix") > -1) { //$NON-NLS-1$
+ p = r.exec( "/bin/env" ); //$NON-NLS-1$
} // Get the unix environment variables
- else if (OS.indexOf("sunos") > -1) {
- p = r.exec( "/bin/env" );
+ else if (OS.indexOf("sunos") > -1) { //$NON-NLS-1$
+ p = r.exec( "/bin/env" ); //$NON-NLS-1$
} else {
if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("OS not known: " + OS);
+ ModelPlugin.getPluginLog().logInfo("OS not known: " + OS); //$NON-NLS-1$
}
}
} catch (java.io.IOException e) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Paths.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Paths.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Paths.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -26,7 +26,7 @@
p1 = result.indexOf('%', iStartPos);
p2 = (p1 >= 0) ? result.indexOf('%', p1 + 1) : -1;
if (p1 >= 0 && p2 > (p1 + 1)) {
- String s = properties.getProperty(result.substring(p1 + 1, p2), "");
+ String s = properties.getProperty(result.substring(p1 + 1, p2), ""); //$NON-NLS-1$
result = result.substring(0, p1) + s + result.substring(p2 + 1);
iStartPos = p1;
} else {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionHolder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionHolder.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionHolder.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,10 +14,10 @@
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
public class PositionHolder {
- static String POSITION_HOLDER_ID = "positionHolder";
+ static String POSITION_HOLDER_ID = "positionHolder"; //$NON-NLS-1$
public static PositionHolder getPosition(XModelObject object, String attribute) {
- String id = (attribute == null) ? POSITION_HOLDER_ID : POSITION_HOLDER_ID + "." + attribute;
+ String id = (attribute == null) ? POSITION_HOLDER_ID : POSITION_HOLDER_ID + "." + attribute; //$NON-NLS-1$
PositionHolder h = (PositionHolder)object.getObject(id);
if(h == null) {
h = new PositionHolder(object, attribute);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -40,7 +40,7 @@
public PositionSearcher() {}
public void init(String text, XModelObject object, String attribute) {
- if(attribute != null && attribute.startsWith("&")) {
+ if(attribute != null && attribute.startsWith("&")) { //$NON-NLS-1$
selectAttributeName = true;
attribute = attribute.substring(1);
}
@@ -67,7 +67,7 @@
XAttribute a = object.getModelEntity().getAttribute(attribute);
String xml = (a == null) ? null : a.getXMLName();
if(xml == null || xml.length() == 0) return;
- if(xml.indexOf(".") < 0) {
+ if(xml.indexOf(".") < 0) { //$NON-NLS-1$
String s = text.substring(startPosition, endPosition);
int i1 = findAttrPosition(s, xml);
if(selectAttributeName) {
@@ -84,16 +84,16 @@
}
} else {
xml = xml.substring(0, xml.indexOf('.'));
- int e1 = text.indexOf("</" + object.getModelEntity().getXMLSubPath() + ">", startPosition);
- String s = e1 < 0 ? "" : text.substring(startPosition, e1);
+ int e1 = text.indexOf("</" + object.getModelEntity().getXMLSubPath() + ">", startPosition); //$NON-NLS-1$ //$NON-NLS-2$
+ String s = e1 < 0 ? "" : text.substring(startPosition, e1); //$NON-NLS-1$
if(xml.length() == 0) {
- int i1 = s.indexOf(">");
+ int i1 = s.indexOf(">"); //$NON-NLS-1$
endPosition = startPosition + i1 + 1;
startPosition = startPosition + e1;
} else if(s.length() > 0) {
- int i1a = s.indexOf("<" + xml + ">");
- int i1b = s.indexOf("<" + xml + "/>");
- int i2 = (i1a < 0) ? -1 : s.indexOf("</", i1a);
+ int i1a = s.indexOf("<" + xml + ">"); //$NON-NLS-1$ //$NON-NLS-2$
+ int i1b = s.indexOf("<" + xml + "/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ int i2 = (i1a < 0) ? -1 : s.indexOf("</", i1a); //$NON-NLS-1$
if(i1a >= 0 && i2 >= 0) {
endPosition = startPosition + i2;
startPosition = startPosition + i1a + 2 + xml.length();
@@ -110,12 +110,12 @@
if(i < 0) {
return -1;
}
- StringTokenizer st = new StringTokenizer(s, "\"", true);
+ StringTokenizer st = new StringTokenizer(s, "\"", true); //$NON-NLS-1$
int pos = 0;
boolean inValue = false;
while(st.hasMoreTokens()) {
String t = st.nextToken();
- if(t.equals("\"")) {
+ if(t.equals("\"")) { //$NON-NLS-1$
inValue = !inValue;
} else {
if(!inValue) {
@@ -148,9 +148,9 @@
if(attribute != null && attribute.length() > 0) return;
String tagname = object.getModelEntity().getXMLSubPath();
if(tagname == null || tagname.length() == 0) return;
- String start = "<" + tagname;
+ String start = "<" + tagname; //$NON-NLS-1$
if(text.indexOf(start, startPosition) != startPosition) return;
- String finish = "</" + tagname + ">";
+ String finish = "</" + tagname + ">"; //$NON-NLS-1$ //$NON-NLS-2$
int i = text.indexOf(finish, startPosition);
if(i >= 0) endPosition = i + finish.length();
}
@@ -167,15 +167,15 @@
public void selectObject(XModelObject object) {
if(object == null) return;
String xml = object.getModelEntity().getXMLSubPath();
- String token = "<" + xml;
+ String token = "<" + xml; //$NON-NLS-1$
if(object.getFileType() == XModelObject.FILE) {
startPos = nextStartPos(token, startPos + 1);
if(startPos >= 0) {
- endPos = text.indexOf(">", startPos + 1);
- if(endPos < 0) endPos = text.indexOf("<", startPos + 1);
+ endPos = text.indexOf(">", startPos + 1); //$NON-NLS-1$
+ if(endPos < 0) endPos = text.indexOf("<", startPos + 1); //$NON-NLS-1$
if(endPos < 0) endPos = text.length(); else endPos++;
}
- } else if(token.equals("<")) {
+ } else if(token.equals("<")) { //$NON-NLS-1$
selectObject(object.getParent());
} else {
XModelObject parent = object.getParent();
@@ -198,8 +198,8 @@
}
}
if(os[i] == object) {
- endPos = text.indexOf(">", startPos + 1);
- if(endPos < 0) endPos = text.indexOf("<", startPos + 1);
+ endPos = text.indexOf(">", startPos + 1); //$NON-NLS-1$
+ if(endPos < 0) endPos = text.indexOf("<", startPos + 1); //$NON-NLS-1$
if(endPos < 0) endPos = text.length(); else endPos++;
return;
}
@@ -210,9 +210,9 @@
int nextStartPos(String token, int b) {
int s = text.indexOf(token, b);
if(s < 0) return s;
- int cb = text.indexOf("<!--", b);
+ int cb = text.indexOf("<!--", b); //$NON-NLS-1$
if(cb < 0 || cb > s) return s;
- int ce = text.indexOf("-->", cb);
+ int ce = text.indexOf("-->", cb); //$NON-NLS-1$
if(ce < 0) return -1;
return nextStartPos(token, ce + 3);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLMapper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLMapper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLMapper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -46,7 +46,7 @@
int processElement(Element node, int index) {
NodeList n = node.getChildNodes();
- int start = text.indexOf("<" + node.getNodeName(), index);
+ int start = text.indexOf("<" + node.getNodeName(), index); //$NON-NLS-1$
NamedNodeMap as = node.getAttributes();
if(as != null) for (int i = 0; i < as.getLength(); i++) {
@@ -70,7 +70,7 @@
Node cn = n.item(i);
ciindex = process(cn, ciindex);
}
- String token = "</" + node.getNodeName() + ">";
+ String token = "</" + node.getNodeName() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
int end = text.indexOf(token, ciindex) + token.length();
put(node, start, end);
@@ -85,8 +85,8 @@
}
int processCDATA(CharacterData node, int index) {
- int start = text.indexOf("<![CDATA[", index);
- int end = text.indexOf("]]>", index) + 3;
+ int start = text.indexOf("<![CDATA[", index); //$NON-NLS-1$
+ int end = text.indexOf("]]>", index) + 3; //$NON-NLS-1$
put(node, start, end);
return end;
}
@@ -97,8 +97,8 @@
}
int processComment(Comment node, int index) {
- int start = text.indexOf("<!--", index);
- int end = text.indexOf("-->", index) + 3;
+ int start = text.indexOf("<!--", index); //$NON-NLS-1$
+ int end = text.indexOf("-->", index) + 3; //$NON-NLS-1$
put(node, start, end);
return end;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -18,6 +18,7 @@
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
+import java.text.MessageFormat;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -42,7 +43,6 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelConstants;
import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.engines.impl.EnginesLoader;
@@ -57,7 +57,7 @@
import org.jboss.tools.common.xml.XMLUtilities;
public class XModelObjectLoaderUtil {
- public static String ATTR_ID_NAME = "_id_";
+ public static String ATTR_ID_NAME = "_id_"; //$NON-NLS-1$
private Hashtable<String,String> singular = null;
private boolean saveentity = true;
private String namespace = null;
@@ -90,7 +90,7 @@
}
public void load(Element element, XModelObject o) {
- if("AnyElement".equals(o.getModelEntity().getName())) {
+ if("AnyElement".equals(o.getModelEntity().getName())) { //$NON-NLS-1$
loadAnyElement(element, o);
} else {
loadAttributes(element, o);
@@ -111,7 +111,7 @@
static Map<XModelEntity, Set<String>> allowedChildren = new HashMap<XModelEntity, Set<String>>();
protected Set<String> getAllowedChildren(XModelEntity entity) {
- if(entity.getChild("AnyElement") != null) return null;
+ if(entity.getChild("AnyElement") != null) return null; //$NON-NLS-1$
Set<String> x = allowedChildren.get(entity);
if(x != null) return x;
Set<String> children = new HashSet<String>();
@@ -121,7 +121,7 @@
if(xml == null) continue;
int s = xml.indexOf('|');
if(s > 0) {
- StringTokenizer st = new StringTokenizer(xml, "|");
+ StringTokenizer st = new StringTokenizer(xml, "|"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String dxml = st.nextToken();
int k = dxml.indexOf('.');
@@ -154,7 +154,7 @@
}
protected Set<String> getAllowedAttributes(XModelEntity entity) {
- if(entity.getChild("AnyElement") != null) return null;
+ if(entity.getChild("AnyElement") != null) return null; //$NON-NLS-1$
Set<String> attributes = new HashSet<String>();
if(saveentity) {
attributes.add(XModelConstants.XMODEL_ENTITY_ATTR);
@@ -166,7 +166,7 @@
if(xml == null) continue;
int s = xml.indexOf('|');
if(s > 0) {
- StringTokenizer st = new StringTokenizer(xml, "|");
+ StringTokenizer st = new StringTokenizer(xml, "|"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String dxml = st.nextToken();
int k = dxml.indexOf('.');
@@ -191,7 +191,10 @@
name = namespaceMapping.convertToDefault(name);
}
if(allowed.contains(name)) continue;
- error = "Editor model does not support child element " + name + " of " + element.getNodeName() + ":0:0";
+ error = MessageFormat
+ .format(
+ "Editor model does not support child element {0} of {1}:0:0",
+ name, element.getNodeName());
return true;
}
}
@@ -205,8 +208,11 @@
if(n.getNodeType() == Node.ATTRIBUTE_NODE) {
String name = n.getNodeName();
if(allowed.contains(name)) continue;
- if(name.startsWith("xmlns")) continue;
- error = "Editor model does not support attribute " + name + " of " + element.getNodeName() + ":0:0";;
+ if(name.startsWith("xmlns")) continue; //$NON-NLS-1$
+ error = MessageFormat
+ .format(
+ "Editor model does not support attribute {0} of {1}:0:0",
+ name, element.getNodeName());;
return true;
}
}
@@ -235,7 +241,7 @@
}
}
String s = getFinalComment(element);
- if(s != null && s.length() > 0) o.set("#final-comment", s);
+ if(s != null && s.length() > 0) o.set("#final-comment", s); //$NON-NLS-1$
}
private String applyNamespaceToAttribute(String xmlname) {
@@ -244,8 +250,8 @@
}
if(namespace == null || namespace.length() == 0) return xmlname;
if(xmlname.indexOf(':') > 0 || xmlname.indexOf('.') >= 0 || xmlname.indexOf('#') >= 0) return xmlname;
- if(xmlname.equals("xmlns")) {
- return xmlname + ":" + namespace;
+ if(xmlname.equals("xmlns")) { //$NON-NLS-1$
+ return xmlname + ":" + namespace; //$NON-NLS-1$
}
return xmlname;
}
@@ -255,7 +261,7 @@
xmlname = namespaceMapping.convertToActual(xmlname);
}
if(namespace != null && namespace.length() > 0) {
- return namespace + ":" + xmlname;
+ return namespace + ":" + xmlname; //$NON-NLS-1$
}
return xmlname;
}
@@ -266,9 +272,9 @@
}
public String getAttribute(Element element, String xmlname, XAttribute attr) {
- if (xmlname.equals("CDATA") || xmlname.equals("#text")) {
+ if (xmlname.equals("CDATA") || xmlname.equals("#text")) { //$NON-NLS-1$ //$NON-NLS-2$
return getCDATA(element, attr == null || attr.isTrimmable());
- } else if (xmlname.equals("#comment")) {
+ } else if (xmlname.equals("#comment")) { //$NON-NLS-1$
return getComment(element);
} else {
int ind = xmlname.indexOf('.');
@@ -278,7 +284,7 @@
childName = namespaceMapping.convertToActual(childName);
}
if(namespace != null && namespace.length() > 0 && childName.indexOf(':') < 0) {
- childName = namespace + ":" + childName;
+ childName = namespace + ":" + childName; //$NON-NLS-1$
}
Element child = XMLUtil.getFirstChild(element, childName);
if (child != null) return getAttribute(child, xmlname.substring(ind+1), attr);
@@ -302,7 +308,7 @@
if(n.getNodeType() != Node.ELEMENT_NODE) continue;
Element e = (Element)n;
String en = getChildEntity(entity, e);
- if(en == null && entity.getChild("AnyElement") != null) en = "AnyElement";
+ if(en == null && entity.getChild("AnyElement") != null) en = "AnyElement"; //$NON-NLS-1$ //$NON-NLS-2$
if(en == null) continue;
XModelObject co = model.createModelObject(en, null);
if(co == null) continue;
@@ -312,7 +318,7 @@
int k = 1;
String pp = co.getPathPart();
while(o.getChildByPath(pp) != null) {
- co.setAttributeValue(ATTR_ID_NAME, "" + k);
+ co.setAttributeValue(ATTR_ID_NAME, "" + k); //$NON-NLS-1$
String ppn = co.getPathPart();
if(ppn.equals(pp)) break;
pp = ppn;
@@ -323,7 +329,7 @@
XModelObject q = o.getChildByPath(co.getPathPart());
if(q != null) EnginesLoader.merge(q, co, false);
} catch (XModelException exc) {
- ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:loadChildren:" + exc.getMessage(), exc);
+ ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:loadChildren:" + exc.getMessage(), exc); //$NON-NLS-1$
}
continue;
}
@@ -353,7 +359,7 @@
if(namespaceMapping != null) {
n = namespaceMapping.convertToDefault(n);
}
- if(namespace != null && namespace.length() > 0 && n.startsWith(namespace + ":")) {
+ if(namespace != null && namespace.length() > 0 && n.startsWith(namespace + ":")) { //$NON-NLS-1$
n = n.substring(namespace.length() + 1);
}
en = entity.getChildByXML(n);
@@ -402,7 +408,7 @@
}
public boolean save(Element parent, XModelObject o) {
- if("AnyElement".equals(o.getModelEntity().getName())) {
+ if("AnyElement".equals(o.getModelEntity().getName())) { //$NON-NLS-1$
saveAnyElement(parent, o);
return true;
} else {
@@ -412,7 +418,7 @@
xmlname = namespaceMapping.convertToActual(xmlname);
}
if(namespace != null && namespace.length() > 0) {
- xmlname = namespace + ":" + xmlname;
+ xmlname = namespace + ":" + xmlname; //$NON-NLS-1$
}
Element element = XMLUtil.createElement(parent, xmlname);
saveAttributes(element, o);
@@ -457,11 +463,11 @@
}
public void saveAttribute(Element element, String xmlname, String value) {
- if (xmlname.equals("CDATA")) {
+ if (xmlname.equals("CDATA")) { //$NON-NLS-1$
setCDATA(element, value);
- } else if (xmlname.equals("#text")) {
+ } else if (xmlname.equals("#text")) { //$NON-NLS-1$
setText(element, value);
- } else if (xmlname.equals("#comment")) {
+ } else if (xmlname.equals("#comment")) { //$NON-NLS-1$
setComment(element, value);
} else {
int ind = xmlname.indexOf('.');
@@ -471,7 +477,7 @@
childName = namespaceMapping.convertToActual(childName);
}
if(namespace != null && namespace.length() > 0 && childName.indexOf(':') < 0) {
- childName = namespace + ":" + childName;
+ childName = namespace + ":" + childName; //$NON-NLS-1$
}
Element child = XMLUtil.getFirstChild(element, childName);
if (child == null) child = XMLUtil.createElement(element, childName);
@@ -490,7 +496,7 @@
}
public void saveFinalComment(Element element, XModelObject o) {
- String data = o.get("#final-comment");
+ String data = o.get("#final-comment"); //$NON-NLS-1$
if(data == null || data.length() == 0) return;
Comment comm = element.getOwnerDocument().createComment(data);
element.appendChild(comm);
@@ -533,7 +539,7 @@
if(body == null || body.length() == 0) return null; //"UTF-8"
String encoding = FileUtil.getEncoding(body);
if(encoding == null) return null; //"UTF-8"
- return FileUtil.validateEncoding(encoding, "UTF-8");
+ return FileUtil.validateEncoding(encoding, "UTF-8"); //$NON-NLS-1$
}
public static OutputFormat createOutputFormat(String encoding) {
@@ -542,7 +548,7 @@
public static final boolean serialize(Element element, Writer w) throws IOException {
if(element == null) return false;
- serialize(element, new XMLSerializer(w, createOutputFormat("UTF-8")));
+ serialize(element, new XMLSerializer(w, createOutputFormat("UTF-8"))); //$NON-NLS-1$
w.close();
return true;
}
@@ -553,7 +559,7 @@
public static final boolean serialize(Element element, OutputStream w) throws IOException {
if(element == null) return false;
- serialize(element, new XMLSerializer(w, createOutputFormat("UTF-8")));
+ serialize(element, new XMLSerializer(w, createOutputFormat("UTF-8"))); //$NON-NLS-1$
w.close();
return true;
}
@@ -594,8 +600,8 @@
} catch (IOException e2) {
e = e2;
}
- ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:asString:" + e.getMessage(), e);
- return "";
+ ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:asString:" + e.getMessage(), e); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
}
public static final String getCDATA(Element elem) {
@@ -616,7 +622,7 @@
public static final String getFinalComment(Element elem) {
StringBuffer sb = new StringBuffer();
NodeList nl = elem.getChildNodes();
- if(nl == null || nl.getLength() == 0) return "";
+ if(nl == null || nl.getLength() == 0) return ""; //$NON-NLS-1$
Node node = nl.item(nl.getLength() - 1);
loadComment(sb, node);
return sb.toString();
@@ -638,17 +644,17 @@
}
public static final void setCDATA(Element element, String data) {
- if (data == null) data = "";
+ if (data == null) data = ""; //$NON-NLS-1$
element.appendChild(element.getOwnerDocument().createCDATASection(data));
}
public static final void setText(Element element, String data) {
- if (data == null) data = "";
+ if (data == null) data = ""; //$NON-NLS-1$
element.appendChild(element.getOwnerDocument().createTextNode(data));
}
public static final void setComment(Element element, String data) {
- if (data == null) data = "";
+ if (data == null) data = ""; //$NON-NLS-1$
Comment comm = element.getOwnerDocument().createComment(data);
element.getParentNode().insertBefore(comm, element);
}
@@ -673,7 +679,7 @@
e = e2;
}
if(e != null) {
- ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:save(f,o):" + e.getMessage(), e);
+ ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:save(f,o):" + e.getMessage(), e); //$NON-NLS-1$
return false;
}
String r = w.toString();
@@ -709,12 +715,12 @@
}
public static String getReadOnlyMessage(File f) {
- return "Cannot save to read-only file " + f.getAbsolutePath() + ".";
+ return MessageFormat.format("Cannot save to read-only file {0}.", f.getAbsolutePath());
}
public static String getTempBody(XModelObject o) {
String b = o.get(XModelObjectConstants.ATTR_NAME__BODY_);
- o.set(XModelObjectConstants.ATTR_NAME__BODY_, "");
+ o.set(XModelObjectConstants.ATTR_NAME__BODY_, ""); //$NON-NLS-1$
return b;
}
@@ -729,7 +735,7 @@
}
public static String readFile(String filename) {
- if(filename == null) return "";
+ if(filename == null) return ""; //$NON-NLS-1$
return readFile(new File(expandString(filename)));
}
@@ -765,7 +771,7 @@
public static final String getResourcePath(XModelObject object) {
int t = object.getFileType();
- if(t == XFileObject.SYSTEM) return "";
+ if(t == XFileObject.SYSTEM) return ""; //$NON-NLS-1$
XModelObject p = object.getParent();
if(p == null) return null;
String n = (t == XFileObject.FOLDER) ? object.get(XModelObjectConstants.XML_ATTR_NAME) :
@@ -834,7 +840,7 @@
}
protected void loadAnyElement(Element element, XModelObject o) {
- o.setAttributeValue("tag", element.getTagName());
+ o.setAttributeValue("tag", element.getTagName()); //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
NamedNodeMap as = element.getAttributes();
for (int i = 0; i < as.getLength(); i++) {
@@ -842,28 +848,28 @@
String nm = n.getNodeName();
String v = n.getNodeValue();
if(v == null) continue;
- if(sb.length() > 0) sb.append(";");
- sb.append(nm).append("=").append(v);
+ if(sb.length() > 0) sb.append(";"); //$NON-NLS-1$
+ sb.append(nm).append("=").append(v); //$NON-NLS-1$
}
- o.setAttributeValue("attributes", sb.toString());
- String text = getAttribute(element, "#text").trim();
+ o.setAttributeValue("attributes", sb.toString()); //$NON-NLS-1$
+ String text = getAttribute(element, "#text").trim(); //$NON-NLS-1$
if(text.length() > 0) {
- while(text.startsWith("\n") || text.startsWith("\r")) text = text.substring(1);
- while(text.endsWith("\n") || text.endsWith("\r")) text = text.substring(0, text.length() - 1);
- o.setAttributeValue("text", text);
+ while(text.startsWith("\n") || text.startsWith("\r")) text = text.substring(1); //$NON-NLS-1$ //$NON-NLS-2$
+ while(text.endsWith("\n") || text.endsWith("\r")) text = text.substring(0, text.length() - 1); //$NON-NLS-1$ //$NON-NLS-2$
+ o.setAttributeValue("text", text); //$NON-NLS-1$
}
loadChildren(element, o);
}
protected void saveAnyElement(Element parent, XModelObject o) {
- String xmlname = o.getAttributeValue("tag");
+ String xmlname = o.getAttributeValue("tag"); //$NON-NLS-1$
if(xmlname == null || xmlname.trim().length() == 0) return;
if(namespace != null && namespace.length() > 0) {
- xmlname = namespace + ":" + xmlname;
+ xmlname = namespace + ":" + xmlname; //$NON-NLS-1$
}
Element element = XMLUtil.createElement(parent, xmlname);
- String attrs = o.getAttributeValue("attributes");
- StringTokenizer st = new StringTokenizer(attrs, ";");
+ String attrs = o.getAttributeValue("attributes"); //$NON-NLS-1$
+ StringTokenizer st = new StringTokenizer(attrs, ";"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
String t = st.nextToken();
int i = t.indexOf('=');
@@ -872,9 +878,9 @@
String v = t.substring(i + 1);
element.setAttribute(n, v);
}
- String text = o.getAttributeValue("text");
+ String text = o.getAttributeValue("text"); //$NON-NLS-1$
if(text != null && text.length() > 0) {
- saveAttribute(element, "#text", text);
+ saveAttribute(element, "#text", text); //$NON-NLS-1$
}
XModelObject[] cs = o.getChildren();
for (int i = 0; i < cs.length; i++) {
@@ -894,21 +900,21 @@
xmlname = namespaceMapping.convertToActual(xmlname);
}
if(namespace != null && namespace.length() > 0 && xmlname.indexOf(':') < 0) {
- xmlname = namespace + ":" + xmlname;
+ xmlname = namespace + ":" + xmlname; //$NON-NLS-1$
}
for (int i = 0; i < ns.length; i++) {
Element c = XMLUtil.createElement(element, xmlname);
- saveAttribute(c, "#text", ns[i]);
+ saveAttribute(c, "#text", ns[i]); //$NON-NLS-1$
}
}
protected String loadArray(Element element, String xmlname) {
Element[] es = XMLUtil.getChildren(element, xmlname);
- if(es == null || es.length == 0) return "";
+ if(es == null || es.length == 0) return ""; //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
for (int i = 0; i < es.length; i++) {
- if(i > 0) sb.append(",");
- sb.append(getAttribute(es[i], "#text"));
+ if(i > 0) sb.append(","); //$NON-NLS-1$
+ sb.append(getAttribute(es[i], "#text")); //$NON-NLS-1$
}
return sb.toString();
}
@@ -941,14 +947,14 @@
}
private static String getAttributeCommentName(String xmlname) {
- if(xmlname != null && xmlname.indexOf('.') > 0 && !xmlname.endsWith("#comment")) {
- return xmlname + ".#comment";
+ if(xmlname != null && xmlname.indexOf('.') > 0 && !xmlname.endsWith("#comment")) { //$NON-NLS-1$
+ return xmlname + ".#comment"; //$NON-NLS-1$
}
return null;
}
public static void mergeFinalComment(XModelObject destination, XModelObject source, boolean fire) {
- String commentName = "#final-comment";
+ String commentName = "#final-comment"; //$NON-NLS-1$
mergeComment(destination, source, commentName, fire);
}
@@ -959,7 +965,7 @@
String set = null;
if(newComment == null || newComment.length() == 0) {
if(oldComment != null && oldComment.length() > 0) {
- set = "";
+ set = ""; //$NON-NLS-1$
}
} else {
if(oldComment == null || !oldComment.equals(newComment)) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -57,7 +57,7 @@
String[][] res = new String[sx.length][];
for (int i = 0; i < sx.length; i++) {
int d = sx[i].indexOf(' ');
- res[i] = (d < 0) ? new String[]{"", sx[i]}
+ res[i] = (d < 0) ? new String[]{"", sx[i]} //$NON-NLS-1$
: new String[]{sx[i].substring(0, d), sx[i].substring(d + 1).trim()};
}
return res;
@@ -93,11 +93,11 @@
if(v == null && model != null) {
int d = q.lastIndexOf('.');
String op = (d < 0) ? q : q.substring(0, d);
- String oa = (d < 0) ? "value" : q.substring(d + 1);
+ String oa = (d < 0) ? "value" : q.substring(d + 1); //$NON-NLS-1$
XModelObject o = model.getByPath(op);
v = (o == null) ? null : o.getAttributeValue(oa);
}
- v = (v == null) ? "" : expand(v, model, context, found);
+ v = (v == null) ? "" : expand(v, model, context, found); //$NON-NLS-1$
found.setProperty(q, v);
}
result.append(v);
@@ -106,17 +106,17 @@
}
public static Properties toProperties(XModelObject fs) {
- return toProperties(fs.getAttributeValue("info"));
+ return toProperties(fs.getAttributeValue("info")); //$NON-NLS-1$
}
public static Properties toProperties(String s) {
Properties props = new Properties();
- StringTokenizer st = new StringTokenizer(s, ",");
+ StringTokenizer st = new StringTokenizer(s, ","); //$NON-NLS-1$
while (st.hasMoreElements()) {
String t = st.nextToken();
int i = t.indexOf('=');
if (i < 0) {
- props.setProperty(t, "");
+ props.setProperty(t, ""); //$NON-NLS-1$
} else {
String n = t.substring(0, i).trim();
String v = t.substring(i + 1).trim();
@@ -128,10 +128,10 @@
public static String toString(Properties props) {
Iterator it = props.entrySet().iterator();
- String s = "";
+ String s = ""; //$NON-NLS-1$
while (it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
- s += (s.length() > 0 ? "," : "") + entry.getKey() + "=" + entry.getValue();
+ s += (s.length() > 0 ? "," : "") + entry.getKey() + "=" + entry.getValue(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return s;
}
@@ -140,9 +140,9 @@
XModelObject f = object;
while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
if(f == null) return null;
- String r = f.getAttributeValue("publicId");
+ String r = f.getAttributeValue("publicId"); //$NON-NLS-1$
if(r != null) return r;
- r = f.getAttributeValue("xsi:schemaLocation");
+ r = f.getAttributeValue("xsi:schemaLocation"); //$NON-NLS-1$
return r;
}
@@ -152,8 +152,8 @@
if(tag == null || tag.length() == 0) tag = attribute.getModelEntity().getName();
String attr = attribute.getXMLName();
if(attr == null || attr.length() == 0) attr = attribute.getName();
- int t = attr.indexOf("#text");
- if(t >= 0) attr = attr.substring(0, t) + "text()[1]";
+ int t = attr.indexOf("#text"); //$NON-NLS-1$
+ if(t >= 0) attr = attr.substring(0, t) + "text()[1]"; //$NON-NLS-1$
String path = tag.replace('.', '/') + '/' + attr.replace('.', '/');
while(path.lastIndexOf('/') != path.indexOf('/')) path = path.substring(path.indexOf('/') + 1);
if (t<0) path = path.replace('/','@');
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.util.extension;
+import java.text.MessageFormat;
import org.eclipse.core.runtime.*;
import org.jboss.tools.common.model.XModelException;
@@ -23,11 +24,15 @@
public static Object findClassByElementId(IExtensionPoint point, String id) throws CoreException {
IConfigurationElement element = getElementById(point, id);
if(element == null)
- throw new XModelException("Configuration element with id=" + id + " is not found");
- String className = element.getAttribute("class");
+ throw new XModelException(MessageFormat.format("Configuration element with id={0} is not found",
+ id));
+ String className = element.getAttribute("class"); //$NON-NLS-1$
if(className == null || className.length() == 0)
- throw new XModelException("Configuration element with id=" + id + " does not define 'class' attribute");
- return element.createExecutableExtension("class");
+ throw new XModelException(MessageFormat
+ .format(
+ "Configuration element with id={0} does not define ''class'' attribute",
+ id));
+ return element.createExecutableExtension("class"); //$NON-NLS-1$
}
private static IConfigurationElement getElementById(IExtensionPoint point, String id) {
@@ -41,7 +46,7 @@
private static IConfigurationElement getElementById(IConfigurationElement[] elements, String id) {
for (int i = 0; i < elements.length; i++)
- if(id.equals(elements[i].getAttribute("id"))) return elements[i];
+ if(id.equals(elements[i].getAttribute("id"))) return elements[i]; //$NON-NLS-1$
for (int i = 0; i < elements.length; i++) {
IConfigurationElement element = getElementById(elements[i].getChildren(), id);
if(element != null) return element;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/FilePathEncoderFactory.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -20,7 +20,7 @@
static {
try {
- jsfEncoder = (IFilePathEncoder)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jsf.model.helpers.pages.FilePathEncoder");
+ jsfEncoder = (IFilePathEncoder)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jsf.model.helpers.pages.FilePathEncoder"); //$NON-NLS-1$
} catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
}
@@ -29,7 +29,7 @@
public static IFilePathEncoder getEncoder(IProject project) {
if(project == null || !project.isOpen()) return null;
try {
- if(project.hasNature("org.jboss.tools.jsf.jsfnature")) return jsfEncoder;
+ if(project.hasNature("org.jboss.tools.jsf.jsfnature")) return jsfEncoder; //$NON-NLS-1$
} catch (CoreException e) {
//ignore - all checks are done above
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/IFilePathEncoder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/IFilePathEncoder.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/IFilePathEncoder.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -15,11 +15,11 @@
import org.jboss.tools.common.model.XModelObject;
public interface IFilePathEncoder {
- public static String PATH_TYPE = "pathType";
- public static String PATH_ADDITION = "pathAddition";
+ public static String PATH_TYPE = "pathType"; //$NON-NLS-1$
+ public static String PATH_ADDITION = "pathAddition"; //$NON-NLS-1$
- public static String ABSOLUTE_PATH = "absolute";
- public static String RELATIVE_PATH = "relative";
+ public static String ABSOLUTE_PATH = "absolute"; //$NON-NLS-1$
+ public static String RELATIVE_PATH = "relative"; //$NON-NLS-1$
/**
* Returns path that should be inserted to jsp page.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -14,36 +14,36 @@
import org.jboss.tools.common.model.*;
public class TLDToPaletteHelper {
- public static final String START_TEXT = "start text";
- public static final String END_TEXT = "end text";
- public static final String REFORMAT = "automatically reformat tag body";
- public static final String DESCRIPTION = "description";
+ public static final String START_TEXT = "start text"; //$NON-NLS-1$
+ public static final String END_TEXT = "end text"; //$NON-NLS-1$
+ public static final String REFORMAT = "automatically reformat tag body"; //$NON-NLS-1$
+ public static final String DESCRIPTION = "description"; //$NON-NLS-1$
public static final String URI = URIConstants.LIBRARY_URI;
public static final String DEFAULT_PREFIX = URIConstants.DEFAULT_PREFIX;
- public static final String ADD_TAGLIB = "add taglib";
+ public static final String ADD_TAGLIB = "add taglib"; //$NON-NLS-1$
public TLDToPaletteHelper() {}
public XModelObject createMacroByTag(XModelObject tag, XModel model) {
Properties p = new Properties();
String parentname = getTldName(tag.getParent());
- String prefix = (parentname.length() == 0) ? "" : parentname + ":";
+ String prefix = (parentname.length() == 0) ? "" : parentname + ":"; //$NON-NLS-1$ //$NON-NLS-2$
String shortname = tag.getAttributeValue(XModelObjectConstants.ATTR_NAME);
String name = prefix + shortname;
String tagname = shortname; ///name;
p.setProperty(XModelObjectConstants.ATTR_NAME, shortname);
- boolean empty = "empty".equals(tag.getAttributeValue("bodycontent"));
- if(!empty) p.setProperty(END_TEXT, "</" + tagname + ">");
+ boolean empty = "empty".equals(tag.getAttributeValue("bodycontent")); //$NON-NLS-1$ //$NON-NLS-2$
+ if(!empty) p.setProperty(END_TEXT, "</" + tagname + ">"); //$NON-NLS-1$ //$NON-NLS-2$
p.setProperty(START_TEXT, getStartText(tag, empty, tagname));
p.setProperty(DESCRIPTION, getTagDescription(tag, empty, name));
if(!empty) p.setProperty(REFORMAT, XModelObjectConstants.YES);
- return model.createModelObject("SharableMacroHTML", p);
+ return model.createModelObject("SharableMacroHTML", p); //$NON-NLS-1$
}
public static String getTldName(XModelObject tld) {
- if(tld == null) return "";
- String n = tld.getAttributeValue("shortname");
- if(n == null) return "";
+ if(tld == null) return ""; //$NON-NLS-1$
+ String n = tld.getAttributeValue("shortname"); //$NON-NLS-1$
+ if(n == null) return ""; //$NON-NLS-1$
if(n.length() == 0) {
n = tld.getAttributeValue(XModelObjectConstants.ATTR_NAME);
int q = n.lastIndexOf('-');
@@ -56,14 +56,14 @@
private String getStartText(XModelObject tag, boolean empty, String name) {
StringBuffer sb = new StringBuffer();
- sb.append("<").append(name);
+ sb.append("<").append(name); //$NON-NLS-1$
XModelObject[] as = tag.getChildren();
boolean found = false;
for (int i = 0; i < as.length; i++) {
if(!TLDUtil.isAttribute(as[i])) continue;
- String required = as[i].getAttributeValue("required");
+ String required = as[i].getAttributeValue("required"); //$NON-NLS-1$
if(!XModelObjectConstants.TRUE.equals(required) && !XModelObjectConstants.YES.equals(required)) continue;
- sb.append(' ').append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME)).append("=\"");
+ sb.append(' ').append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME)).append("=\""); //$NON-NLS-1$
if(!found) {
sb.append('|');
found = true;
@@ -71,7 +71,7 @@
sb.append('"');
}
if(empty) sb.append(XModelObjectConstants.SEPARATOR);
- sb.append(">");
+ sb.append(">"); //$NON-NLS-1$
return sb.toString();
}
@@ -79,25 +79,28 @@
// String info = TLDUtil.getTagDescription(tag);
StringBuffer sb = new StringBuffer();
sb.append("<b>Syntax:</b><br><code>");
- if (empty) sb.append("<").append(name).append(" />"); else sb.append("<").append(name).append("></code><br><code></").append(name).append(">");
+ if (empty)
+ sb.append("<").append(name).append(" />"); //$NON-NLS-1$ //$NON-NLS-2$
+ else
+ sb.append("<").append(name).append("></code><br><code></").append(name).append(">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
sb.append("</code><br><b>Attributes:</b><br><code>");
int k = 0;
XModelObject[] as = tag.getChildren();
for (int i = 0; i < as.length; i++) {
if(!TLDUtil.isAttribute(as[i])) continue;
if(!isRequired(as[i])) continue;
- sb.append("<b>").append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME)).append("</b>");
+ sb.append("<b>").append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME)).append("</b>"); //$NON-NLS-1$ //$NON-NLS-2$
++k;
- if(k < as.length) sb.append(", ");
+ if(k < as.length) sb.append(", "); //$NON-NLS-1$
}
for (int i = 0; i < as.length; i++) {
if(isRequired(as[i])) continue;
sb.append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
++k;
- if(k < as.length) sb.append(", ");
+ if(k < as.length) sb.append(", "); //$NON-NLS-1$
}
- sb.append("</code>");
+ sb.append("</code>"); //$NON-NLS-1$
/*
sb.append("<html>").append("\n ");
@@ -143,16 +146,16 @@
}
private boolean isRequired(XModelObject attr) {
- String required = attr.getAttributeValue("required");
+ String required = attr.getAttributeValue("required"); //$NON-NLS-1$
return (XModelObjectConstants.TRUE.equals(required) || XModelObjectConstants.YES.equals(required));
}
public XModelObject createTabByTLD(XModelObject tld, XModel model) {
- return createGroupByTLD(tld, model, "SharablePageTabHTML");
+ return createGroupByTLD(tld, model, "SharablePageTabHTML"); //$NON-NLS-1$
}
public XModelObject createGroupByTLD(XModelObject tld, XModel model) {
- return createGroupByTLD(tld, model, "SharableGroupHTML");
+ return createGroupByTLD(tld, model, "SharableGroupHTML"); //$NON-NLS-1$
}
private XModelObject createGroupByTLD(XModelObject tld, XModel model, String entity) {
@@ -160,7 +163,7 @@
p.setProperty(XModelObjectConstants.ATTR_NAME, capitalize(getTldName(tld)));
p.setProperty(DESCRIPTION, TLDUtil.getTagDescription(tld));
p.setProperty(DEFAULT_PREFIX, getTldName(tld));
- p.setProperty(URIConstants.LIBRARY_URI, "" + tld.getAttributeValue("uri"));
+ p.setProperty(URIConstants.LIBRARY_URI, "" + tld.getAttributeValue("uri")); //$NON-NLS-1$ //$NON-NLS-2$
XModelObject tab = model.createModelObject(entity, p);
XModelObject[] tags = tld.getChildren();
for (int i = 0; i < tags.length; i++)
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDUtil.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDUtil.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -13,9 +13,9 @@
import org.jboss.tools.common.model.*;
public class TLDUtil {
- static String FILE_ENTITIES = ".FileTLD_PRO.FileTLD_1_2.FileTLD_2_0.FileTLD_2_1.";
- static String TAG_ENTITIES = ".TLDTag.TLDTag12.TLDTag21.";
- static String ATTR_ENTITIES = ".TLDAttribute.TLDAttribute12.";
+ static String FILE_ENTITIES = ".FileTLD_PRO.FileTLD_1_2.FileTLD_2_0.FileTLD_2_1."; //$NON-NLS-1$
+ static String TAG_ENTITIES = ".TLDTag.TLDTag12.TLDTag21."; //$NON-NLS-1$
+ static String ATTR_ENTITIES = ".TLDAttribute.TLDAttribute12."; //$NON-NLS-1$
public static boolean isTaglib(XModelObject o) {
return isOfEntity(o, FILE_ENTITIES);
@@ -30,18 +30,18 @@
}
private static boolean isOfEntity(XModelObject o, String entities) {
- return entities.indexOf("." + o.getModelEntity().getName() + ".") >= 0;
+ return entities.indexOf("." + o.getModelEntity().getName() + ".") >= 0; //$NON-NLS-1$//$NON-NLS-2$
}
public static String getTagDescription(XModelObject o) {
- String attr = (o.getModelEntity().getAttribute("info") != null) ? "info" : "description";
+ String attr = (o.getModelEntity().getAttribute("info") != null) ? "info" : "description"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String s = o.getAttributeValue(attr);
- s = (s == null) ? "" : s.trim();
+ s = (s == null) ? "" : s.trim(); //$NON-NLS-1$
StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if(c == '<') sb.append("<");
- else if(c == '>') sb.append(">");
+ if(c == '<') sb.append("<"); //$NON-NLS-1$
+ else if(c == '>') sb.append(">"); //$NON-NLS-1$
else sb.append(c);
}
return sb.toString();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/URIConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/URIConstants.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/URIConstants.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -11,7 +11,7 @@
package org.jboss.tools.jst.web.tld;
public interface URIConstants {
- public String LIBRARY_URI = "library uri";
- public String LIBRARY_VERSION = "library version";
- public String DEFAULT_PREFIX = "default prefix";
+ public String LIBRARY_URI = "library uri"; //$NON-NLS-1$
+ public String LIBRARY_VERSION = "library version"; //$NON-NLS-1$
+ public String DEFAULT_PREFIX = "default prefix"; //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java 2009-06-29 06:39:19 UTC (rev 16236)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java 2009-06-29 06:41:57 UTC (rev 16237)
@@ -17,7 +17,7 @@
public static IWebProjectFactory instance = null;
static {
try {
- instance = (IWebProjectFactory)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.tld.WebProjectFactoryImpl");
+ instance = (IWebProjectFactory)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.tld.WebProjectFactoryImpl"); //$NON-NLS-1$
} catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
}
15 years, 5 months
JBoss Tools SVN: r16235 - in workspace/yzhishko: org.jboss.tools.jsf.ui.auto.test and 24 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-06-29 02:38:22 -0400 (Mon, 29 Jun 2009)
New Revision: 16235
Added:
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.classpath
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.project
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.settings/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/META-INF/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/META-INF/MANIFEST.MF
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/log4j.xml
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/Activator.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.class
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/test.xml
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/build.properties
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/resources/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/resources/test.xml
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testCreateNewCSSFile.jpeg
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfFirstClass.jpeg
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfSecondClass.jpeg
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testValidateCSSFile.jpeg
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3890Test.testOpenVPE.jpeg
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/log4j.xml
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/Activator.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.java
Log:
UI tests for JSF
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.classpath
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.classpath (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.classpath 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.project
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.project (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.project 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jsf.ui.auto.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/.settings/org.eclipse.jdt.core.prefs 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,8 @@
+#Tue Jun 23 15:36:31 EEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/META-INF/MANIFEST.MF 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Auto
+Bundle-SymbolicName: org.jboss.tools.jsf.ui.auto.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.jsf.ui.auto.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.jboss.tools.ui.auto.test,
+ org.jboss.tools.vpe.ui.auto.test
+Export-Package: org.jboss.tools.jsf.ui.auto.test
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/log4j.xml 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/Activator.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.class
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/test.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/test.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/bin/test.xml 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,28 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+<TR>
+<TD>
+<DIV>
+<H3 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Hello
+</SPAN>
+<SPAN CLASS="vpe-text">
+,
+</SPAN>
+<SPAN CLASS="vpe-text">
+#{user.name}
+</SPAN>
+<SPAN CLASS="vpe-text">
+!
+</SPAN>
+</H3>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/build.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/build.properties (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/build.properties 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,4 @@
+source.. = src/,resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/resources/test.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/resources/test.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/resources/test.xml 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,28 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+<TR>
+<TD>
+<DIV>
+<H3 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Hello
+</SPAN>
+<SPAN CLASS="vpe-text">
+,
+</SPAN>
+<SPAN CLASS="vpe-text">
+#{user.name}
+</SPAN>
+<SPAN CLASS="vpe-text">
+!
+</SPAN>
+</H3>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testCreateNewCSSFile.jpeg
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testCreateNewCSSFile.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfFirstClass.jpeg
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfFirstClass.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfSecondClass.jpeg
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testEditAttrsOfSecondClass.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testValidateCSSFile.jpeg
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3148and4441Test.testValidateCSSFile.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3890Test.testOpenVPE.jpeg
===================================================================
(Binary files differ)
Property changes on: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/screenshots/screenshot-JBIDE3890Test.testOpenVPE.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/log4j.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/log4j.xml 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/Activator.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/Activator.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/Activator.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,50 @@
+package org.jboss.tools.jsf.ui.auto.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jsf.ui.auto.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/CSSDialogJBIDETests.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,33 @@
+package org.jboss.tools.jsf.ui.auto.test;
+
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE3148and4441Test;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE3577Test;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE3579Test;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE3890Test;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE3920Test;
+import org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide.JBIDE4391Test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+
+/**
+ *
+ * This is a sample swtbot testcase for an eclipse application.
+ *
+ */
+public class CSSDialogJBIDETests extends SWTBotTestCase{
+ public static Test suite(){
+ TestSuite suite = new TestSuite("CSS dialog JBIDE tests");
+ suite.addTestSuite(JBIDE3148and4441Test.class);
+ suite.addTestSuite(JBIDE4391Test.class);
+ suite.addTestSuite(JBIDE3577Test.class);
+ suite.addTestSuite(JBIDE3579Test.class);
+ suite.addTestSuite(JBIDE3920Test.class);
+ suite.addTestSuite(JBIDE3890Test.class);
+ return new TestSetup(suite);
+ }
+}
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/JSFAutoTestCase.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,13 @@
+package org.jboss.tools.jsf.ui.auto.test;
+
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.vpe.ui.auto.test.VPEAutoTestCase;
+
+public class JSFAutoTestCase extends VPEAutoTestCase{
+
+ @Override
+ protected String getPathToResources() {
+ return Platform.getBundle(Activator.PLUGIN_ID).getLocation()+"resources/";
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3148and4441Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,68 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE3148and4441Test extends JSFAutoTestCase{
+
+ private static String CSS_FILE_NAME = "JBIDE3148";
+ private static String CSS_CLASS_NAME = "cssclass";
+
+ public void testCreateNewCSSFile(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
+ getNode(CSS_FILE_NAME+".css").doubleClick();
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ } catch (WidgetNotFoundException e) {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
+ bot.menu("File").menu("New").menu("CSS File").click();
+ bot.shell("New CSS File").activate();
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
+ bot.button("Finish").click();
+ }
+ SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ eclipseEditor.setFocus();
+ eclipseEditor.insertText("\rcssclass{\r\tcolor:green;\r\t" +
+ "background-color:red;\r}");
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
+ "background-color:green;\r}");
+ eclipseEditor.save();
+ eclipseEditor.contextMenu("Open CSS Dialog").click();
+ }
+
+ public void testEditAttrsOfFirstClass(){
+ bot.shell("CSS Class").activate();
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
+ bot.tabItem("Text/Font").activate();
+ bot.comboBoxWithLabel("Text Decoration:").setSelection("underline");
+ bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
+ }
+
+ public void testEditAttrsOfSecondClass(){
+ bot.shell("CSS Class").activate();
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME+"(2)");
+ bot.tabItem("Text/Font").activate();
+ bot.comboBoxWithLabel("Text Decoration:").setSelection("overline");
+ bot.comboBoxWithLabel("Font Weight:").setSelection("lighter");
+ bot.button("Apply").click();
+ bot.button("OK").click();
+ }
+
+ public void testValidateCSSFile(){
+ String fileContainer = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText();
+ assertEquals("cssclass{\r\tcolor: red;\r\tbackground-color: green;\r" +
+ "\tfont-weight: bold;\r\ttext-decoration: underline\r}\rcssclass" +
+ "{\r\tcolor: green;\r\tbackground-color: red;\r" +
+ "\tfont-weight: lighter;\r\ttext-decoration: overline\r}", fileContainer);
+ bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3577Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,50 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE3577Test extends JSFAutoTestCase{
+
+ private static String CSS_FILE_NAME = "JBIDE3577";
+ private static String CSS_CLASS_NAME = "cssclass";
+
+ public void testCreateNewCSSFile(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
+ getNode(CSS_FILE_NAME+".css").doubleClick();
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ } catch (WidgetNotFoundException e) {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
+ bot.menu("File").menu("New").menu("CSS File").click();
+ bot.shell("New CSS File").activate();
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
+ bot.button("Finish").click();
+ }
+ SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ eclipseEditor.setFocus();
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
+ "background-color:green;\r}");
+ eclipseEditor.save();
+ eclipseEditor.contextMenu("Open CSS Dialog").click();
+ }
+
+ public void testClearAttrs(){
+ bot.shell("CSS Class").activate();
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
+ bot.tabItem("Preview").activate();
+ bot.button("Clear").click();
+ bot.button("Apply").click();
+ bot.button("OK").click();
+ assertEquals("cssclass{\r\t\r}", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText());
+ bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3579Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,50 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE3579Test extends JSFAutoTestCase{
+
+ private static String CSS_FILE_NAME = "JBIDE3579";
+ private static String CSS_CLASS_NAME = "newCSSclass";
+
+ public void testCreateNewCSSFile(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
+ getNode(CSS_FILE_NAME+".css").doubleClick();
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ } catch (WidgetNotFoundException e) {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
+ bot.menu("File").menu("New").menu("CSS File").click();
+ bot.shell("New CSS File").activate();
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
+ bot.button("Finish").click();
+ }
+ SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ eclipseEditor.setFocus();
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
+ "background-color:green;\r}");
+ eclipseEditor.save();
+ eclipseEditor.contextMenu("Open CSS Dialog").click();
+ }
+
+ public void testCreateNewCSSClass(){
+ bot.shell("CSS Class").activate();
+ bot.button("Add CSS Class").click();
+ bot.shell("Enter New CSS Class Name").activate();
+ bot.textWithLabel("Enter New CSS Class Name").setText(CSS_CLASS_NAME);
+ bot.button("OK").click();
+ bot.button("Apply").click();
+ bot.button("OK").click();
+ bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3890Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,35 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.SWTBotMultiPageEditor;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE3890Test extends JSFAutoTestCase{
+
+ public void testOpenVPE() throws Throwable{
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ try {
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ SWTBotEclipseEditor editor = bot.editorByTitle("hello.jsp").toTextEditor();
+ editor.selectLine(10);
+ editor.insertText("<body id=\"bodyId\">");
+ delay();
+ editor.save();
+ SWTBotMultiPageEditor multiPageEditor = bot.multiPageEditorByTitle("hello.jsp");
+ performContentTest("test.xml", multiPageEditor);
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE3920Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,44 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE3920Test extends JSFAutoTestCase{
+
+ private static String CSS_FILE_NAME = "JBIDE3920";
+ private static String CSS_CLASS_NAME = "cssclass";
+
+ public void testCreateNewCSSClass(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
+ getNode(CSS_FILE_NAME+".css").doubleClick();
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ } catch (WidgetNotFoundException e) {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
+ bot.menu("File").menu("New").menu("CSS File").click();
+ bot.shell("New CSS File").activate();
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
+ bot.button("Finish").click();
+ }
+ SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ eclipseEditor.setFocus();
+ eclipseEditor.insertText(CSS_CLASS_NAME+"{");
+ eclipseEditor.save();
+ eclipseEditor.contextMenu("Open CSS Dialog").click();
+ bot.shell("CSS Class").activate();
+ bot.tabItem("Text/Font").activate();
+ bot.comboBoxWithLabel("Font Style:").setSelection("italic");
+ bot.comboBoxWithLabel("Text Decoration:").setSelection("underline");
+ bot.button("OK").click();
+ bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().close();
+ }
+
+}
Added: workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.auto.test/src/org/jboss/tools/jsf/ui/auto/test/cssdialog/jbide/JBIDE4391Test.java 2009-06-29 06:38:22 UTC (rev 16235)
@@ -0,0 +1,51 @@
+package org.jboss.tools.jsf.ui.auto.test.cssdialog.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jsf.ui.auto.test.JSFAutoTestCase;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+
+public class JBIDE4391Test extends JSFAutoTestCase{
+
+ private static String CSS_FILE_NAME = "JBIDE4391";
+ private static String CSS_CLASS_NAME = "cssclass";
+
+ public void testCreateNewCSSFile(){
+ SWTBot innerBot= bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
+ getNode(CSS_FILE_NAME+".css").doubleClick();
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ } catch (WidgetNotFoundException e) {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
+ bot.menu("File").menu("New").menu("CSS File").click();
+ bot.shell("New CSS File").activate();
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
+ bot.button("Finish").click();
+ }
+ SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ eclipseEditor.setFocus();
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
+ "background-color:green;\r}");
+ eclipseEditor.save();
+ eclipseEditor.contextMenu("Open CSS Dialog").click();
+ }
+
+ public void testIncorrectAttr(){
+ bot.shell("CSS Class").activate();
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
+ bot.tabItem("Text/Font").activate();
+ bot.comboBoxWithLabel("Text Decoration:").setText(";;;;");
+ bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
+ bot.button("Cancel").click();
+ assertEquals("cssclass{\r\tcolor:red;\r\t" +
+ "background-color:green;\r}", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText());
+ bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ }
+
+}
15 years, 5 months