JBoss Tools SVN: r15226 - trunk/jst/plugins/org.jboss.tools.jst.web/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 07:35:17 -0400 (Tue, 12 May 2009)
New Revision: 15226
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-12 10:54:15 UTC (rev 15225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-12 11:35:17 UTC (rev 15226)
@@ -66,6 +66,5 @@
org.jboss.tools.jst.web.tld.model,
org.jboss.tools.jst.web.tld.model.handlers,
org.jboss.tools.jst.web.tld.model.helpers,
- org.jboss.tools.jst.web.tomcat,
org.jboss.tools.jst.web.webapp.model,
org.jboss.tools.jst.web.webapp.model.handlers
15 years, 5 months
JBoss Tools SVN: r15225 - in trunk/jst/plugins/org.jboss.tools.jst.web: resources/meta and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:54:15 -0400 (Tue, 12 May 2009)
New Revision: 15225
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:54:15 UTC (rev 15225)
@@ -191,8 +191,8 @@
class="org.jboss.tools.jst.web.tld.model.handlers.PaletteAdopt"/>
<xclass id="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"
class="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"/>
- <xclass id="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
- class="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"/>
+ <xclass id="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
+ class="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"/>
<xclass id="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"
class="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"/>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12 10:54:15 UTC (rev 15225)
@@ -334,7 +334,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -490,7 +490,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12 10:54:15 UTC (rev 15225)
@@ -349,7 +349,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -523,7 +523,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
@@ -822,7 +822,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -996,7 +996,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.model.handlers;
+
+import java.util.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.impl.*;
+import org.jboss.tools.common.meta.action.impl.*;
+
+public class ResetFileDateHandler extends AbstractHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ return (object != null && getParentFolder(object) != null);
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ FolderImpl f = getParentFolder(object);
+ if(f != null) f.changeChildTimeStamp(object);
+ }
+
+ private FolderImpl getParentFolder(XModelObject o) {
+ XModelObject p = o.getParent();
+ if(!(p instanceof FolderImpl)) return null;
+ return (FolderImpl)p;
+ }
+
+}
+
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.filesystems.impl.*;
-import org.jboss.tools.common.meta.action.impl.*;
-
-public class ResetFileDateHandler extends AbstractHandler {
-
- public boolean isEnabled(XModelObject object) {
- return (object != null && getParentFolder(object) != null);
- }
-
- public void executeHandler(XModelObject object, Properties p) throws XModelException {
- FolderImpl f = getParentFolder(object);
- if(f != null) f.changeChildTimeStamp(object);
- }
-
- private FolderImpl getParentFolder(XModelObject o) {
- XModelObject p = o.getParent();
- if(!(p instanceof FolderImpl)) return null;
- return (FolderImpl)p;
- }
-
-}
-
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.impl.handlers.*;
-import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
-
-public class ResetWebAppDateHandler extends DefaultRedirectHandler {
-
- protected XModelObject getTrueSource(XModelObject source) {
- return WebAppHelper.getWebApp(source.getModel());
- }
-
-}
-
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.icons.impl.*;
-import org.jboss.tools.jst.web.WebModelPlugin;
-
-public class TomcatStateIcon implements ImageComponent {
-
- public TomcatStateIcon() {}
-
- public int getHash(XModelObject obj) {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- return (b) ? 72618 : 37156;
- }
-
- public Image getImage(XModelObject obj) {
- try {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- String s = (b) ? "struts.tomcat.running" : "struts.tomcat.stopped";
- return obj.getModelEntity().getMetaModel().getIconList().getImage(s, "default.unknown");
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- return null;
- }
- }
-
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.io.File;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.launching.*;
-import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.options.Preference;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.jst.web.*;
-
-public class TomcatVMHelper {
-
- static String TOOLS_JAR_SUFFIX = File.separator + "lib" + File.separator + "tools.jar";
-
- public static String findToolsJarInVM(String jvmPath) {
- if(jvmPath == null) return null;
- File jvmFile = new File(jvmPath);
- if(!jvmFile.exists()) return null;
- String path = jvmPath + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- path = jvmFile.getParent() + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- return null;
- }
-
- public static String createVM(String path) throws XModelException {
- String jvm = findVM(path);
- if(jvm == null) {
- jvm = new File(path).getName();
- if("jre".equals(jvm)) jvm = new File(path).getParentFile().getName();
- if(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm) != null) {
- int i = 0;
- while(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm + (++i)) != null);
- jvm = jvm + i;
- }
-
- IVMInstallType type = JavaRuntime.getVMInstallType("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
- IVMInstall vm = type.createVMInstall(jvm);
- vm.setInstallLocation(new File(path));
- vm.setLibraryLocations(type.getDefaultLibraryLocations(new File(path)));
- vm.setName(jvm);
- try {
- JavaRuntime.saveVMConfiguration();
- } catch (CoreException e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
-
- }
- if(!jvm.equals(JavaRuntime.getDefaultVMInstall().getName())) {
- getUseDefaultJVMPreference().setValue("no");
- }
- getJVMNamePreference().setValue(jvm);
- return jvm;
- }
-
- static String findVM(String path) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- File installPath = js[j].getInstallLocation();
- if(installPath!=null && installPath.getAbsolutePath().equalsIgnoreCase(path)) {
- return js[j].getName();
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall(String name) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getName().equals(name)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstallById(String id) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getId().equals(id)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall() {
- if("no".equals(getUseDefaultJVMPreference().getValue())) {
- IVMInstallType[] jvmType = JavaRuntime.getVMInstallTypes();
- String selectedJVMName = getJVMNamePreference().getValue();
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("Finding selected JVM is " + selectedJVMName);
- }
- for (int i = 0; i < jvmType.length; i++) {
- IVMInstall[] jvmInstall = jvmType[i].getVMInstalls();
- for (int j = 0; j < jvmInstall.length; j++) {
-
- if(jvmInstall[j].getName().equals(selectedJVMName)) {
- return jvmInstall[j];
- }
- }
- }
- }
- return JavaRuntime.getDefaultVMInstall();
- }
-
- public static Preference getUseDefaultJVMPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_USE_DEFAULT_JVM = " + WebPreference.USE_DEFAULT_JVM.getValue());
- }
- return WebPreference.USE_DEFAULT_JVM;
- }
-
- public static Preference getJVMNamePreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_JVM = " + WebPreference.SERVER_JVM.getValue());
- }
- return WebPreference.SERVER_JVM;
- }
-
- public static Preference getWarningPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_WARNING = " + WebPreference.SERVER_WARNING.getValue());
- }
- return WebPreference.SERVER_WARNING;
- }
-
-}
15 years, 5 months
JBoss Tools SVN: r15223 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:37:20 -0400 (Tue, 12 May 2009)
New Revision: 15223
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2009-05-12 10:30:36 UTC (rev 15222)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2009-05-12 10:37:20 UTC (rev 15223)
@@ -28,7 +28,6 @@
org.jboss.tools.jst.web.ui.wizards.palette,
org.jboss.tools.jst.web.ui.wizards.process,
org.jboss.tools.jst.web.ui.wizards.project,
- org.jboss.tools.jst.web.ui.wizards.tomcatvm,
org.jboss.tools.vpe
Require-Bundle: org.jboss.tools.common,
org.eclipse.ui.ide,
15 years, 5 months
JBoss Tools SVN: r15222 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: src/org/jboss/tools/jst/web/ui/wizards/tomcatvm and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:30:36 -0400 (Tue, 12 May 2009)
New Revision: 15222
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-05-12 10:30:36 UTC (rev 15222)
@@ -3,8 +3,6 @@
<plugin>
<extension point="org.jboss.tools.common.model.specialwizard">
- <specialwizard class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard" id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard">
- </specialwizard>
<specialwizard class="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard" id="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard">
</specialwizard>
<specialwizard class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard" id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard">
@@ -557,14 +555,10 @@
class="org.jboss.tools.jst.web.ui.wizards.project.AddProjectTemplateVelocityView"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.project.EditProjectTemplateView"
class="org.jboss.tools.jst.web.ui.wizards.project.EditProjectTemplateView"/>
- <xclass id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"
- class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"/>
<xclass id="org.jboss.tools.jst.web.ui.editors.forms.TLDFormLayoutData"
class="org.jboss.tools.jst.web.ui.editors.forms.TLDFormLayoutData"/>
<xclass id="org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"
class="org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"/>
- <xclass id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"
- class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"
class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"/>
</extension>
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java 2009-05-12 10:30:36 UTC (rev 15222)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.ui.wizards.tomcatvm;
-
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-
-public class TomcatVMWizard extends AbstractQueryWizard {
- public TomcatVMWizard() {
- setView(new TomcatVMWizardView());
- }
-
- public void setObject(Object object) {
- getView().setModel(PreferenceModelUtilities.getPreferenceModel());
- getView().setObject(object);
- getView().setWindowTitle(WebUIMessages.START_TOMCAT_SERVER);
- getView().setTitle(WebUIMessages.CHECK_JVM);
- }
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java 2009-05-12 10:30:36 UTC (rev 15222)
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.ui.wizards.tomcatvm;
-
-import java.util.*;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.*;
-import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-import org.jboss.tools.jst.web.tomcat.TomcatVMHelper;
-
-public class TomcatVMWizardView extends AbstractQueryWizardView {
- XAttributeSupport support = new XAttributeSupport();
- Properties context;
-
- public TomcatVMWizardView() {
- XEntityData data = XEntityDataImpl.create(new String[][]{{"TomcatVMHelper", "yes"}, {"vm", "yes"}, /*{"ignore", "no"}*/}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- data.setValue("vm", TomcatVMHelper.getJVMInstall().getInstallLocation().getAbsolutePath()); //$NON-NLS-1$
-// data.setValue("ignore", "no");
- support.init(PreferenceModelUtilities.getPreferenceModel().getRoot(), data);
- }
-
- public void dispose() {
- super.dispose();
- if (support!=null) support.dispose();
- support = null;
- }
- public Control createControl(Composite parent) {
- Control c = support.createControl(parent);
- support.getPropertyEditorAdapterByName("vm").addValueChangeListener(new InputChangeListener()); //$NON-NLS-1$
- validate();
- return c;
- }
-
- private void validate() {
- String location = getLocation();
- String message = null;
- String errorMessage = null;
- if(location.length() == 0) {
- errorMessage = WebUIMessages.PATH_TO_JVM_IS_EMPTY;
- } else if(!new java.io.File(location).isDirectory()) {
- errorMessage = WebUIMessages.SPECIFIED_FOLDER_DOESNOT_EXIST;
- } else if(!new java.io.File(location + "/bin/java.exe").isFile()) { //$NON-NLS-1$
- errorMessage = WebUIMessages.SPECIFIED_FOLDER_ISNOT_JVMHOME;
- } else if(TomcatVMHelper.findToolsJarInVM(location) == null) {
- message = WebUIMessages.CANNOT_FIND_TOOLSJAR;
- }
- setErrorMessage(errorMessage);
- commandBar.setEnabled(OK, errorMessage == null);
- setMessage(message);
- }
-
- public void setObject(Object object) {
- context = (Properties)object;
- }
-
- class InputChangeListener implements java.beans.PropertyChangeListener {
- public void propertyChange(java.beans.PropertyChangeEvent evt) {
- validate();
- }
- }
-
- public void stopEditing() {
- support.save();
- context.setProperty("vm", getLocation()); //$NON-NLS-1$
- }
-
- private String getLocation() {
- return support.getValues().getProperty("vm"); //$NON-NLS-1$
- }
-
- public Point getPreferredSize() {
- return new Point(500, SWT.DEFAULT);
- }
-
-}
15 years, 5 months
JBoss Tools SVN: r15221 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-05-12 05:32:44 -0400 (Tue, 12 May 2009)
New Revision: 15221
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
JBIDE-3896 - implemented as shown
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -56,28 +57,26 @@
}
IPath loc = runtime.getLocation();
- String config = jbsrt.getJBossConfiguration();
+ IPath configPath = jbsrt.getConfigurationFullPath();
String rtID = runtime.getRuntimeType().getId();
- if(AS_32.equals(rtID)) return get32(loc, config);
- if(AS_40.equals(rtID)) return get40(loc,config);
- if(AS_42.equals(rtID)) return get42(loc,config);
- if(AS_50.equals(rtID)) return get50(loc,config);
- if(EAP_43.equals(rtID)) return getEAP43(loc,config);
+ if(AS_32.equals(rtID)) return get32(loc, configPath);
+ if(AS_40.equals(rtID)) return get40(loc,configPath);
+ if(AS_42.equals(rtID)) return get42(loc,configPath);
+ if(AS_50.equals(rtID)) return get50(loc,configPath);
+ if(EAP_43.equals(rtID)) return getEAP43(loc,configPath);
return null;
}
- protected IClasspathEntry[] get32(IPath location, String config) {
+ protected IClasspathEntry[] get32(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
addEntries(location.append(CLIENT), list);
addEntries(location.append(LIB), list);
addEntries(configPath.append(LIB), list);
return list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] get40(IPath location, String config) {
+ protected IClasspathEntry[] get40(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
IPath deployPath = configPath.append(DEPLOY);
addEntries(location.append(CLIENT), list);
addEntries(location.append(LIB), list);
@@ -88,17 +87,16 @@
return list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] get42(IPath location, String config) {
- return get40(location, config);
+ protected IClasspathEntry[] get42(IPath location, IPath configPath) {
+ return get40(location, configPath);
}
- protected IClasspathEntry[] getEAP43(IPath location, String config) {
- return get40(location, config);
+ protected IClasspathEntry[] getEAP43(IPath location, IPath configPath) {
+ return get40(location, configPath);
}
- protected IClasspathEntry[] get50(IPath location, String config) {
+ protected IClasspathEntry[] get50(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
IPath deployerPath = configPath.append(DEPLOYERS);
IPath deployPath = configPath.append(DEPLOY);
addEntries(location.append(CLIENT), list);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -81,8 +81,7 @@
LocalJBossServerRuntime ajbsr = (LocalJBossServerRuntime)
server2.getRuntime().loadAdapter(LocalJBossServerRuntime.class, null);
if(ajbsr != null ) {
- IPath loc = server2.getRuntime().getLocation();
- IPath configFolder = loc.append(IJBossServerConstants.SERVER).append(ajbsr.getJBossConfiguration());
+ IPath configFolder = ajbsr.getConfigurationFullPath();
ArrayList<XPathCategory> defaults = loadDefaults(server2, configFolder.toOSString());
serverToCategories.put(server2.getId(), defaults);
save(server2);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -12,6 +12,7 @@
import java.util.HashMap;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.wst.server.core.IRuntime;
@@ -32,9 +33,34 @@
public String getJBossConfiguration();
public void setJBossConfiguration(String config);
+
+ /**
+ * The folder this config is located in, for example:
+ * /home/rob/tmp/default_copy1 would return /home/rob/tmp/
+ * whereas /home/rob/apps/jboss/server/default_copy3 would return server
+ * @return
+ */
public String getConfigLocation();
+
+ /**
+ * The full path of the folder this config is located in, for example:
+ * /home/rob/tmp/default_copy1 would return
+ * /home/rob/tmp/
+ * whereas
+ * /home/rob/apps/jboss/server/default_copy3 would return
+ * /home/rob/apps/jboss/server
+ * @return
+ */
+ public IPath getConfigLocationFullPath();
+
public void setConfigLocation(String configLocation);
+ /**
+ * The full path of the configuration, ex:
+ * /home/rob/tmp/default_copy3 would return /home/rob/tmp/default_copy3
+ * @return
+ */
+ public IPath getConfigurationFullPath();
// for startup
public String getDefaultRunArgs();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -12,6 +12,7 @@
import java.util.HashMap;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -33,11 +34,6 @@
public class LocalJBossServerRuntime extends RuntimeDelegate implements IJBossServerRuntime {
public void setDefaults(IProgressMonitor monitor) {
- String location = Platform.getOS().equals(Platform.WS_WIN32)
- ? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$ //$NON-NLS-2$
- String version = getRuntime().getRuntimeType().getVersion();
- location += version + ".x"; //$NON-NLS-1$
- getRuntimeWorkingCopy().setLocation(new Path(location));
getRuntimeWorkingCopy().setName(getNextRuntimeName());
setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, IJBossServerConstants.DEFAULT_CONFIGURATION);
setVM(null);
@@ -150,10 +146,21 @@
}
public String getConfigLocation() {
- return getAttribute(PROPERTY_CONFIG_LOCATION, (String)null);
+ return getAttribute(PROPERTY_CONFIG_LOCATION, IConstants.SERVER);
}
public void setConfigLocation(String configLocation) {
setAttribute(PROPERTY_CONFIG_LOCATION, configLocation);
}
+
+ public IPath getConfigurationFullPath() {
+ return getConfigLocationFullPath().append(getJBossConfiguration());
+ }
+
+ public IPath getConfigLocationFullPath() {
+ String cl = getConfigLocation();
+ if( new Path(cl).isAbsolute())
+ return new Path(cl);
+ return getRuntime().getLocation().append(cl);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -46,6 +46,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -127,6 +128,15 @@
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
+ try {
+ if( !runtime.getConfigLocation().equals(IConstants.SERVER)) {
+ args = ArgsUtil.setArg(args, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL,
+ runtime.getConfigLocationFullPath().toFile().toURL().toString());
+ }
+ } catch( MalformedURLException murle) {}
+
+
vmArgs= ArgsUtil.setArg(vmArgs, null,
IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS,
runtime.getRuntime().getLocation().append(
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -27,15 +27,21 @@
/* Standard and re-usable */
public static String browse;
public static String serverName;
-
+ public static String copy;
+ public static String delete;
+ public static String directory;
+
/* Server and Runtime Wizard Fragments */
public static String wf_BaseNameVersionReplacement;
public static String wf_NameLabel;
public static String wf_HomeDirLabel;
public static String wf_JRELabel;
public static String wf_ConfigLabel;
+
public static String JBAS_version;
public static String JBEAP_version;
+ public static String rwf_CopyConfigLabel;
+ public static String rwf_DestinationLabel;
public static String rwf_TitleCreate;
public static String rwf_TitleEdit;
public static String rwf_Explanation;
@@ -50,6 +56,7 @@
public static String swf_AuthorizationDescription;
public static String swf_Explanation;
public static String swf_Explanation2;
+ public static String swf_ConfigurationLocation;
public static String swf_AuthenticationGroup;
public static String swf_Username;
public static String swf_Password;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-05-12 09:32:44 UTC (rev 15221)
@@ -1,11 +1,15 @@
browse=Browse...
serverName=Server Name
-
+copy=Copy...
+delete=Delete...
+directory=Directory:
wf_BaseNameVersionReplacement=_VERSION_
wf_NameLabel=Name
wf_HomeDirLabel=Home Directory
wf_JRELabel=JRE
wf_ConfigLabel=Configuration
+rwf_CopyConfigLabel=Copy configuration "{0}" to a new destination from "{1}".
+rwf_DestinationLabel=Destination
rwf_TitleCreate=Create a new JBoss Runtime
rwf_TitleEdit=Edit a JBoss Runtime
rwf_Explanation=A JBoss Server runtime references a JBoss installation directory.\nIt can be used to set up classpaths for projects which depend on this runtime,\nas well as by a "server" which will be able to start and stop instances of JBoss.
@@ -21,6 +25,7 @@
swf_RuntimeInformation=Runtime Information
swf_Explanation=A JBoss Server manages starting and stopping instances of JBoss. \nIt manages command line arguments and keeps track of which modules have been deployed.
swf_Explanation2=If the runtime information below is incorrect, please press back, Installed Runtimes..., \nand then Add to create a new runtime from a different location.
+swf_ConfigurationLocation=Configuration Location
swf_AuthorizationDescription=Set the login and password for your server.\nThis will ensure it starts and stops properly.
swf_AuthenticationGroup=Login Credentials
swf_Username=User Name
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -0,0 +1,39 @@
+package org.jboss.ide.eclipse.as.ui;
+
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Control;
+
+public class UIUtil {
+
+ public static FormData createFormData2(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
+ Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
+ FormData data = new FormData();
+
+ if( topStart != null ) {
+ data.top = topStart instanceof Control ? new FormAttachment((Control)topStart, topOffset) :
+ new FormAttachment(((Integer)topStart).intValue(), topOffset);
+ }
+
+ if( bottomStart != null ) {
+ data.bottom = bottomStart instanceof Control ? new FormAttachment((Control)bottomStart, bottomOffset) :
+ new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
+ }
+
+ if( leftStart != null ) {
+ data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart, leftOffset) :
+ new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
+ }
+
+ if( rightStart != null ) {
+ data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart, rightOffset) :
+ new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
+ }
+ return data;
+ }
+
+ public FormData createFormData(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
+ Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
+ return createFormData2(topStart, topOffset, bottomStart, bottomOffset, leftStart, leftOffset, rightStart, rightOffset);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -30,6 +30,7 @@
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
@@ -37,7 +38,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
/**
@@ -46,8 +46,6 @@
public class JBossConfigurationTableViewer extends TableViewer {
// private String jbossHome;
private String selectedConfiguration;
- private WizardFragment fragment;
-
public JBossConfigurationTableViewer(Composite parent) {
super(parent);
init();
@@ -63,9 +61,8 @@
init();
}
- public void setJBossHome(String jbossHome) {
- // this.jbossHome = jbossHome;
- setInput(jbossHome);
+ public void setFolder(String folder) {
+ setInput(folder);
}
public String getSelectedConfiguration() {
@@ -73,20 +70,7 @@
}
public void setConfiguration(String defaultConfiguration) {
- int item = -1;
- TableItem items[] = getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null && items[i].getText() != null
- && items[i].getText().equals(defaultConfiguration)) {
- item = i;
- break;
- }
- }
-
- if (item != -1) {
- getTable().setSelection(item);
- }
-
+ setSelection(new StructuredSelection(defaultConfiguration));
selectedConfiguration = defaultConfiguration;
}
@@ -114,10 +98,6 @@
protected void configurationSelected() {
selectedConfiguration = getCurrentlySelectedConfiguration();
-
- if (fragment != null) {
- fragment.updateChildFragments();
- }
}
protected class ConfigurationProvider implements
@@ -132,8 +112,7 @@
public Object[] getElements(Object inputElement) {
ArrayList<String> configList = new ArrayList<String>();
- File serverDirectory = new File(inputElement.toString()
- + File.separator + "server");
+ File serverDirectory = new File(inputElement.toString());
if (serverDirectory.exists()) {
@@ -181,8 +160,4 @@
return (String) element;
}
}
-
- public void setWizardFragment(WizardFragment fragment) {
- this.fragment = fragment;
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -25,18 +25,27 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -46,13 +55,18 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -66,6 +80,8 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerType;
import org.jboss.ide.eclipse.as.core.util.ServerBeanLoader;
@@ -73,6 +89,7 @@
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
/**
* @author Stryker
@@ -83,22 +100,29 @@
private boolean beenEntered = false;
- private Label nameLabel, homeDirLabel, installedJRELabel, configLabel,
- explanationLabel;
+ private Label nameLabel, homeDirLabel,
+ installedJRELabel, explanationLabel;
private Text nameText, homeDirText;
private Combo jreCombo;
private int jreComboIndex;
private Button homeDirButton, jreButton;
- private Composite nameComposite, homeDirComposite, jreComposite,
- configComposite, cloneComposite;
- private String name, homeDir, config;
+ private Composite nameComposite, homeDirComposite, jreComposite;
+ private String name, homeDir;
+ // Configuration stuff
+ private Composite configComposite;
+ private Group configGroup;
+ private Label configDirLabel;
+ private Text configDirText;
+ private JBossConfigurationTableViewer configurations;
+ private Button configCopy, configBrowse, configDelete;
+ private String configDirTextVal;
+
// jre fields
protected ArrayList<IVMInstall> installedJREs;
protected String[] jreNames;
protected int defaultVMIndex;
private IVMInstall selectedVM;
- private JBossConfigurationTableViewer configurations;
private String originalName;
public Composite createComposite(Composite parent, IWizardHandle handle) {
@@ -113,7 +137,6 @@
createHomeComposite(main);
createJREComposite(main);
createConfigurationComposite(main);
- createCloneComposite(main);
fillWidgets();
// make modifications to parent
@@ -163,14 +186,29 @@
originalName = rt.getRuntime().getName();
nameText.setText(originalName);
name = originalName;
- Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
- String value = prefs.getString(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + rt.getRuntime().getRuntimeType().getId());
- homeDir = (value != null && value.length() != 0) ? value : rt.getRuntime().getLocation().toOSString();
+
+ if( rt.getRuntime().getLocation() == null ) {
+ // new runtime creation
+ Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ String value = prefs.getString(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + rt.getRuntime().getRuntimeType().getId());
+
+ String locationDefault = Platform.getOS().equals(Platform.WS_WIN32)
+ ? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$ //$NON-NLS-2$
+ String version = rt.getRuntime().getRuntimeType().getVersion();
+ locationDefault += version + ".x"; //$NON-NLS-1$
+
+ homeDir = (value != null && value.length() != 0) ? value : locationDefault;
+ } else {
+ // old runtime, load from it
+ homeDir = rt.getRuntime().getLocation().toOSString();
+ }
homeDirText.setText(homeDir);
+
((IRuntimeWorkingCopy)rt.getRuntime()).setLocation(new Path(homeDir));
- config = rt.getJBossConfiguration();
- configurations.setConfiguration(config);
- configLabel.setText(Messages.wf_ConfigLabel);
+ String dirText = rt.getConfigLocation();
+ configDirText.setText(dirText == null ? IConstants.SERVER : dirText);
+ configurations.setConfiguration(rt.getJBossConfiguration() == null
+ ? IConstants.DEFAULT_CONFIGURATION : rt.getJBossConfiguration());
if (rt.isUsingDefaultJRE()) {
jreCombo.select(0);
@@ -382,107 +420,167 @@
}
private void createConfigurationComposite(Composite main) {
+ UIUtil u = new UIUtil(); // top bottom left right
configComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(jreComposite, 10);
- cData.bottom = new FormAttachment(100, -5);
- configComposite.setLayoutData(cData);
-
+ configComposite.setLayoutData(u.createFormData(
+ jreComposite, 10, 100, -5, 0, 5, 100, -5));
configComposite.setLayout(new FormLayout());
+
+ configGroup = new Group(configComposite, SWT.DEFAULT);
+ configGroup.setText(Messages.wf_ConfigLabel);
+ configGroup.setLayoutData(u.createFormData(
+ 0, 0, 100, 0, 0, 0, 100, 0));
+ configGroup.setLayout(new FormLayout());
+
+ configDirLabel = new Label(configGroup, SWT.NONE);
+ configDirLabel.setText(Messages.directory);
+ configDirText = new Text(configGroup, SWT.BORDER);
- configLabel = new Label(configComposite, SWT.NONE);
- configLabel.setText(Messages.wf_ConfigLabel);
-
- configurations = new JBossConfigurationTableViewer(configComposite,
- SWT.BORDER | SWT.SINGLE);
-
- FormData labelData = new FormData();
- labelData.left = new FormAttachment(0, 5);
- configLabel.setLayoutData(labelData);
-
- FormData viewerData = new FormData();
- viewerData.left = new FormAttachment(0, 5);
- viewerData.right = new FormAttachment(100, -5);
- viewerData.top = new FormAttachment(configLabel, 5);
- viewerData.bottom = new FormAttachment(100, -5);
-
- configurations.getTable().setLayoutData(viewerData);
-
- configurations.getTable().addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
+ configurations = new JBossConfigurationTableViewer(configGroup,
+ SWT.BORDER | SWT.SINGLE);
+
+ configBrowse = new Button(configGroup, SWT.DEFAULT);
+ configCopy = new Button(configGroup, SWT.DEFAULT);
+ configDelete = new Button(configGroup, SWT.DEFAULT);
+ configBrowse.setText(Messages.browse);
+ configCopy.setText(Messages.copy);
+ configDelete.setText(Messages.delete);
+
+ // Organize them
+ configDirLabel.setLayoutData(u.createFormData(
+ 2, 5, null, 0, 0, 5, null, 0));
+ configDirText.setLayoutData(u.createFormData(
+ 0, 5, null, 0, configDirLabel, 5, configBrowse, -5));
+ configBrowse.setLayoutData(u.createFormData(
+ 0, 5, null, 0, configurations.getTable(), 5, 100, -5));
+ configurations.getTable().setLayoutData(u.createFormData(
+ configDirText, 5, 100,-5, 0,5, 80, 0));
+ configCopy.setLayoutData(u.createFormData(
+ configBrowse, 5, null, 0, configurations.getTable(), 5, 100, -5));
+ configDelete.setLayoutData(u.createFormData(
+ configCopy, 5, null, 0, configurations.getTable(), 5, 100, -5));
+
+ configDirText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
updatePage();
+ }
+ });
+
+ configBrowse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ configBrowsePressed();
}
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ configCopy.addSelectionListener(new SelectionListener(){
public void widgetSelected(SelectionEvent e) {
- updatePage();
+ configCopyPressed();
}
-
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
});
-
+ configDelete.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ configDeletePressed();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ configurations.addSelectionChangedListener(new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateErrorMessage();
+ configDelete.setEnabled(!((IStructuredSelection)configurations.getSelection()).isEmpty());
+ configCopy.setEnabled(!((IStructuredSelection)configurations.getSelection()).isEmpty());
+ }
+ });
}
- private void createCloneComposite(Composite main) {
- IJBossServerRuntime rt = getRuntime();
- if (rt != null) {
+ protected void configBrowsePressed() {
+ String folder = new Path(configDirText.getText()).isAbsolute() ?
+ configDirText.getText() : new Path(homeDir).append(configDirText.getText()).toString();
+ File file = new File(folder);
+ if (!file.exists()) {
+ file = null;
+ }
- cloneComposite = new Composite(main, SWT.NONE);
- FormData cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(configComposite, 5);
- cData.bottom = new FormAttachment(100, -5);
- cloneComposite.setLayoutData(cData);
-
- cloneComposite.setLayout(new FormLayout());
- Button cloneButton = new Button(cloneComposite, SWT.CHECK);
- cloneButton.setSelection(false);
- cloneButton.setText("Clone this configuration");
- cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(0, 5);
- cData.bottom = new FormAttachment(100, -5);
- cloneButton.setLayoutData(cData);
+ File directory = getDirectory(file, homeDirComposite.getShell());
+ if (directory != null) {
+ if(directory.getAbsolutePath().startsWith(new Path(homeDir).toString())) {
+ String result = directory.getAbsolutePath().substring(homeDir.length());
+ configDirText.setText(new Path(result).makeRelative().toString());
+ } else {
+ configDirText.setText(directory.getAbsolutePath());
+ }
+ }
+ }
+ protected void configCopyPressed() {
+ CopyConfigurationDialog d = new CopyConfigurationDialog(configCopy.getShell(), homeDir, configDirText.getText(), configurations.getCurrentlySelectedConfiguration());
+ if(d.open() == 0 ) {
+ IPath source = new Path(configDirText.getText());
+ if( !source.isAbsolute())
+ source = new Path(homeDir).append(source);
+ source = source.append(configurations.getCurrentlySelectedConfiguration());
- Button intoConfigButton = new Button(cloneComposite, SWT.RADIO);
- Button intoLocationButton = new Button(cloneComposite, SWT.RADIO);
- Text newConfigName = new Text(cloneComposite, SWT.DEFAULT);
- Text newLocation = new Text(cloneComposite, SWT.DEFAULT);
-
-
- intoConfigButton.setText("new configuration name");
- intoLocationButton.setText("arbitrary location");
-
-
-
-
- } else {
- // TODO Display something useful in edit-runtime wizard
+ IPath dest = new Path(d.getNewDest());
+ if( !dest.isAbsolute())
+ dest = new Path(homeDir).append(dest);
+ dest = dest.append(d.getNewConfig());
+ dest.toFile().mkdirs();
+ org.jboss.tools.jmx.core.util.FileUtil.copyDir(source.toFile(), dest.toFile());
+ configDirText.setText(d.getNewDest());
+ configurations.setSelection(new StructuredSelection(d.getNewConfig()));
}
+
}
+ protected void configDeletePressed() {
+ MessageDialog dialog = new MessageDialog(configBrowse.getShell(),
+ "Delete Configuration?", null,
+ "Are you sure you want to delete this folder? This cannot be undone.",
+ MessageDialog.WARNING, new String[] { IDialogConstants.YES_LABEL,
+ IDialogConstants.NO_LABEL }, 0); // yes is the default
+ if(dialog.open() == 0) {
+ String config = configurations.getCurrentlySelectedConfiguration();
+ String configDir = configDirText.getText();
+ File folder;
+ if( !new Path(configDir).isAbsolute())
+ folder = new Path(homeDir).append(configDir).append(config).toFile();
+ else
+ folder = new Path(configDir).append(config).toFile();
+
+ FileUtil.completeDelete(folder);
+ configurations.refresh();
+ updatePage();
+ }
+ }
+ // Launchable only from UI thread
private void updatePage() {
- updateErrorMessage();
+ String folder;
if (!isHomeValid()) {
configurations.getControl().setEnabled(false);
- configurations.setJBossHome(homeDirText.getText());
+ folder = homeDirText.getText();
} else {
- configurations.getControl().setEnabled(true);
- if( !homeDirText.getText().equals(configurations.getInput())) {
- configurations.setJBossHome(homeDirText.getText());
- configurations.setConfiguration(IJBossServerConstants.DEFAULT_CONFIGURATION);
- }
+ IPath p = new Path(configDirText.getText());
+ if( p.isAbsolute())
+ folder = p.toString();
+ else
+ folder = new Path(homeDirText.getText()).append(p).toString();
}
+ configurations.setFolder(folder);
+ File f = new File(folder);
+ configurations.getControl().setEnabled(f.exists() && f.isDirectory());
+ configurations.setConfiguration(IJBossServerConstants.DEFAULT_CONFIGURATION);
int sel = jreCombo.getSelectionIndex();
if (sel > 0)
selectedVM = installedJREs.get(sel-1);
else
selectedVM = null;
+ configDirTextVal = configDirText.getText();
+ updateErrorMessage();
}
private void updateErrorMessage() {
@@ -518,6 +616,9 @@
if (jreComboIndex < 0)
return Messages.rwf_NoVMSelected;
+
+ if( configurations.getSelection().isEmpty())
+ return "User must select a valid configuration";
return null;
}
@@ -554,7 +655,7 @@
}
}
- protected File getDirectory(File startingDirectory, Shell shell) {
+ protected static File getDirectory(File startingDirectory, Shell shell) {
DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
if (startingDirectory != null) {
fileDialog.setFilterPath(startingDirectory.getPath());
@@ -638,6 +739,7 @@
IJBossServerRuntime.class, new NullProgressMonitor());
srt.setVM(selectedVM);
srt.setJBossConfiguration(configurations.getSelectedConfiguration());
+ srt.setConfigLocation(configDirTextVal);
getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
}
@@ -671,4 +773,156 @@
}
return null;
}
+
+
+ public static class CopyConfigurationDialog extends TitleAreaDialog {
+ private String origHome, origDest, origConfig;
+ private String newDest, newConfig;
+ private Text destText;
+ protected CopyConfigurationDialog(Shell parentShell, String home,
+ String dir, String config) {
+ super(new Shell(parentShell));
+ origHome = home;
+ origDest = dir;
+ origConfig = config;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite c = (Composite) super.createDialogArea(parent);
+ Composite main = new Composite(c, SWT.NONE);
+ main.setLayoutData(new GridData(GridData.FILL_BOTH));
+ main.setLayout(new FormLayout());
+
+ setCleanMessage();
+
+ Label nameLabel = new Label(main, SWT.NONE);
+ nameLabel.setText(Messages.wf_NameLabel);
+
+ final Text nameText = new Text(main, SWT.BORDER);
+
+ Label destLabel = new Label(main, SWT.NONE);
+ destLabel.setText(Messages.rwf_DestinationLabel);
+
+ destText = new Text(main, SWT.BORDER);
+
+ Button browse = new Button(main, SWT.PUSH);
+ browse.setText(Messages.browse);
+
+ Point nameSize = new GC(nameLabel).textExtent(nameLabel.getText());
+ Point destSize = new GC(destLabel).textExtent(destLabel.getText());
+ Control wider = nameSize.x > destSize.x ? nameLabel : destLabel;
+
+ nameText.setLayoutData(UIUtil.createFormData2(
+ 0,13,null,0,wider,5,100,-5));
+ nameLabel.setLayoutData(UIUtil.createFormData2(
+ 0,15,null,0,0,5,null,0));
+ destText.setLayoutData(UIUtil.createFormData2(
+ nameText,5,null,0,wider,5,browse,-5));
+ destLabel.setLayoutData(UIUtil.createFormData2(
+ nameText,7,null,0,0,5,null,0));
+ browse.setLayoutData(UIUtil.createFormData2(
+ nameText,5,null,0,null,0,100,-5));
+
+ nameText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ newConfig = nameText.getText();
+ validate();
+ }
+ });
+ destText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ newDest = destText.getText();
+ validate();
+ }
+ });
+ browse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ IPath p = new Path(newDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(newDest);
+ File file = p.toFile();
+ if (!file.exists()) {
+ file = null;
+ }
+
+ File directory = getDirectory(file, getShell());
+ if (directory != null) {
+ IPath newP = new Path(directory.getAbsolutePath());
+ IPath result;
+ if( newP.toOSString().startsWith(new Path(origHome).toOSString()))
+ result = newP.removeFirstSegments(new Path(origHome).segmentCount());
+ else
+ result = newP;
+ destText.setText(result.toString());
+ }
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+
+
+ destText.setText(origDest);
+ nameText.setText(findNewest(origConfig + "_copy")); // TODO increment
+ return c;
+ }
+
+ public void validate() {
+ boolean valid = false;
+ IPath p = null;
+ if( newDest != null && newConfig != null ) {
+ p = new Path(newDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(newDest);
+ if( !p.append(newConfig).toFile().exists())
+ valid = true;
+
+ }
+ if( !valid ) {
+ if( newDest == null || newConfig == null ) {
+ setMessage("All fields must be completed.", IMessageProvider.ERROR);
+ } else {
+ setMessage("The output folder already exists: " + p.append(newConfig).toString(), IMessageProvider.ERROR);
+ }
+ } else {
+ setCleanMessage();
+ }
+ if( getOKButton() != null )
+ getOKButton().setEnabled(valid);
+ }
+
+ protected void setCleanMessage() {
+ setMessage(NLS.bind(Messages.rwf_CopyConfigLabel, origConfig, origDest));
+ }
+ // Only to be used in initializing dialog
+ protected String findNewest(String suggested) {
+ IPath p = new Path(origDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(origDest);
+ if( p.append(suggested).toFile().exists()) {
+ int i = 1;
+ while(p.append(suggested + i).toFile().exists())
+ i++;
+ return suggested + i;
+ }
+ return suggested;
+ }
+
+ protected Point getInitialSize() {
+ return new Point(500, super.getInitialSize().y);
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText("Copy a Configuration");
+ }
+
+ public String getNewDest() {
+ return newDest;
+ }
+
+ public String getNewConfig() {
+ return newConfig;
+ }
+ }
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -63,7 +63,7 @@
private Label serverExplanationLabel,
runtimeExplanationLabel;
private Label homeDirLabel, installedJRELabel, configLabel;
- private Label homeValLabel, jreValLabel, configValLabel;
+ private Label homeValLabel, jreValLabel, configValLabel, configLocValLabel;
private Group runtimeGroup;
public Composite createComposite(Composite parent, IWizardHandle handle) {
@@ -151,6 +151,10 @@
d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
jreValLabel.setLayoutData(d);
+ Label configLocationLabel = new Label(runtimeGroup, SWT.NONE);
+ configLocationLabel.setText(Messages.swf_ConfigurationLocation);
+ configLocValLabel = new Label(runtimeGroup, SWT.NONE);
+
configLabel = new Label(runtimeGroup, SWT.NONE);
configLabel.setText(Messages.wf_ConfigLabel);
configValLabel = new Label(runtimeGroup, SWT.NONE);
@@ -178,6 +182,7 @@
homeValLabel.setText(srt.getRuntime().getLocation().toOSString());
configValLabel.setText(srt.getJBossConfiguration());
jreValLabel.setText(srt.getVM().getInstallLocation().getAbsolutePath() + " (" + srt.getVM().getName() + ")");
+ configLocValLabel.setText(srt.getConfigLocation());
runtimeGroup.layout();
updateErrorMessage();
}
15 years, 5 months
JBoss Tools SVN: r15220 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 05:15:47 -0400 (Tue, 12 May 2009)
New Revision: 15220
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
Log:
JBIDE-4232
change the tooltip of notification image
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:54:28 UTC (rev 15219)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 09:15:47 UTC (rev 15220)
@@ -119,7 +119,6 @@
}
Thread thread = new Thread() {
public void run() {
- long startTime = System.currentTimeMillis();
synchronized (lock) {
starting = true;
waiting = true;
@@ -171,8 +170,6 @@
} finally {
waiting = false;
starting = false;
- long engTime = System.currentTimeMillis();
- System.out.println(engTime - startTime);
}
}
};
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12 07:54:28 UTC (rev 15219)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12 09:15:47 UTC (rev 15220)
@@ -10,12 +10,20 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
/**
@@ -28,15 +36,47 @@
private Image waringImage = null;
-// private Image informationImage = null;
+ // private Image informationImage = null;
private int type = TYPE_NONE;
+ private DefaultToolTip toolTip = null;
+
+
public FieldMarkerComposite(Composite parent, int style) {
super(parent, style);
- errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_ERROR);
- waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_WARING);
+ errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry()
+ .get(GraphicsConstants.IMAGE_OVR_ERROR);
+ waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
+ GraphicsConstants.IMAGE_OVR_WARING);
this.addPaintListener(this);
+ toolTip = new DefaultToolTip(this) {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.window.DefaultToolTip#createToolTipContentArea
+ * (org.eclipse.swt.widgets.Event,
+ * org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Composite createToolTipContentArea(Event event, Composite parent) {
+ return super.createToolTipContentArea(event, parent);
+ }
+
+ public Point getLocation(Point tipSize, Event event) {
+ Point point = super.getLocation(tipSize, event);
+ point.y = ((Control) getToolTipArea(null)).toDisplay(0,0).y - 24;
+ point.x = ((Control) getToolTipArea(null)).toDisplay(0,0).x;
+ return point;
+ }
+
+ };
+ ((DefaultToolTip)toolTip).setBackgroundColor(new Color(null,255,255,255));
+ FormColors colors = new FormColors(getDisplay());
+ ((DefaultToolTip)toolTip).setForegroundColor(colors.getColor(IFormColors.TITLE));
+ toolTip.setStyle(SWT.NONE);
}
/*
@@ -49,8 +89,8 @@
this.type = type;
this.redraw();
}
-
- public int getMarkerType(){
+
+ public int getMarkerType() {
return type;
}
@@ -61,10 +101,10 @@
* org.jboss.tools.smooks.configuration.editors.IFieldMarker#setMessage()
*/
public void setMessage(String message) {
- this.setToolTipText(message);
+ toolTip.setText(message);
}
-
- public String getMessage(){
+
+ public String getMessage() {
return getToolTipText();
}
15 years, 5 months
JBoss Tools SVN: r15219 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 03:54:28 -0400 (Tue, 12 May 2009)
New Revision: 15219
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
Log:
JBIDE-4232
change the notification image position
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -41,6 +41,8 @@
private boolean starting = false;
private boolean waiting = false;
private Object lock = new Object();
+
+ private long watingTime = 300;
private List<ISmooksModelValidateListener> listeners = new ArrayList<ISmooksModelValidateListener>();
@@ -109,64 +111,69 @@
}
public void startValidate(final Collection<?> selectedObjects, final EditingDomain editingDomain) {
+ if (starting) {
+ synchronized (lock) {
+ waiting = true;
+ }
+ return;
+ }
Thread thread = new Thread() {
public void run() {
- if (starting) {
- synchronized (lock) {
- waiting = true;
+ long startTime = System.currentTimeMillis();
+ synchronized (lock) {
+ starting = true;
+ waiting = true;
+ }
+ while (waiting) {
+ try {
+ waiting = false;
+ Thread.sleep(watingTime);
+ Thread.yield();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
}
- return;
- } else {
- synchronized (lock) {
- starting = true;
- waiting = true;
+ }
+ try {
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateStart();
+ }
+
+ });
+
}
- while (waiting) {
- try {
- waiting = false;
- Thread.sleep(700);
- Thread.yield();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- try {
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable(){
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateStart();
- }
-
- });
-
- }
-
- final Diagnostic d = validate(selectedObjects, editingDomain);
+ final Diagnostic d = validate(selectedObjects, editingDomain);
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable(){
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateEnd(d);
- }
-
- });
- }
- } finally {
- waiting = false;
- starting = false;
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateEnd(d);
+ }
+
+ });
}
+ } finally {
+ waiting = false;
+ starting = false;
+ long engTime = System.currentTimeMillis();
+ System.out.println(engTime - startTime);
}
-
}
};
thread.setName("Validate Smooks model");
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -27,6 +27,7 @@
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
@@ -199,10 +200,30 @@
if (smooksResourceList != null) {
FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null,parent, toolkit, propertyDescriptor, model, false);
editPart.setFieldMarker(wrapper.getMarker());
- final Combo combo = new Combo(parent, SWT.BORDER);
+
+ Composite tcom = toolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ GridData gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editPart.setFieldMarker(notificationComposite);
+
+ final Combo combo = new Combo(tcom, SWT.BORDER);
editPart.setContentControl(combo);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
combo.setLayoutData(gd);
+ tcom.setLayoutData(gd);
+
Object editValue = SmooksUIUtils.getEditValue(propertyDescriptor, model);
if (editValue != null) {
combo.setText(editValue.toString());
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -152,17 +152,17 @@
displayName = itemPropertyDescriptor.getDisplayName(model);
EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
if (feature.isRequired()) {
- displayName = "*" + displayName;
+ displayName = displayName + "*";
}
}
Composite labelComposite = formToolKit.createComposite(parent);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginLeft = 0;
- layout.marginRight = 0;
- layout.horizontalSpacing = 0;
- labelComposite.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+// GridLayout layout = new GridLayout();
+// layout.numColumns = 2;
+// layout.marginLeft = 0;
+// layout.marginRight = 0;
+// layout.horizontalSpacing = 0;
+ labelComposite.setLayout(new FillLayout());
+// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Control labelControl = null;
if (!isLink) {
@@ -173,19 +173,19 @@
Hyperlink link = formToolKit.createHyperlink(labelComposite, displayName + " :", SWT.NONE);
labelControl = link;
}
- gd = new GridData();
- labelControl.setLayoutData(gd);
+// gd = new GridData();
+// labelControl.setLayoutData(gd);
- FieldMarkerComposite notificationComposite = new FieldMarkerComposite(labelComposite, SWT.NONE);
- gd = new GridData();
- gd.heightHint = 8;
- gd.widthHint = 8;
- gd.horizontalAlignment = GridData.BEGINNING;
- gd.verticalAlignment = GridData.BEGINNING;
- notificationComposite.setLayoutData(gd);
+// FieldMarkerComposite notificationComposite = new FieldMarkerComposite(labelComposite, SWT.NONE);
+// gd = new GridData();
+// gd.heightHint = 8;
+// gd.widthHint = 8;
+// gd.horizontalAlignment = GridData.BEGINNING;
+// gd.verticalAlignment = GridData.BEGINNING;
+// notificationComposite.setLayoutData(gd);
wrapper.setLabelControl(labelControl);
- wrapper.setMarker(notificationComposite);
+// wrapper.setMarker(notificationComposite);
return wrapper;
}
@@ -429,12 +429,32 @@
if (multiText) {
textType = SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL;
}
- final Text valueText = toolkit.createText(textContainer, "", textType);
+ Composite tcom = toolkit.createComposite(textContainer);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ fieldEditPart.setFieldMarker(notificationComposite);
+
+ final Text valueText = toolkit.createText(tcom, "", textType);
gd = new GridData(GridData.FILL_HORIZONTAL);
if (multiText && height > 0) {
gd.heightHint = height;
}
valueText.setLayoutData(gd);
+
+ tcom.setLayoutData(gd);
+
toolkit.paintBordersFor(textContainer);
if (openFile) {
Button fileBrowseButton = toolkit.createButton(textContainer, "Browse", SWT.NONE);
@@ -619,8 +639,29 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit,
+
+ Composite tcom = toolkit.createComposite(classTextComposite);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editpart.setFieldMarker(notificationComposite);
+
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit,
"Search Class", dialog, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ searchComposite.setLayoutData(gd);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -845,7 +886,25 @@
if (readOnly) {
style = style | SWT.READ_ONLY;
}
- final Combo combo = new Combo(parent, style);
+
+ Composite tcom = formToolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ GridData gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ fieldEditPart.setFieldMarker(notificationComposite);
+
+ final Combo combo = new Combo(tcom, style);
combo.add("");
if (items != null) {
for (int i = 0; i < items.length; i++) {
@@ -855,8 +914,10 @@
}
}
}
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ tcom.setLayoutData(gd);
combo.setLayoutData(gd);
+
if (currentSelect != -1) {
combo.select(currentSelect);
}
@@ -933,8 +994,29 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, buttonName, dialog,
+
+ Composite tcom = toolkit.createComposite(classTextComposite);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editpart.setFieldMarker(notificationComposite);
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit, buttonName, dialog,
SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ searchComposite.setLayoutData(gd);
+
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -956,6 +1038,8 @@
}
}
});
+
+
toolkit.paintBordersFor(classTextComposite);
editpart.setContentControl(classTextComposite);
return editpart;
15 years, 5 months
JBoss Tools SVN: r15218 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 03:02:01 -0400 (Tue, 12 May 2009)
New Revision: 15218
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
Log:
JBIDE-4298
change some label text
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties 2009-05-12 07:02:01 UTC (rev 15218)
@@ -85,13 +85,13 @@
_UI_FeaturesType_type = Features
_UI_HandlersType_type = Handlers
_UI_HandlerType_type = Handler
-_UI_ImportType_type = Import
-_UI_ParamsType_type = Params
+_UI_ImportType_type = Import Smooks Configuration
+_UI_ParamsType_type = Global Parameters
_UI_ParamType_type = Param
_UI_ProfilesType_type = Profiles
_UI_ProfileType_type = Profile
_UI_ReaderType_type = Custome Reader
-_UI_ResourceConfigType_type = Resource Config
+_UI_ResourceConfigType_type = Custom Resource Configuration
_UI_ResourceType_type = Resource
_UI_SetOffType_type = Set Off
_UI_SetOnType_type = Set On
@@ -125,14 +125,14 @@
_UI_DocumentRoot_features_feature = Features
_UI_DocumentRoot_handler_feature = Handler
_UI_DocumentRoot_handlers_feature = Handlers
-_UI_DocumentRoot_import_feature = Import
+_UI_DocumentRoot_import_feature = Import Smooks Configuration
_UI_DocumentRoot_param_feature = Param
-_UI_DocumentRoot_params_feature = Params
+_UI_DocumentRoot_params_feature = Global Parameters
_UI_DocumentRoot_profile_feature = Profile
_UI_DocumentRoot_profiles_feature = Profiles
_UI_DocumentRoot_reader_feature = Reader
_UI_DocumentRoot_resource_feature = Resource
-_UI_DocumentRoot_resourceConfig_feature = Resource Config
+_UI_DocumentRoot_resourceConfig_feature = Custom Resource Configuration
_UI_DocumentRoot_setOff_feature = Set Off
_UI_DocumentRoot_setOn_feature = Set On
_UI_DocumentRoot_smooksResourceList_feature = Smooks Resource List
@@ -153,7 +153,7 @@
_UI_ProfileType_subProfiles_feature = Sub Profiles
_UI_ReaderType_handlers_feature = Handlers
_UI_ReaderType_features_feature = Features
-_UI_ReaderType_params_feature = Params
+_UI_ReaderType_params_feature = Global Parameters
_UI_ReaderType_class_feature = Class
_UI_ResourceConfigType_resource_feature = Resource
_UI_ResourceConfigType_condition_feature = Condition
@@ -165,7 +165,7 @@
_UI_ResourceType_type_feature = Type
_UI_SetOffType_feature_feature = Feature
_UI_SetOnType_feature_feature = Feature
-_UI_SmooksResourceListType_params_feature = Params
+_UI_SmooksResourceListType_params_feature = Global Parameters
_UI_SmooksResourceListType_conditions_feature = Conditions
_UI_SmooksResourceListType_profiles_feature = Profiles
_UI_SmooksResourceListType_abstractReaderGroup_feature = Abstract Reader Group
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-12 07:02:01 UTC (rev 15218)
@@ -55,6 +55,7 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.actions.AddSmooksResourceAction;
import org.jboss.tools.smooks.configuration.actions.ValidateSmooksAction;
+import org.jboss.tools.smooks.model.calc.Counter;
import org.jboss.tools.smooks.model.datasource.DataSourceJndi;
import org.jboss.tools.smooks.model.datasource.Direct;
import org.jboss.tools.smooks.model.dbrouting.Executor;
@@ -647,59 +648,66 @@
}
protected void groupActions(MenuManager manager, Collection<?> createChildActions) {
- MenuManager readers = new MenuManager("Reader");
- manager.add(readers);
+ MenuManager readerMenu = new MenuManager("Reader");
+ manager.add(readerMenu);
- MenuManager templating = new MenuManager("Templating");
- manager.add(templating);
+ MenuManager templatingMenu = new MenuManager("Templating");
+ manager.add(templatingMenu);
- MenuManager jbinding = new MenuManager("Java Binding");
- manager.add(jbinding);
+ MenuManager jbindingMenu = new MenuManager("Java Binding");
+ manager.add(jbindingMenu);
- MenuManager datasources = new MenuManager("Datasources");
- manager.add(datasources);
+ MenuManager datasourcesMenu = new MenuManager("Datasources");
+ manager.add(datasourcesMenu);
- MenuManager scripting = new MenuManager("Scripting");
- manager.add(scripting);
+ MenuManager scriptingMenu = new MenuManager("Scripting");
+ manager.add(scriptingMenu);
- MenuManager fragmentRouting = new MenuManager("Fragment Routing");
- manager.add(fragmentRouting);
+ MenuManager fragmentRoutingMenu = new MenuManager("Fragment Routing");
+ manager.add(fragmentRoutingMenu);
- MenuManager database = new MenuManager("Database");
- manager.add(database);
+ MenuManager databaseMenu = new MenuManager("Database");
+ manager.add(databaseMenu);
+
+ MenuManager calcMenu = new MenuManager("Calc");
+ manager.add(calcMenu);
for (Iterator<?> iterator = createChildActions.iterator(); iterator.hasNext();) {
boolean added = false;
AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
Object descriptor = action.getDescriptor();
-
- if (isReader(descriptor)) {
- readers.add(action);
+ if (isCalcDescriptor(descriptor)) {
+ calcMenu.add(action);
added = true;
}
- if (isTemplate(descriptor)) {
- templating.add(action);
+
+ if (isReaderDescriptor(descriptor)) {
+ readerMenu.add(action);
added = true;
}
- if (isJavaBinding(descriptor)) {
- jbinding.add(action);
+ if (isTemplateDescriptor(descriptor)) {
+ templatingMenu.add(action);
added = true;
}
- if (isDatasources(descriptor)) {
- datasources.add(action);
+ if (isJavaBindingDescriptor(descriptor)) {
+ jbindingMenu.add(action);
added = true;
}
+ if (isDatasourcesDescriptor(descriptor)) {
+ datasourcesMenu.add(action);
+ added = true;
+ }
if(isDatabaseDescriptor(descriptor)){
- database.add(action);
+ databaseMenu.add(action);
added = true;
}
- if (isScripting(descriptor)) {
- scripting.add(action);
+ if (isScriptingDescriptor(descriptor)) {
+ scriptingMenu.add(action);
added = true;
}
- if (isFragmentRouting(descriptor)) {
- fragmentRouting.add(action);
+ if (isFragmentRoutingDescriptor(descriptor)) {
+ fragmentRoutingMenu.add(action);
added = true;
}
if (!added) {
@@ -707,15 +715,21 @@
}
}
- orderReaderAction(readers);
- orderTemplateAction(templating);
- orderJBindingAction(jbinding);
- orderDatasourceAction(datasources);
- orderScriptAction(scripting);
- orderFragmentAction(fragmentRouting);
- orderDatabaseAction(database);
+ orderReaderAction(readerMenu);
+ orderTemplateAction(templatingMenu);
+ orderJBindingAction(jbindingMenu);
+ orderDatasourceAction(datasourcesMenu);
+ orderScriptAction(scriptingMenu);
+ orderFragmentAction(fragmentRoutingMenu);
+ orderDatabaseAction(databaseMenu);
+ orderCalcAction(calcMenu);
}
+ protected void orderCalcAction(MenuManager database) {
+ // TODO Auto-generated method stub
+
+ }
+
protected void orderDatabaseAction(MenuManager database) {
// TODO Auto-generated method stub
@@ -771,6 +785,18 @@
}
}
}
+
+ protected boolean isCalcDescriptor(Object descriptor) {
+ if (descriptor instanceof CommandParameter) {
+ CommandParameter parameter = (CommandParameter) descriptor;
+ if (parameter.getValue() != null) {
+ if (AdapterFactoryEditingDomain.unwrap(parameter.getValue()) instanceof Counter) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
private boolean isDatabaseDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
@@ -784,7 +810,7 @@
return false;
}
- private boolean isFragmentRouting(Object descriptor) {
+ private boolean isFragmentRoutingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -802,7 +828,7 @@
return false;
}
- private boolean isScripting(Object descriptor) {
+ private boolean isScriptingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -814,7 +840,7 @@
return false;
}
- private boolean isDatasources(Object descriptor) {
+ private boolean isDatasourcesDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -829,7 +855,7 @@
return false;
}
- private boolean isJavaBinding(Object descriptor) {
+ private boolean isJavaBindingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -841,7 +867,7 @@
return false;
}
- private boolean isTemplate(Object descriptor) {
+ private boolean isTemplateDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -856,7 +882,7 @@
return false;
}
- private boolean isReader(Object descriptor) {
+ private boolean isReaderDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-12 07:02:01 UTC (rev 15218)
@@ -24,6 +24,7 @@
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor.PropertyValueWrapper;
@@ -90,7 +91,7 @@
public void createContents(Composite parent) {
parent.setLayout(new FillLayout());
- section = formToolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section = formToolkit.createSection(parent, Section.TITLE_BAR);
Composite client = formToolkit.createComposite(section);
section.setLayout(new FillLayout());
@@ -187,7 +188,7 @@
if (marker.getMarkerType() != IFieldMarker.TYPE_ERROR)
marker.setMarkerType(IFieldMarker.TYPE_ERROR);
}
-
+
if (diagnostic.getSeverity() == Diagnostic.WARNING) {
if (marker.getMarkerType() != IFieldMarker.TYPE_WARINING)
marker.setMarkerType(IFieldMarker.TYPE_WARINING);
@@ -436,7 +437,12 @@
protected void refreshWhenSelectionChanged() {
Object model = getModel();
if (model instanceof EObject) {
- String text = ((EObject) model).eClass().getName();
+ IItemLabelProvider labelProvider = (IItemLabelProvider) this.editingDomain.getAdapterFactory().adapt(model,
+ IItemLabelProvider.class);
+ String text = labelProvider.getText(model);
+ if (text == null || text.length() == 0) {
+ text = ((EObject) model).eClass().getName();
+ }
section.setText(text);
section.setDescription("Details of " + text + ". Required fields are denoted by \"*\".");
section.layout();
15 years, 5 months
JBoss Tools SVN: r15217 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist and 41 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-05-11 20:52:12 -0400 (Mon, 11 May 2009)
New Revision: 15217
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
Log:
fix PMD violations after local build is finally up on Eclipse 3.5M7
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -215,9 +215,6 @@
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return false;
- } catch (Exception x) {
- JSFExtensionsPlugin.log("", x);
- return false;
} finally {
smw.dispose();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -99,34 +99,30 @@
updateActiveContentAssistProcessor(document);
ICompletionProposal[] proposals = super.computeCompletionProposals(viewer, documentPosition);
// If proposal list from super is empty to try to get it from Red Hat dinamic jsp content assist processor.
- try {
- if(proposals.length == 0) {
- String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
- IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
- if (!(p instanceof CSSContentAssistProcessor)) {
+ if(proposals.length == 0) {
+ String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
+ IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
+ if (!(p instanceof CSSContentAssistProcessor)) {
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition);
- Node node = (Node) treeNode;
-
- while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
- node = node.getParentNode();
- IDOMNode xmlnode = (IDOMNode) node;
- if(xmlnode!=null) {
- fTextViewer = viewer;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
- if(completionRegion!=null) {
- String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
- ContentAssistRequest contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
- if(contentAssistRequest!=null) {
- proposals = contentAssistRequest.getCompletionProposals();
- }
+ IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition);
+ Node node = (Node) treeNode;
+
+ while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
+ node = node.getParentNode();
+ IDOMNode xmlnode = (IDOMNode) node;
+ if(xmlnode!=null) {
+ fTextViewer = viewer;
+ IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+ ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
+ if(completionRegion!=null) {
+ String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
+ ContentAssistRequest contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
+ if(contentAssistRequest!=null) {
+ proposals = contentAssistRequest.getCompletionProposals();
}
}
}
}
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
}
proposals = getUniqProposals(proposals);
return proposals;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -1115,9 +1115,18 @@
Boolean b = (Boolean) m.invoke(getSelectionProvider(),
new Object[0]);
return b.booleanValue();
- } catch (Exception e) {
+ } catch (NoSuchMethodException e) {
firingSelectionFailedCount++;
JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
}
return false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -66,8 +66,12 @@
Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
}
- } catch (Exception e) {
+ } catch (IllegalAccessException e) {
JspEditorPlugin.getPluginLog().logError(e);
+ } catch (ClassNotFoundException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -19,22 +19,26 @@
import java.util.Set;
import java.util.Stack;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySheetEntry;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySource2;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.*;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.*;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
+import org.jboss.tools.common.kb.AttributeDescriptor;
+import org.jboss.tools.common.kb.TagDescriptor;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
@@ -45,10 +49,6 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.jboss.tools.common.kb.AttributeDescriptor;
-import org.jboss.tools.common.kb.TagDescriptor;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-
/**
* @author Kabanovich
* XMLPropertySourceAdapter extension that overrides
@@ -547,12 +547,8 @@
} else {
if (attr instanceof IDOMNode) {
((IDOMNode) attr).setValueSource(valueString);
- try {
- IVisualController controller = valueHelper.getController();
- if(controller != null) controller.visualRefresh();
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
+ IVisualController controller = valueHelper.getController();
+ if(controller != null) controller.visualRefresh();
} else {
attr.setValue(valueString);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -256,8 +256,6 @@
}
/// wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
}
- } catch(Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error in activating prompting suppport", x);
} finally {
if(model != null) {
model.releaseFromRead();
@@ -277,7 +275,7 @@
try {
pageConnector = (WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, document);
registerTaglibs(pageConnector, document);
- } catch (Exception e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -15,6 +15,7 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
@@ -41,7 +42,7 @@
IDocument document = te.getTextViewer().getDocument();
try {
new JSPFormatter().format(document, textSelection);
- } catch (Exception e) {
+ } catch (BadLocationException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -31,7 +31,7 @@
int start = -1;
int end = -1;
- public void format(IDocument document, TextSelection textSelection) throws Exception {
+ public void format(IDocument document, TextSelection textSelection) throws BadLocationException {
selectionStart = textSelection.getOffset();
selectionEnd = selectionStart + textSelection.getLength();
text = document.get();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -111,15 +111,11 @@
String entity = support.getTarget().getModel().getEntityRecognizer().getEntityName("xml", body);
if(entity == null || !entity.startsWith("FileWebApp")) throw new XModelException("File " + location + "is not recognized as web descriptor file.");
XModelObject webxml = null;
- try {
- webxml = support.getTarget().getModel().createModelObject(entity, null);
- webxml.setAttributeValue("name", "web");
- XModelObjectLoaderUtil.setTempBody(webxml, body);
- XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
- webxml.getChildren();
- } catch (Exception e) {
- throw new XModelException("Cannot load web descriptor file " + location + ".");
- }
+ webxml = support.getTarget().getModel().createModelObject(entity, null);
+ webxml.setAttributeValue("name", "web");
+ XModelObjectLoaderUtil.setTempBody(webxml, body);
+ XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
+ webxml.getChildren();
if("yes".equals(webxml.getAttributeValue("isIncorrect")))
throw new XModelException("Web descriptor file " + location + "is corrupted.");
webxmlLocation = location;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,9 +10,10 @@
******************************************************************************/
package org.jboss.tools.jst.web.model.helpers.autolayout;
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.jst.web.WebModelPlugin;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.jst.web.model.helpers.WebProcessStructureHelper;
import org.jboss.tools.jst.web.model.process.WebProcessConstants;
@@ -41,11 +42,7 @@
public void setProcess(XModelObject process) {
this.process = process;
- try {
- load();
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
+ load();
}
private void load() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -29,47 +29,39 @@
public int indentY = 16;
public void update() {
- try {
- XModel model = PreferenceModelUtilities.getPreferenceModel();
- XModelObject o = model.getByPath("%Options%/Struts Studio/Editors/Web Flow Diagram");
- String g = o.getAttributeValue("Grid Step");
- int step = Integer.parseInt(g);
- indentX = (step < 24) ? 24 : step;
- indentY = (step < 16) ? 16 : step;
- if(step == 16) {
- deltaX = 208;
- deltaY = 112;
- incX = 16;
- incY = 32;
- indentX = 32;
- } else if(step == 24) {
- deltaX = 240;
- deltaY = 120;
- incX = 24;
- incY = 24;
- } else if(step == 32) {
- deltaX = 256;
- deltaY = 128;
- incX = 32;
- incY = 32;
- } else if(step == 40) {
- deltaX = 240;
- deltaY = 120;
- incX = 40;
- incY = 40;
- } else {
- deltaX = DELTA_X;
- deltaY = DELTA_Y;
- incX = X_INC;
- incY = Y_INC;
- }
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
+ XModel model = PreferenceModelUtilities.getPreferenceModel();
+ XModelObject o = model.getByPath("%Options%/Struts Studio/Editors/Web Flow Diagram");
+ String g = o.getAttributeValue("Grid Step");
+ int step = Integer.parseInt(g);
+ indentX = (step < 24) ? 24 : step;
+ indentY = (step < 16) ? 16 : step;
+ if(step == 16) {
+ deltaX = 208;
+ deltaY = 112;
+ incX = 16;
+ incY = 32;
+ indentX = 32;
+ } else if(step == 24) {
+ deltaX = 240;
+ deltaY = 120;
+ incX = 24;
+ incY = 24;
+ } else if(step == 32) {
+ deltaX = 256;
+ deltaY = 128;
+ incX = 32;
+ incY = 32;
+ } else if(step == 40) {
+ deltaX = 240;
+ deltaY = 120;
+ incX = 40;
+ incY = 40;
+ } else {
deltaX = DELTA_X;
deltaY = DELTA_Y;
incX = X_INC;
incY = Y_INC;
- }
+ }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -19,6 +19,7 @@
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.ServerType;
import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -92,22 +93,17 @@
IModule[] add = new IModule[]{m};
IModule[] remove = new IModule[0];
try {
- try {
- server.getRootModules(m, null);
- } catch (CoreException ce) {
- WebModelPlugin.getPluginLog().logError(ce);
- return ce.getStatus().getMessage();
- }
-
- IProgressMonitor monitor = new NullProgressMonitor();
- IServerWorkingCopy copy = server.createWorkingCopy();
- IStatus status = copy.canModifyModules(add, remove, monitor);
- if(status != null && !status.isOK()) return status.getMessage();
- return null;
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- return WebUIMessages.CANNOT_REGISTER_IN_THIS_SERVER;
+ server.getRootModules(m, null);
+ } catch (CoreException ce) {
+ WebModelPlugin.getPluginLog().logError(ce);
+ return ce.getStatus().getMessage();
}
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ IStatus status = copy.canModifyModules(add, remove, monitor);
+ if(status != null && !status.isOK()) return status.getMessage();
+ return null;
}
public static void register(IProject project) {
@@ -131,7 +127,7 @@
if(canPublish(server)) {
server.publish(IServer.PUBLISH_INCREMENTAL, monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
}
@@ -167,7 +163,7 @@
if(canPublish(server)) {
server.publish(IServer.PUBLISH_INCREMENTAL, monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
return true;
@@ -238,7 +234,7 @@
} else {
ModelPlugin.getWorkspace().run(new WR(), monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
return Status.OK_STATUS;
@@ -248,7 +244,7 @@
public void run(IProgressMonitor monitor) throws CoreException {
try {
register(p, servers, contextRoot, monitor);
- } catch (Exception e) {
+ } catch (XModelException e) {
WebModelPlugin.getPluginLog().logError(e);
}
}
@@ -256,7 +252,7 @@
}
}
- private static void register(IProject p, IServer[] servers, String contextRoot, IProgressMonitor monitor) throws Exception {
+ private static void register(IProject p, IServer[] servers, String contextRoot, IProgressMonitor monitor) throws XModelException {
if(monitor != null) monitor.beginTask("", 100);
if(monitor != null) monitor.worked(5);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.model;
+import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileAuxiliary;
import org.jboss.tools.common.model.filesystems.impl.AbstractXMLFileImpl;
@@ -121,7 +123,7 @@
XModelObjectLoaderUtil.setTempBody(process, sw.toString());
aux.write(object.getParent(), object, process);
return true;
- } catch (Exception exc) {
+ } catch (IOException exc) {
ModelPlugin.getPluginLog().logError(exc);
return false;
}
@@ -133,17 +135,19 @@
if(systemId == null || systemId.length() == 0) systemId = DOC_EXTDTD;
String publicId = DOC_PUBLICID;
Element element = XMLUtil.createDocumentElement(object.getModelEntity().getXMLSubPath(), DOC_QUALIFIEDNAME, publicId, systemId, null);
-
+ String result = null;
try {
util.setup(null, false);
String att = object.getAttributeValue("comment");
if (att.length() > 0) util.saveAttribute(element, "#comment", att);
util.saveChildren(element, object);
- return SimpleWebFileLoader.serialize(element, object);
- } catch (Exception e) {
+ result = SimpleWebFileLoader.serialize(element, object);
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
- return null;
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
}
+ return result;
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,8 +10,9 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.model;
-import org.jboss.tools.common.log.LogHelper;
-import org.jboss.tools.common.model.loaders.*;
+import java.io.IOException;
+
+import org.jboss.tools.common.model.loaders.EntityRecognizer;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.xml.XMLEntityResolver;
@@ -19,7 +20,7 @@
static {
try {
XMLEntityResolver.registerPublicEntity(TilesConstants.DOC_PUBLICID, FileTilesRecognizer.class, "/meta/tiles_config_1_1.dtd");
- } catch (Exception e) {
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -34,12 +34,7 @@
}
public Shell getShell() {
- try {
- return TilesUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- } catch(Exception e){
- getPluginLog().logError("Exception:", e);
- return null;
- }
+ return TilesUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
}
public static TilesUIPlugin getDefault() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -13,6 +13,7 @@
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.jboss.tools.common.editor.AbstractSelectionProvider;
@@ -69,7 +70,7 @@
guiEditor.addErrorSelectionListener(createErrorSelectionListener());
selectionProvider.addHost(
"guiEditor", guiEditor.getSelectionProvider()); //$NON-NLS-1$
- } catch (Exception e) {
+ } catch (PartInitException e) {
TilesUIPlugin.getPluginLog().logError(e);
}
}
@@ -81,11 +82,7 @@
public void dispose() {
if(input != null) {
selectionProvider.setHost(null);
- try {
- getSite().setSelectionProvider(null);
- } catch (Exception e) {
- TilesUIPlugin.getPluginLog().logError(e);
- }
+ getSite().setSelectionProvider(null);
}
super.dispose();
if(guiEditor != null) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,20 +10,19 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.ui.editor;
-import org.jboss.tools.common.editor.AbstractSectionEditor;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.layout.GridData;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
-
-import org.jboss.tools.common.log.LogHelper;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.common.editor.AbstractSectionEditor;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.jst.web.tiles.ui.TilesUIPlugin;
import org.jboss.tools.jst.web.tiles.ui.editor.model.impl.TilesModel;
+import org.xml.sax.SAXException;
public class TilesGuiEditor extends AbstractSectionEditor {
private TilesEditor gui = null;
@@ -77,8 +76,10 @@
wrapper.update();
wrapper.layout();
- } catch (Exception ex) {
+ } catch (SAXException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
+ } catch (PartInitException ex) {
+ TilesUIPlugin.getPluginLog().logError(ex);
}
}
@@ -96,11 +97,7 @@
if(gui != null) {
gui.dispose();
gui = null;
- try {
- control.dispose();
- } catch (Exception e) {
- TilesUIPlugin.getPluginLog().logError(e);
- }
+ control.dispose();
control = null;
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -106,14 +106,8 @@
public void updateModelModifiedProperty(Object oldValue, Object newValue) {
if (getTilesModel() != null) {
- try {
- if (!oldValue.equals(newValue))
- ;
+ if (!oldValue.equals(newValue)) {
getTilesModel().setModified(true);
- } catch (Exception exception) {
- TilesUIPlugin.getPluginLog().logError(exception);
- if (newValue != null)
- getTilesModel().setModified(true);
}
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,18 +10,24 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.ui.editor.model.impl;
-import java.util.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
-import org.xml.sax.*;
-
-import java.beans.*;
-
import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Control;
-
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.event.*;
+import org.eclipse.swt.widgets.Menu;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.event.XModelTreeEvent;
+import org.jboss.tools.common.model.event.XModelTreeListener;
+import org.jboss.tools.common.model.ui.action.XModelObjectActionList;
+import org.jboss.tools.common.model.ui.util.ModelUtilities;
+import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
import org.jboss.tools.jst.web.tiles.TilesPreference;
import org.jboss.tools.jst.web.tiles.model.helpers.TilesStructureHelper;
@@ -34,12 +40,8 @@
import org.jboss.tools.jst.web.tiles.ui.editor.model.ITilesModelListener;
import org.jboss.tools.jst.web.tiles.ui.editor.model.ITilesOptions;
import org.jboss.tools.jst.web.tiles.ui.preferences.TilesEditorTabbedPreferencesPage;
+import org.xml.sax.SAXException;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.ui.action.*;
-import org.jboss.tools.common.model.ui.util.ModelUtilities;
-import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
-
public class TilesModel extends TilesElement implements ITilesModel, PropertyChangeListener, XModelTreeListener {
List<IDefinition> visibleDefinitions = new Vector<IDefinition>();
static final int DEFAULT_VERTICAL_SPACING = 20;
@@ -73,7 +75,7 @@
public TilesModel() {
try {
setName(WebUIMessages.STRUTS_MODEL);
- } catch (Exception ex) {
+ } catch (PropertyVetoException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
}
}
@@ -102,7 +104,7 @@
return options;
}
- public TilesModel(Object data) throws SAXException, Exception {
+ public TilesModel(Object data) throws SAXException {
this();
setData(data);
map.setData((XModelObject) data);
@@ -181,7 +183,7 @@
XModelTreeListenerSWTSync listener = null;
- public void setData(Object data) throws Exception {
+ public void setData(Object data) {
source = helper.getProcess((XModelObject) data);
if (source == null) {
return;
@@ -300,7 +302,6 @@
}
public void nodeChanged(XModelTreeEvent event) {
- try {
if (map == null)
return;
fireProcessChanged();
@@ -316,33 +317,26 @@
return;
}
element.nodeChanged(event);
- } catch (Exception x) {
- TilesUIPlugin.getPluginLog().logError("Error in processing model event", x);
- }
}
public void structureChanged(XModelTreeEvent event) {
TilesElement element;
- try {
- Object obj = event.getModelObject().getPath();
- if (obj == null)
- return;
- if (map == null)
- return;
- element = (TilesElement) map.get(obj);
- if (element == null) {
- return;
- }
- if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
- element.structureChanged(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
- element.nodeAdded(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
- element.nodeRemoved(event);
- }
- } catch (Exception x) {
- TilesUIPlugin.getPluginLog().logError("Error in processing model event", x);
+ Object obj = event.getModelObject().getPath();
+ if (obj == null)
+ return;
+ if (map == null)
+ return;
+ element = (TilesElement) map.get(obj);
+ if (element == null) {
+ return;
}
+ if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
+ element.structureChanged(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
+ element.nodeAdded(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
+ element.nodeRemoved(event);
+ }
}
public void putToMap(Object key, Object value) {
@@ -560,7 +554,7 @@
if (str.indexOf("default") >= 0)return DEFAULT_VERTICAL_SPACING; //$NON-NLS-1$
try {
return Integer.parseInt(str);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
return DEFAULT_VERTICAL_SPACING;
}
@@ -573,7 +567,7 @@
if (str.indexOf("default") >= 0)return DEFAULT_HORIZONTAL_SPACING; //$NON-NLS-1$
try {
return Integer.parseInt(str);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
return DEFAULT_HORIZONTAL_SPACING;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -131,18 +131,14 @@
protected XFilteredTree getFilteredTree(Object object) {
XFilteredTree result = null;
if (result == null && object instanceof XModelObject) {
- try {
- XModel model = ((XModelObject)object).getModel();
- String n = getFilteredTreeName(model);
- result = FilteredTreesCache.getInstance().getFilteredTree(n, model);
- if(result == null) return null;
- if(result.getRoot() == null) {
- result = null;
- } else {
- FilteredTreesCache.getInstance().addListener(syncListener, model);
- }
- } catch(Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
+ XModel model = ((XModelObject)object).getModel();
+ String n = getFilteredTreeName(model);
+ result = FilteredTreesCache.getInstance().getFilteredTree(n, model);
+ if(result == null) return null;
+ if(result.getRoot() == null) {
+ result = null;
+ } else {
+ FilteredTreesCache.getInstance().addListener(syncListener, model);
}
}
return result;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -38,24 +38,26 @@
}
public void initialCheckListItem(File listElement) {
- setCurrentTreeSelection(listElement.getParentFile());
- try {
- super.listItemChecked(listElement, true, true);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
+ super.listItemChecked(listElement, true, true);
setCurrentTreeSelection(null);
}
public CheckboxTreeViewer getTreeViewer() {
+ CheckboxTreeViewer viewer = null;
try {
Field f = cls.getDeclaredField("treeViewer");
f.setAccessible(true);
- return (CheckboxTreeViewer)f.get(this);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- return null;
- }
+ viewer = (CheckboxTreeViewer)f.get(this);
+ } catch (SecurityException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (NoSuchFieldException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
+ return viewer;
}
public void setExpansions() {
@@ -68,13 +70,19 @@
}
private void setCurrentTreeSelection(Object element) {
- try {
- Field f = cls.getDeclaredField("currentTreeSelection");
+ Field f;
+ try {
+ f = cls.getDeclaredField("currentTreeSelection");
f.setAccessible(true);
f.set(this, element);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
+ } catch (SecurityException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (NoSuchFieldException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
}
-
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.wizards.project;
+import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
import org.eclipse.core.runtime.CoreException;
@@ -82,7 +83,7 @@
public boolean performFinish() {
if(!checkOldVersion()) return false;
- boolean result = true;
+ boolean result = false;
try {
if(!checkServletVersion()) return false;
context.commitSupportDelta();
@@ -90,9 +91,15 @@
getContainer().run(false, true, op);
updatePerspective();
BasicNewResourceWizard.selectAndReveal(context.getProjectHandle(), ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- } catch (Exception ex) {
+ result = true;
+ } catch (XModelException ex) {
WebUiPlugin.getPluginLog().logError(ex);
- result = false;
+ } catch (CoreException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
+ } catch (InvocationTargetException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
+ } catch (InterruptedException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
}
return result;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -349,14 +349,7 @@
setErrorMessage(nameStatus.getMessage());
return false;
}
- IProject project = null;
- try {
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- setErrorMessage(e.getMessage());
- return false;
- }
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if(project != null && project.exists() && !project.isOpen()) {
setErrorMessage(NLS.bind(WebUIMessages.PROJECT_EXISTS_IN_WORKSPACE, getProjectNameValue()) );
@@ -399,13 +392,9 @@
}
private void updateContext(boolean onProjectNameEdit, boolean onProjectLocationEdit) {
- try {
if (getWebXmlFile() != null) updateProjectNameValue(onProjectNameEdit, onProjectLocationEdit);
context.setProjectName(getProjectNameValue());
context.setWebXmlLocation(getWebXmlLocationValue());
- } catch (Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
- }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.wizards.project;
+import java.lang.reflect.InvocationTargetException;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
@@ -61,7 +63,6 @@
public boolean performFinish() {
boolean result = true;
- try {
mainPage.commit();
context.setServletVersion("2.4");
@@ -70,19 +71,21 @@
}
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(createOperation());
- getContainer().run(false, true, op);
+ try {
+ getContainer().run(false, true, op);
+ } catch (InvocationTargetException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (InterruptedException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
updatePerspective();
BasicNewResourceWizard.selectAndReveal(context.getProjectHandle(), ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- } catch (Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
- result = false;
- }
return result;
}
protected abstract IRunnableWithProgress createOperation();
- protected void updatePerspective() throws CoreException {
+ protected void updatePerspective() {
BasicNewProjectResourceWizard.updatePerspective(new ConfigurationElementInternal());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -83,7 +83,7 @@
* @return
*/
public boolean isChildrenAffected() {
- return children != null && children.size() > 0;
+ return children != null && !children.isEmpty();
}
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -246,7 +246,7 @@
}
public ISeamJavaComponentDeclaration getJavaDeclaration() {
- if(javaDeclarations.size() == 0) return null;
+ if(javaDeclarations.isEmpty()) return null;
return javaDeclarations.iterator().next();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -518,7 +518,7 @@
element.setAttribute(ATTR_CLASS_NAME, className);
}
- if(bijectedAttributes.size() > 0) {
+ if(!bijectedAttributes.isEmpty()) {
Element b = XMLUtilities.createElement(element, "bijected");
for (IBijectedAttribute a: bijectedAttributes) {
SeamObject o = (SeamObject)a;
@@ -526,7 +526,7 @@
}
}
- if(componentMethods.size() > 0) {
+ if(!componentMethods.isEmpty()) {
Element b = XMLUtilities.createElement(element, "methods");
for (ISeamComponentMethod a: componentMethods) {
SeamObject o = (SeamObject)a;
@@ -534,7 +534,7 @@
}
}
- if(roles.size() > 0) {
+ if(!roles.isEmpty()) {
Element b = XMLUtilities.createElement(element, "roles");
for (IRole a: roles) {
SeamObject o = (SeamObject)a;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -120,7 +120,7 @@
}
}
}
- if(ds.size() == 0) {
+ if(ds.isEmpty()) {
names.add("messages");
}
return getResources(names, srcs);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -111,7 +111,7 @@
public static void collectAllPackages(Map<String, ISeamPackage> packages, Collection<ISeamPackage> list) {
for (ISeamPackage p : packages.values()) {
- if(p.getComponents().size() > 0) list.add(p);
+ if(!p.getComponents().isEmpty()) list.add(p);
collectAllPackages(p.getPackages(), list);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -526,7 +526,7 @@
Element pathElement = XMLUtilities.createElement(sourcePathsElement, "path"); //$NON-NLS-1$
pathElement.setAttribute("value", path.toString()); //$NON-NLS-1$
List<ISeamComponentDeclaration> cs = ds.getComponents();
- if(cs != null && cs.size() > 0) {
+ if(cs != null && !cs.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "components"); //$NON-NLS-1$
for (ISeamComponentDeclaration d: cs) {
SeamObject o = (SeamObject)d;
@@ -534,7 +534,7 @@
}
}
List<ISeamFactory> fs = ds.getFactories();
- if(fs != null && fs.size() > 0) {
+ if(fs != null && !fs.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "factories"); //$NON-NLS-1$
for (ISeamFactory d: fs) {
SeamObject o = (SeamObject)d;
@@ -542,7 +542,7 @@
}
}
List<String> imports = ds.getImports();
- if(imports != null && imports.size() > 0) {
+ if(imports != null && !imports.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "imports"); //$NON-NLS-1$
for (String d: imports) {
Element e = XMLUtilities.createElement(cse, SeamXMLConstants.TAG_IMPORT); //$NON-NLS-1$
@@ -777,7 +777,7 @@
ISeamComponentDeclaration[] components = ds.getComponents().toArray(new ISeamComponentDeclaration[0]);
ISeamFactory[] factories = ds.getFactories().toArray(new ISeamFactory[0]);
- if(ns.length == 0 && components.length == 0 && factories.length == 0 && ds.getImports().size() == 0) {
+ if(ns.length == 0 && components.length == 0 && factories.length == 0 && ds.getImports().isEmpty()) {
pathRemoved(source);
if(EclipseResourceUtil.isJar(source.toString())) {
if(!sourcePaths.contains(source)) sourcePaths.add(source);
@@ -792,7 +792,7 @@
namespaces.addPath(source, ns);
}
- if(ds.getImports().size() > 0) {
+ if(!ds.getImports().isEmpty()) {
setImports(source.toString(), ds.getImports());
} else {
removeImports(source.toString());
@@ -828,7 +828,7 @@
if(isClassNameChanged(currentClassName, loadedClassName)) {
this.components.onClassNameChanged(currentClassName, loadedClassName, current);
}
- if(changes != null && changes.size() > 0) {
+ if(changes != null && !changes.isEmpty()) {
Change cc = new Change(c, null, null, null);
cc.addChildren(changes);
List<Change> cchanges = Change.addChange(null, cc);
@@ -947,7 +947,7 @@
* @throws CloneNotSupportedException
*/
public void registerComponentsInDependentProjects(LoadedDeclarations ds, IPath source) throws CloneNotSupportedException {
- if(usedBy.size() == 0) return;
+ if(usedBy.isEmpty()) return;
if(EclipseResourceUtil.isJar(source.toString())) return;
for (SeamProject p : usedBy) {
@@ -1062,7 +1062,7 @@
}
public void firePathRemovedToDependentProjects(IPath source) {
- if(usedBy.size() == 0) return;
+ if(usedBy.isEmpty()) return;
if(EclipseResourceUtil.isJar(source.toString())) return;
for (SeamProject p : usedBy) {
@@ -1134,7 +1134,7 @@
*
*/
private boolean isComponentEmpty(SeamComponent c) {
- if(c.getAllDeclarations().size() == 0) return true;
+ if(c.getAllDeclarations().isEmpty()) return true;
for (ISeamComponentDeclaration d: c.getAllDeclarations()) {
if(c.getName().equals(d.getName())) return false;
}
@@ -1512,7 +1512,7 @@
* @param changes
*/
void fireChanges(List<Change> changes) {
- if(changes == null || changes.size() == 0) return;
+ if(changes == null || changes.isEmpty()) return;
if(postponedChanges != null) {
postponedChanges.addAll(changes);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -89,7 +89,7 @@
} else {
String oldName = p1.getName();
List<Change> cc = p1.merge(p2);
- if(cc != null && cc.size() > 0) children.addChildren(cc);
+ if(cc != null && !cc.isEmpty()) children.addChildren(cc);
if(oldName != null && !oldName.equals(p1.getName())) {
properties.remove(oldName);
addProperty(p1);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -76,7 +76,7 @@
changes = Change.addChange(changes, new Change(this, SeamXMLConstants.ATTR_VALUE, old, value));
} else {
List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
- if(cs != null && cs.size() > 0) {
+ if(cs != null && !cs.isEmpty()) {
Change c = new Change(this, SeamXMLConstants.ATTR_VALUE, value, value);
c.addChildren(cs);
changes = Change.addChange(changes, c);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -54,14 +54,14 @@
SeamValueMapEntry e = (SeamValueMapEntry)s;
List<Change> keyChanges = key.merge(e.key);
- if(keyChanges != null && keyChanges.size() > 0) {
+ if(keyChanges != null && !keyChanges.isEmpty()) {
Change keyChange = new Change(this, "key", key, key); //$NON-NLS-1$
keyChange.addChildren(keyChanges);
changes = Change.addChange(changes, keyChange);
}
List<Change> valueChanges = value.merge(e.value);
- if(valueChanges != null && valueChanges.size() > 0) {
+ if(valueChanges != null && !valueChanges.isEmpty()) {
Change valueChange = new Change(this, "value", value, value); //$NON-NLS-1$
valueChange.addChildren(valueChanges);
changes = Change.addChange(changes, valueChange);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -210,7 +210,7 @@
}
public static void saveMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
- if(map == null || map.size() == 0) return;
+ if(map == null || map.isEmpty()) return;
Element element = XMLUtilities.createElement(parent, child);
for (String name: map.keySet()) {
IValueInfo value = map.get(name);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -292,7 +292,7 @@
ELParser p = factory.createParser();
ELModel model = p.parse(el);
List<ELInstance> is = model.getInstances();
- if(is.size() == 0) return null;
+ if(is.isEmpty()) return null;
return is.get(0).getExpression();
}
@@ -402,7 +402,7 @@
}
// Save all resolved variables. It's useful for incremental validation.
- if(resolvedVariables != null && resolvedVariables.size() > 0) {
+ if(resolvedVariables != null && !resolvedVariables.isEmpty()) {
status.setUsedVariables(resolvedVariables);
}
@@ -539,7 +539,7 @@
}
}
members = newMembers;
- if (members != null && members.size() > 0)
+ if (members != null && !members.isEmpty())
status.setLastResolvedToken(expr);
}
if (expr.getType() == ELObjectType.EL_METHOD_INVOCATION) {
@@ -562,7 +562,7 @@
}
}
members = newMembers;
- if (members != null && members.size() > 0)
+ if (members != null && !members.isEmpty())
status.setLastResolvedToken(expr);
}
return members;
@@ -834,7 +834,7 @@
if (varName != null) {
resolvedVars = SeamExpressionResolver.resolveVariables(project, scope, varName, onlyEqualNames);
}
- if (resolvedVars != null && resolvedVars.size() > 0) {
+ if (resolvedVars != null && !resolvedVars.isEmpty()) {
List<ISeamContextVariable> newResolvedVars = new ArrayList<ISeamContextVariable>();
for (ISeamContextVariable var : resolvedVars) {
if(!isFinal) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -347,7 +347,7 @@
if(member == null) {
ELParser p = ELParserUtil.getJbossFactory().createParser();
ELModel m = p.parse(factory.getValue());
- ELInstance i = m.getInstances().size() == 0 ? null : m.getInstances().get(0);
+ ELInstance i = m.getInstances().isEmpty() ? null : m.getInstances().get(0);
ELExpression ex = i == null ? null : i.getExpression();
if(ex instanceof ELInvocationExpression) {
ELInvocationExpression expr = (ELInvocationExpression)ex;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -165,7 +165,7 @@
for (Iterator iterator = applications.iterator(); iterator.hasNext();) {
ApplicationType application = (ApplicationType) iterator.next();
EList localeConfigs = application.getLocaleConfig();
- if(localeConfigs.size()>0) {
+ if(!localeConfigs.isEmpty()) {
localeConfigExists = true;
break;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -833,7 +833,7 @@
}
if(names.contains(defaultDs)) {
model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, defaultDs);
- } else if(names.size()>0) {
+ } else if(!names.isEmpty()) {
model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, names.get(0));
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -62,7 +62,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProperties.size()>0;
+ return !relevantProperties.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -57,7 +57,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProperties.size()>0;
+ return !relevantProperties.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -66,7 +66,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantPropertyIndexes.size()>0;
+ return !relevantPropertyIndexes.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -62,7 +62,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProjectNameProperties.size() > 0 || relevantSourceFolderProperties.size() > 0;
+ return !relevantProjectNameProperties.isEmpty() || !relevantSourceFolderProperties.isEmpty();
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -59,7 +59,7 @@
AnnotatedASTNode<MethodDeclaration> currentAnnotatedMethod = null;
public boolean hasSeamComponentItself() {
- if(annotatedFields.size() > 0 || annotatedMethods.size() > 0) return true;
+ if(!annotatedFields.isEmpty() || !annotatedMethods.isEmpty()) return true;
if(annotatedType != null && annotatedType.getAnnotations() != null) return true;
return false;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
types.put(BeanType.values()[i], v);
}
}
- if(types.size() > 0) {
+ if(!types.isEmpty()) {
component.setTypes(types);
}
}
@@ -171,7 +171,7 @@
for (AnnotatedASTNode<MethodDeclaration> n: annotatedMethods) {
Annotation main = getBijectedType(n, as, types);
- if(as.size() == 0) continue;
+ if(as.isEmpty()) continue;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
MethodDeclaration m = n.getNode();
@@ -213,7 +213,7 @@
for (AnnotatedASTNode<FieldDeclaration> n: annotatedFields) {
Annotation main = getBijectedType(n, as, types);
- if(as.size() == 0) continue;
+ if(as.isEmpty()) continue;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
FieldDeclaration m = n.getNode();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -163,7 +163,7 @@
types.put(t, v);
}
}
- if(types.size() > 0) {
+ if(!types.isEmpty()) {
component.setTypes(types);
}
@@ -239,7 +239,7 @@
types.add(BijectedAttributeType.values()[i]);
}
}
- if(as.size() == 0) return;
+ if(as.isEmpty()) return;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -351,7 +351,7 @@
private void validateComponent(IPath sourceFilePath, Set<ISeamComponent> checkedComponents, Set<IPath> unnamedResources) {
Set<ISeamComponent> components = seamProject.getComponentsByPath(sourceFilePath);
- if(components.size()==0) {
+ if(components.isEmpty()) {
unnamedResources.add(sourceFilePath);
return;
}
@@ -591,7 +591,7 @@
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
ISeamTextSourceReference classNameLocation = getNameLocation(javaDeclaration);
Set<ISeamComponentMethod> methods = javaDeclaration.getMethodsByType(methodType);
- if(methods==null || methods.size()==0) {
+ if(methods==null || methods.isEmpty()) {
addError(STATEFUL_COMPONENT_DOES_NOT_CONTAIN_METHOD_SUFIX_MESSAGE_ID + postfixMessageId, preferenceKey, new String[]{component.getName()}, classNameLocation, javaDeclaration.getResource());
}
}
@@ -736,7 +736,7 @@
private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType, ISeamJavaComponentDeclaration declaration, String sufixMessageId, String preferenceKey) {
Set<ISeamComponentMethod> methods = declaration.getMethodsByType(methodType);
- if(methods!=null && methods.size()>0) {
+ if(methods!=null && !methods.isEmpty()) {
for (ISeamComponentMethod method : methods) {
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -332,7 +332,7 @@
ELParser parser = ELParserUtil.getJbossFactory().createParser();
ELModel model = parser.parse(string);
List<SyntaxError> errors = model.getSyntaxErrors();
- if(errors.size() > 0) {
+ if(!errors.isEmpty()) {
for (SyntaxError error: errors) {
//TODO 1) make message more informative
// 2) create other preference
@@ -345,7 +345,7 @@
if (reporter.isCancelled()) {
return;
}
- if(i.getErrors().size() > 0) {
+ if(!i.getErrors().isEmpty()) {
//Already reported syntax problem in this piece of EL.
continue;
}
@@ -385,7 +385,7 @@
}
// Check pair for getter/setter
- if(status.getUnpairedGettersOrSetters().size()>0) {
+ if(!status.getUnpairedGettersOrSetters().isEmpty()) {
TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
String methodName = unpairedMethod.getName();
String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -59,7 +59,7 @@
ISeamValidator[] validators = new ISeamValidator[]{coreValidator, elValidator};
Set<IFile> changedFiles = coreHelper.getChangedFiles();
- if(changedFiles.size()>0) {
+ if(!changedFiles.isEmpty()) {
status = validate(validators, changedFiles);
} else {
// reporter.removeAllMessages(this);
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -50,7 +50,7 @@
Set<Object> updateLocks = new HashSet<Object>();
public boolean isUpdateLocked() {
- return updateLocks.size() > 0;
+ return !updateLocks.isEmpty();
}
public void addUpdateLock(Object lock) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -146,11 +146,7 @@
}
if(stopped) break;
if(!isLocked()) {
- try {
- updateAll();
- } catch (Exception t) {
- SeamPagesXMLPlugin.log("Error while running page update", t);
- }
+ updateAll();
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -78,7 +78,7 @@
Map<String, ISeamMessages> messages = findMessagesComponents(document, superRegion);
- if (messages != null && messages.size() > 0) {
+ if (messages != null && !messages.isEmpty()) {
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
String type = SEAM_MESSAGES_BEAN_PARTITION;
@@ -91,7 +91,7 @@
}
List<IJavaElement> javaElements = findJavaElements(document, superRegion);
- if (javaElements != null && javaElements.size() > 0) {///
+ if (javaElements != null && !javaElements.isEmpty()) {///
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
String type = SEAM_BEAN_PARTITION;
@@ -268,12 +268,12 @@
Utils.findNodeForOffset(xmlDocument, region.getOffset());
Map<String, ISeamMessages> messages = findMessagesComponents(document, region);
- if (messages != null && messages.size() > 0) {
+ if (messages != null && !messages.isEmpty()) {
return true;
}
List<IJavaElement> javaElements = findJavaElements(document, region);
- if (javaElements != null && javaElements.size() > 0) {
+ if (javaElements != null && !javaElements.isEmpty()) {
return true;
}
@@ -324,7 +324,7 @@
}
//Do not need it, vars handled in getJavaElementsForELOperandTokens
- if (javaElements == null || javaElements.size() == 0) {
+ if (javaElements == null || javaElements.isEmpty()) {
// Try to find a local Var (a pair of variable-value attributes)
ElVarSearcher varSearcher = new ElVarSearcher(file, engine);
// Find a Var in the EL
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -210,7 +210,7 @@
}
}
}
- if (hyperlinks != null && hyperlinks.size() > 0) {
+ if (hyperlinks != null && !hyperlinks.isEmpty()) {
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
} catch (JavaModelException jme) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -96,7 +96,7 @@
private void openMessages() {
Map <String, ISeamMessages> messages = fMessages;
- if (messages == null || messages.size() == 0) {
+ if (messages == null || messages.isEmpty()) {
// Nothing to open
return;
}
@@ -104,7 +104,7 @@
for (String property : messages.keySet()) {
ISeamMessages messagesComponent = messages.get(property);
Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.size() == 0)
+ if (resources == null || resources.isEmpty())
continue;
for (String bundle : resources.keySet()) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -98,7 +98,7 @@
if(range == null) range = new int[]{0, document.getLength()};
Map<String, ISeamMessages> messages = findMessagesComponents(document, file, wordRegion, range[0], range[1]);
- if (messages != null && messages.size() > 0)
+ if (messages != null && !messages.isEmpty())
return new IHyperlink[] {new SeamELInJavaStringHyperlink(wordRegion, messages)};
IJavaElement[] elements = findJavaElements(document, file, wordRegion, range[0], range[1]);
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -34,7 +34,7 @@
*/
protected void doHyperlink(IRegion region) {
Map <String, ISeamMessages> messages = SeamBeanHyperlinkPartitioner.findMessagesComponents(getDocument(), region);
- if (messages == null || messages.size() == 0) {
+ if (messages == null || messages.isEmpty()) {
// Nothing to open
openFileFailed();
return;
@@ -43,7 +43,7 @@
for (String property : messages.keySet()) {
ISeamMessages messagesComponent = messages.get(property);
Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.size() == 0)
+ if (resources == null || resources.isEmpty())
continue;
for (String bundle : resources.keySet()) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -35,7 +35,7 @@
if (xModel != null) {
List list = provider.getList(xModel, WebPromptingProvider.JSF_GET_PATH, filename, null);
- if (list != null && list.size() > 0) {
+ if (list != null && !list.isEmpty()) {
for (Iterator i = list.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof String) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -237,7 +237,7 @@
tokens = tokens.getLeft();
}
- if (variables.size() != 0) {
+ if (!variables.isEmpty()) {
// Some variable/variables are found - perform search for their declarations
varNames = new String[variables.size()];
for (int i = 0; i < variables.size(); i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -186,7 +186,7 @@
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
int ok = dialog.open();
- if ((ok == Dialog.OK) && (added.size() > 0)) {
+ if (ok == Dialog.OK && !added.isEmpty()) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
refreshSeamRuntimeCombo();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -223,7 +223,7 @@
tokens = tokens.getLeft();
}
- if (variables.size() != 0) {
+ if (!variables.isEmpty()) {
// Some variable/variables are found - perform search for their declarations
varNames = new String[variables.size()];
for (int i = 0; i < variables.size(); i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -546,7 +546,7 @@
.getSeamRuntimeDefaultValue(model);
if (defaultRnt != null && runtimes.contains(defaultRnt)) {
newValue = defaultRnt;
- } else if (runtimes.size() > 0) {
+ } else if (!runtimes.isEmpty()) {
newValue = runtimes.get(0);
}
} else {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -142,7 +142,7 @@
public Map<String, IStatus> validate(Object value, Object context) {
Map<String, IStatus> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
- if (errors.size() > 0) {
+ if (!errors.isEmpty()) {
errors = createErrorMap();
errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME, new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
SeamUIMessages.VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS));
@@ -180,7 +180,7 @@
public Map<String, IStatus> validate(Object value, Object context) {
Map<String, IStatus> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
- if (errors.size() > 0) {
+ if (!errors.isEmpty()) {
errors = createErrorMap();
errors.put(ISeamFacetDataModelProperties.JBOSS_AS_HOME,
new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -21,6 +21,7 @@
import org.hibernate.connection.ConnectionProvider;
import org.hibernate.exception.SQLExceptionConverter;
import org.hibernate.util.StringHelper;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
/**
* @author Vitali
@@ -104,6 +105,7 @@
metadataDialect.close(tableIterator);
}
} catch (Exception ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
@@ -151,6 +153,7 @@
metadataDialect.close(columnIterator);
}
} catch (Exception ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
@@ -192,6 +195,7 @@
try {
currentCatalog = info.getConnectionProvider().getConnection().getCatalog();
} catch (SQLException ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -301,7 +301,7 @@
*/
public static final Bounds binaryBoundsSearch(List list, String prefix) {
Bounds bounds = new Bounds();
- if (0 == list.size()) {
+ if (list.isEmpty()) {
bounds.nL = bounds.nH = 0;
return bounds;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -493,7 +493,7 @@
private String getDefaultConnectionProfile() {
List<String> names = getProfileNameList();
- return names.size()>0?names.get(0):"";
+ return !names.isEmpty()?names.get(0):"";
}
private String getEjbProjectName() {
@@ -536,7 +536,7 @@
return;
}
Map<String, IStatus> errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(value, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
IStatus status = errors.get(IValidator.DEFAULT_ERROR);
if(IStatus.ERROR == status.getSeverity()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
@@ -886,7 +886,7 @@
SeamRuntime runtime = SeamRuntimeManager.getDefaultRuntimeForProject(getSeamProject());
if(runtime==null) {
List<String> names = getRuntimeNames();
- if(names.size()>0) {
+ if(!names.isEmpty()) {
return names.get(0);
}
return "";
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -57,7 +57,7 @@
ISeamComponent component=null;
if (seamProject != null) {
Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
- if (components.size() > 0) {
+ if (!components.isEmpty()) {
// This is a component which we want to rename.
component = components.iterator().next();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
String variableName = tokens.getText(); //SeamSearchVisitor.tokensToString(tokens);
Set<ISeamContextVariable> variables = seamProject.getVariablesByName(variableName);
- if (variables != null && variables.size() > 0) {
+ if (variables != null && !variables.isEmpty()) {
return search(javaScope, requestor, sourceFile, variables.toArray(new ISeamContextVariable[0]), monitor);
}
@@ -120,7 +120,7 @@
return Status.OK_STATUS;
}
- if (elements != null && elements.size() > 0) {
+ if (elements != null && !elements.isEmpty()) {
return search(javaScope, requestor, sourceFile, elements.toArray(new IJavaElement[0]), monitor);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -431,7 +431,7 @@
}
public void dragStart(DragSourceEvent event) {
- event.doit= convertSelection().size() > 0;
+ event.doit= !convertSelection().isEmpty();
}
public void dragSetData(DragSourceEvent event) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -469,7 +469,7 @@
if (fVarMatchers[i] != null && fVarMatchers[i].getFile() != null)
fileList.add(fVarMatchers[i].getFile());
}
- if (fileList.size() > 0) {
+ if (!fileList.isEmpty()) {
files = fileList.toArray(new IFile[0]);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -460,7 +460,7 @@
}
}
- if (result == null || result.size() == 0) {
+ if (result == null || result.isEmpty()) {
return NO_PROPOSALS;
}
ICompletionProposal[] resultArray = result.toArray(new ICompletionProposal[result.size()]);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -77,7 +77,7 @@
@Override
public Object[] getEditorControls() {
- if(controls.size()>0) return controls.toArray();
+ if(!controls.isEmpty()) return controls.toArray();
else throw new IllegalStateException(SeamUIMessages.COMPOSITE_EDITOR_THIS_METOD_CAN_BE_INVOKED);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -144,7 +144,7 @@
*/
private String checkCollection(Object value){
- return value != null && (((Collection)value).size() > 0) ? prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
+ return value != null && (!((Collection)value).isEmpty()) ? prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -39,7 +39,7 @@
}
radios = new Button[values.size()];
- if(defaultValue==null && values.size()>0) {
+ if(defaultValue==null && !values.isEmpty()) {
defaultValue = values.get(0);
}
for (int i = 0; i < radios.length; i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -95,7 +95,7 @@
protected final void validatePage() {
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(editor.getValueAsString(), seamProject);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_SEAM_COMPONENTS));
setPageComplete(false);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
getEditor(IParameter.SEAM_PROJECT_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
} else if(isWar()) {
@@ -236,7 +236,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_COMPONENT_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_SEAM_COMPONENTS));
setPageComplete(false);
return;
@@ -245,7 +245,7 @@
errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_LOCAL_INTERFACE_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_LOCAL_INTERFACE));
setPageComplete(false);
return;
@@ -255,7 +255,7 @@
errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_BEAN_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),"Bean")); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -265,7 +265,7 @@
IFieldEditor editor = editorRegistry.get(IParameter.SEAM_PACKAGE_NAME);
if(editor!=null) {
errors = ValidatorFactory.PACKAGE_NAME_VALIDATOR.validate(editor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage()); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -275,7 +275,7 @@
errors = ValidatorFactory.SEAM_METHOD_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_METHOD_NAME).getValue(), new Object[]{"Method",project}); //$NON-NLS-1$
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -284,7 +284,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue(), new Object[]{"Page",project}); //$NON-NLS-1$
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -293,7 +293,7 @@
errors = ValidatorFactory.SEAM_JAVA_INTEFACE_NAME_CONVENTION_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_LOCAL_INTERFACE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_BASE_WIZARD_PAGE_LOCAL_INTERFACE,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(null);
setMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage(),IMessageProvider.WARNING);
setPageComplete(true);
@@ -353,7 +353,7 @@
Map<String, IStatus> errors;
String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return false;
@@ -365,7 +365,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
- if(errors.size()>0 || !isProjectSettingsOk()) {
+ if(!errors.isEmpty() || !isProjectSettingsOk()) {
IStatus errorStatus = errors.get(IValidator.DEFAULT_ERROR);
String errorMessage = SeamUIMessages.VALIDATOR_INVALID_SETTINGS;
if(errorStatus!=null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -146,7 +146,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_ENTITY_CLASS_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_ENTITY_CLASS_NAME));
setPageComplete(false);
return;
@@ -155,7 +155,7 @@
IFieldEditor editor = editorRegistry.get(IParameter.SEAM_PACKAGE_NAME);
if(editor!=null) {
errors = ValidatorFactory.PACKAGE_NAME_VALIDATOR.validate(editor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage()); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -165,7 +165,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_MASTER_PAGE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_ENTITY_MASTER_PAGE,project,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -174,7 +174,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_PAGE,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -69,7 +69,7 @@
projectEditor.addPropertyChangeListener(this);
if(projectName!=null && projectName.length()>0) {
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
IStatus message = errors.get(IValidator.DEFAULT_ERROR);
if(message.getSeverity()==IStatus.ERROR) {
setErrorMessage(message.getMessage());
@@ -199,7 +199,7 @@
Map<String, IStatus> errors;
String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return false;
@@ -210,7 +210,7 @@
private void validate() {
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
- if(errors.size()>0 || !isProjectSettingsOk()) {
+ if(!errors.isEmpty() || !isProjectSettingsOk()) {
IStatus errorMessage = errors.get(IValidator.DEFAULT_ERROR);
if(errorMessage==null) {
setErrorMessage(SeamUIMessages.VALIDATOR_INVALID_SETTINGS);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -500,7 +500,7 @@
.getActiveShell(), wiz);
dialog.open();
- if (added.size() > 0) {
+ if (!added.isEmpty()) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
List<String> runtimes = getRuntimeNames(sv);
getFieldEditor().setValue(added.get(0).getName());
@@ -574,7 +574,7 @@
configurationNames.add(configs[i].getName());
}
if(defaultSelection==null) {
- if(configurationNames.size()>0) {
+ if(!configurationNames.isEmpty()) {
defaultSelection = configurationNames.get(0);
} else {
defaultSelection = ""; //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -29,7 +29,7 @@
}
public boolean canExecute() {
- if(elements.size() > 0){
+ if(!elements.isEmpty()){
XModelObject[] objects = (XModelObject[])elements.toArray(new XModelObject[]{});
XModelObject object= objects[0];
if(elements.size() == 1) objects = null;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -223,7 +223,7 @@
int height = getVisualHeight() + getPageModel().getOutputLinks().size()
* NodeFigure.LINK_HEIGHT;
- if (getPageModel().getOutputLinks().size() == 0)
+ if (getPageModel().getOutputLinks().isEmpty())
height = getVisualHeight() + NodeFigure.LINK_HEIGHT;
String name = getPageModel().getName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -234,7 +234,7 @@
if(getPagesModel().getChildren().get(i) instanceof Page){
Page page = (Page)getPagesModel().getChildren().get(i);
- if(page.getChildren().size() > 0 && page.isParamsVisible()){
+ if(!page.getChildren().isEmpty() && page.isParamsVisible()){
PageWrapper wrapper = page.getParamList();
list.add(wrapper);
}
@@ -262,7 +262,7 @@
if (val != null && val.booleanValue())
snapStrategies.add(new SnapToGrid(this));
- if (snapStrategies.size() == 0)
+ if (snapStrategies.isEmpty())
return null;
if (snapStrategies.size() == 1)
return (SnapToHelper) snapStrategies.get(0);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -45,7 +45,7 @@
}
public void refreshFont() {
- if (getChildren().size() > 0 && getChildren().get(0) instanceof Label) {
+ if (!getChildren().isEmpty() && getChildren().get(0) instanceof Label) {
Label label = (Label) getChildren().get(0);
// label.setFont(editPart.getLinkModel().getJSFModel().getOptions()
// .getLinkPathFont());
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -162,7 +162,7 @@
g.drawString(page.getName(), 27, 3);
}
- if(page.getChildren().size() != 0){
+ if(!page.getChildren().isEmpty()){
if(page.isParamsVisible()){
g.drawImage(minusImage, 4, height-12);
}else{
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -50,8 +50,6 @@
Element rootElement = document.getDocumentElement();
NodeList nodeList = rootElement.getElementsByTagName(NAMESPACE);
return nodeList.item(0).getFirstChild().getNodeValue();
- } catch (Exception e) {
- VpePlugin.reportProblem(e);
} finally {
if(document!=null) {
VpeCreatorUtil.releaseDocumentFromRead(document);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -188,7 +188,7 @@
double dVersion;
try {
dVersion = Double.parseDouble(parseableVersion);
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
VpePlugin.getPluginLog().logError(e);
dVersion = 0.0;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
+import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
@@ -49,7 +50,7 @@
}
is.close();
- } catch (Exception e) {
+ } catch (IOException e) {
e.printStackTrace();
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -31,9 +31,15 @@
try {
Field field = c.getDeclaredField(fieldName);
return (String) field.get(null);
- } catch (Exception e) {
+ } catch (NoSuchFieldException e) {
PalettePlugin.getPluginLog().logError(e);
return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IllegalArgumentException e) {
+ PalettePlugin.getPluginLog().logError(e);
+ return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IllegalAccessException e) {
+ PalettePlugin.getPluginLog().logError(e);
+ return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
15 years, 5 months