JBoss Tools SVN: r3598 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-12 21:16:02 -0400 (Wed, 12 Sep 2007)
New Revision: 3598
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/wizard/IParameter.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
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 2007-09-13 01:15:56 UTC (rev 3597)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-13 01:16:02 UTC (rev 3598)
@@ -141,7 +141,9 @@
return errors;
}
if (!new File(value.toString(), "seam").isFile()) {
- errors = createErrormessage("Seam Home Folde field points to " +
+ errors = createErrorMap();
+ errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
+ "Seam Home Folde field points to " +
"location that doesn't look like seam home folder");
}
return errors;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/IParameter.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/IParameter.java 2007-09-13 01:15:56 UTC (rev 3597)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/IParameter.java 2007-09-13 01:16:02 UTC (rev 3598)
@@ -30,5 +30,8 @@
public static String HIBERNATE_CONFIGURATION_NAME = "hibernate.configuratrion.name";
public static String SEAM_EAR_PROJECT_LOCATION_PATH = "seam.ear.project.location";
+ public static String SEAM_TEST_PROJECT_LOCATION_PATH = "seam.test.project.location";
+ public static String SEAM_EJB_PROJECT_LOCATION_PATH = "seam.ejb.project.location";
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-09-13 01:15:56 UTC (rev 3597)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-09-13 01:16:02 UTC (rev 3598)
@@ -70,10 +70,10 @@
"${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" + IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/ActionTest.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/testng.xml",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/view/action.xhtml",
"${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" + IParameter.SEAM_PAGE_NAME +"}.xhtml"});
@@ -87,10 +87,10 @@
"${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" + IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
ACTION_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/ActionTest.java",
- "${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
ACTION_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/testng.xml",
- "${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
ACTION_EAR_MAPPING.add(ACTION_WAR_MAPPING.get(3));
}
};
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-09-13 01:15:56 UTC (rev 3597)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-09-13 01:16:02 UTC (rev 3598)
@@ -36,6 +36,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetFilterSetFactory;
@@ -88,9 +89,11 @@
IContainer webRootContainer = webRootFolder.getUnderlyingFolder();
vars.put(ISeamFacetDataModelProperties.SEAM_PROJECT_INSTANCE,project);
+ vars.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME, SeamRuntimeManager.getInstance().getRuntimeForProject(project).getHomeDir());
vars.put(IParameter.SEAM_PROJECT_LOCATION_PATH,project.getLocation().toFile().toString());
vars.put(IParameter.SEAM_PROJECT_WEBCONTENT_PATH,webRootContainer.getLocation().toFile().toString());
vars.put(IParameter.SEAM_EAR_PROJECT_LOCATION_PATH,project.getLocation().removeLastSegments(1).append(project.getName()+"-ejb").toFile().toString());
+ vars.put(IParameter.SEAM_TEST_PROJECT_LOCATION_PATH,project.getLocation().removeLastSegments(1).append(project.getName()+"-test").toFile().toString());
vars.put(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH, actionFolder.replace('.','/'));
vars.put(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME, actionFolder);
vars.put(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH, testFolder.replace('.','/'));
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-09-13 01:15:56 UTC (rev 3597)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-09-13 01:16:02 UTC (rev 3598)
@@ -87,10 +87,10 @@
"${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" + IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/FormTest.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/testng.xml",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/view/form.xhtml",
"${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" + IParameter.SEAM_PAGE_NAME +"}.xhtml"});
@@ -104,10 +104,10 @@
"${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" + IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
FORM_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/FormTest.java",
- "${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
FORM_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME + "}/seam-gen/test/testng.xml",
- "${" + IParameter.SEAM_EAR_PROJECT_LOCATION_PATH + "}/ejbModule/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
+ "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH + "}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
FORM_EAR_MAPPING.add(FORM_WAR_MAPPING.get(3));
}
};
17 years, 4 months
JBoss Tools SVN: r3597 - in trunk/seam/plugins/org.jboss.tools.seam.core: templates/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-12 21:15:56 -0400 (Wed, 12 Sep 2007)
New Revision: 3597
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/test-src/
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-09-13 01:15:51 UTC (rev 3596)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-09-13 01:15:56 UTC (rev 3597)
@@ -66,7 +66,7 @@
public static final String TEST_CASES_PACKAGE_PATH = "test.package.path";
- public static final String JBOSS_SEAM_HOME = "seam.jbossas.home.folder";
+ public static final String JBOSS_SEAM_HOME = "seam.home.folder";
public static final String WEB_CONTENTS_FOLDER = "seam.project.web.root.folder";
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-13 01:15:51 UTC (rev 3596)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-13 01:15:56 UTC (rev 3597)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -26,6 +27,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
@@ -48,8 +51,9 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.osgi.service.prefs.BackingStoreException;
-public class SeamFacetInstallDelegete extends Object implements IDelegate {
+public class SeamFacetInstallDelegete extends Object implements IDelegate,ISeamFacetDataModelProperties {
public static String DEV_WAR_PROFILE = "dev-war";
public static String DEV_EAR_PROFILE = "dev";
@@ -282,7 +286,9 @@
hibernateDialectFilterSet.addFilterSet(projectFilterSet);
hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
-
+ final CreateTestProject createTest = new CreateTestProject(model,project,selectedRuntime);
+ createTest.setUser(true);
+ createTest.setRule(ResourcesPlugin.getWorkspace().getRoot());
// ********************************************************************************************
// Handle WAR/EAR configurations
@@ -397,6 +403,8 @@
create.setRule(ResourcesPlugin.getWorkspace().getRoot());
create.schedule();
+ createTest.schedule();
+
} else {
model.setProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, project.getName()+"-ejb");
model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, project.getName()+"-ear");
@@ -513,6 +521,7 @@
SeamCorePlugin.getPluginLog().logError(e);
}
}
+ createTest.run(monitor);
return Status.OK_STATUS;
}
};
@@ -520,15 +529,47 @@
create.setRule(ResourcesPlugin.getWorkspace().getRoot());
create.schedule();
}
- Job createTest = new CreateTestProject(model,project,selectedRuntime);
- createTest.setUser(true);
- createTest.setRule(ResourcesPlugin.getWorkspace().getRoot());
- createTest.schedule();
-
+
ClasspathHelper.addClasspathEntries(project, fv);
+
+
+ IScopeContext projectScope = new ProjectScope(project);
+ IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+
+ prefs.put(JBOSS_AS_DEPLOY_AS, model.getProperty(JBOSS_AS_DEPLOY_AS).toString());
+
+ prefs.put(SEAM_RUNTIME_NAME, model.getProperty(SEAM_RUNTIME_NAME).toString());
+
+ prefs.put(SEAM_CONNECTION_PROFILE,model.getProperty(SEAM_CONNECTION_PROFILE).toString());
+
+ prefs.put(SESION_BEAN_PACKAGE_NAME, model.getProperty(SESION_BEAN_PACKAGE_NAME).toString());
+
+ prefs.put(ENTITY_BEAN_PACKAGE_NAME, model.getProperty(ENTITY_BEAN_PACKAGE_NAME).toString());
+
+ prefs.put(TEST_CASES_PACKAGE_NAME, model.getProperty(TEST_CASES_PACKAGE_NAME).toString());
+
+ prefs.put(SEAM_TEST_PROJECT,
+ model.getProperty(SEAM_TEST_PROJECT)==null?
+ "":model.getProperty(SEAM_TEST_PROJECT).toString());
+
+ if(DEPLOY_AS_EAR.equals(model.getProperty(JBOSS_AS_DEPLOY_AS))) {
+ prefs.put(SEAM_EJB_PROJECT,
+ model.getProperty(SEAM_EJB_PROJECT)==null?
+ "":model.getProperty(SEAM_EJB_PROJECT).toString());
+
+ prefs.put(SEAM_EAR_PROJECT,
+ model.getProperty(SEAM_EAR_PROJECT)==null?
+ "":model.getProperty(SEAM_EAR_PROJECT).toString());
+ }
+
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
-
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
@@ -558,7 +599,7 @@
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus run(IProgressMonitor monitor) {
String projectName = model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME).toString();
IProject test = WtpUtils.createEclipseProject(projectName+"-test", monitor);
File testProjectDir = test.getLocation().toFile();
@@ -616,4 +657,12 @@
return Status.OK_STATUS;
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.common.project.facet.core.IActionConfigFactory#create()
+ */
+ public Object create() throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-09-13 01:15:51 UTC (rev 3596)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-09-13 01:15:56 UTC (rev 3597)
@@ -16,12 +16,15 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
public class SeamFacetPreInstallDelegate implements IDelegate {
@@ -51,8 +54,7 @@
model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
DriverManager.getInstance().getDriverInstanceByID(
- props.get("org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray());
+ props.get("org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray());
}
-
}
17 years, 4 months
JBoss Tools SVN: r3596 - trunk/seam/plugins/org.jboss.tools.seam.text.ext.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-12 21:15:51 -0400 (Wed, 12 Sep 2007)
New Revision: 3596
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/build.properties
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/build.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/build.properties 2007-09-13 01:15:48 UTC (rev 3595)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/build.properties 2007-09-13 01:15:51 UTC (rev 3596)
@@ -1,4 +1,3 @@
-source.seamextensions.jar = src/
output.seam-text-ext.jar = bin/
bin.includes = plugin.xml,\
seam-text-ext.jar,\
@@ -13,3 +12,4 @@
about.html,\
META-INF/
source.seam-text-ext.jar = src/
+jars.compile.order = seam-text-ext.jar
17 years, 4 months
JBoss Tools SVN: r3595 - in trunk/jst/plugins/org.jboss.tools.jst.firstrun: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-12 21:15:48 -0400 (Wed, 12 Sep 2007)
New Revision: 3595
Modified:
trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.firstrun/build.properties
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
Modified: trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF 2007-09-12 23:47:33 UTC (rev 3594)
+++ trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF 2007-09-13 01:15:48 UTC (rev 3595)
@@ -15,3 +15,4 @@
Bundle-Activator: org.jboss.tools.jst.firstrun.JstFirstRunPlugin
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.jst.firstrun
+Bundle-ClassPath: jst-firstrun.jar
Modified: trunk/jst/plugins/org.jboss.tools.jst.firstrun/build.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.firstrun/build.properties 2007-09-12 23:47:33 UTC (rev 3594)
+++ trunk/jst/plugins/org.jboss.tools.jst.firstrun/build.properties 2007-09-13 01:15:48 UTC (rev 3595)
@@ -1,9 +1,10 @@
-source.. = src/
-output.. = bin/
bin.includes = META-INF/,\
- .,\
- plugin.xml
+ plugin.xml,\
+ jst-firstrun.jar
src.includes = src/,\
plugin.xml,\
build.properties,\
META-INF/
+jars.compile.order = jst-firstrun.jar
+source.jst-firstrun.jar = src/
+output.jst-firstrun.jar = bin/
17 years, 4 months
JBoss Tools SVN: r3594 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-12 19:47:33 -0400 (Wed, 12 Sep 2007)
New Revision: 3594
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
Log:
launch name referenced twiddle and shouldn't have
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-09-12 23:45:50 UTC (rev 3593)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-09-12 23:47:33 UTC (rev 3594)
@@ -47,7 +47,7 @@
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType(STOP_LAUNCH_TYPE);
- String launchName = TwiddleLaunchConfiguration.class.getName();
+ String launchName = StopLaunchConfiguration.class.getName();
launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName);
ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
wc.setAttribute(SERVER_ID, server.getId());
17 years, 4 months
JBoss Tools SVN: r3593 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-12 19:45:50 -0400 (Wed, 12 Sep 2007)
New Revision: 3593
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
Log:
removed a catch(Throwable)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-09-12 18:30:42 UTC (rev 3592)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-09-12 23:45:50 UTC (rev 3593)
@@ -24,6 +24,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -69,19 +70,17 @@
public void forceStop(boolean addEvent) {
// just terminate the process.
- try {
- if( process != null )
- try {
- process.terminate();
- } catch( Exception e ) {}
- process = null;
- setServerStopped();
- if( addEvent ) {
- EventLogTreeItem tpe = new ForceShutdownEvent();
- EventLogModel.markChanged(tpe.getEventRoot());
+ if( process != null )
+ try {
+ process.terminate();
+ } catch( DebugException e ) {
+ e.printStackTrace();
}
- } catch( Throwable t ) {
- t.printStackTrace();
+ process = null;
+ setServerStopped();
+ if( addEvent ) {
+ EventLogTreeItem tpe = new ForceShutdownEvent();
+ EventLogModel.markChanged(tpe.getEventRoot());
}
}
17 years, 4 months
JBoss Tools SVN: r3592 - trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-12 14:30:42 -0400 (Wed, 12 Sep 2007)
New Revision: 3592
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/WebtoolsProjectJBossClasspathContainerInitializer.java
Log:
Added some class commenting
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 2007-09-12 17:43:55 UTC (rev 3591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2007-09-12 18:30:42 UTC (rev 3592)
@@ -11,6 +11,14 @@
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossServerRuntime;
+/**
+ * This class uses the "throw everything you can find" strategy
+ * in providing additions to the classpath. Given a server runtime,
+ * it will try to add whatever could possibly ever be used.
+ *
+ * @author Rob Stryker
+ *
+ */
public class ClientAllRuntimeClasspathProvider extends
RuntimeClasspathProviderDelegate {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-09-12 17:43:55 UTC (rev 3591)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-09-12 18:30:42 UTC (rev 3592)
@@ -40,7 +40,18 @@
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossServerRuntime;
-
+/**
+ * This is a class that would ultimately try to respond to different facets
+ * by providing different jars to the classpath, jars specific to the added
+ * facet.
+ *
+ * It is currently only used by the EJB30SupportVerifier, or by
+ * the ProjectRuntimeClasspathProvider (front) when the added facet
+ * is jst.java.
+ *
+ * @author Rob Stryker
+ *
+ */
public class WebtoolsProjectJBossClasspathContainerInitializer extends
ClasspathContainerInitializer {
17 years, 4 months
JBoss Tools SVN: r3591 - in trunk/seam/tests/org.jboss.tools.seam.ui.test: src/org/jboss/tools/seam/ui/test/view and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-09-12 13:43:55 -0400 (Wed, 12 Sep 2007)
New Revision: 3591
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestComponentView/WebContent/WEB-INF/components.xml
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-337
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestComponentView/WebContent/WEB-INF/components.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestComponentView/WebContent/WEB-INF/components.xml 2007-09-12 15:35:49 UTC (rev 3590)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestComponentView/WebContent/WEB-INF/components.xml 2007-09-12 17:43:55 UTC (rev 3591)
@@ -2,7 +2,7 @@
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd">
- <component class="java.lang.Boolean" name="myComponent" scope="page">
+ <component class="java.lang.Boolean" name="package1.package2.package3.package4.myComponent" scope="page">
<property name="property1">value1</property>
<property name="myList">
<value>value1</value>
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-12 15:35:49 UTC (rev 3590)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-12 17:43:55 UTC (rev 3591)
@@ -41,6 +41,7 @@
import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.ISeamUiConstants;
+import org.jboss.tools.seam.ui.views.actions.ScopePresentationActionProvider;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -71,6 +72,54 @@
assertTrue("Cannot find components.xml in test project", componentsFile != null && componentsFile.exists());
}
+ public void testFlatSeamPackages(){
+ ScopePresentationActionProvider.setPackageStructureFlat(true);
+
+ SeamCorePlugin.getSeamProject(project, true);
+
+ refreshProject(project);
+
+ CommonNavigator navigator = getSeamComponentsView();
+
+ navigator.getCommonViewer().expandAll();
+
+
+ Tree tree = navigator.getCommonViewer().getTree();
+
+ updateTree(tree);
+
+ ISeamPackage seamPackage = findSeamPackage(tree, "package1");
+
+ assertTrue("Unexpected package 'package1' was" +
+ " found",seamPackage==null);
+
+ seamPackage = findSeamPackage(tree, "package1.package2.package3.package4");
+
+ assertTrue("Expected package 'package1.package2.package3.package4' was not" +
+ " found",seamPackage!=null);
+ }
+
+ public void testHierarchicalSeamPackages(){
+ ScopePresentationActionProvider.setPackageStructureFlat(false);
+
+ SeamCorePlugin.getSeamProject(project, true);
+
+ refreshProject(project);
+
+ CommonNavigator navigator = getSeamComponentsView();
+
+ navigator.getCommonViewer().expandAll();
+
+ Tree tree = navigator.getCommonViewer().getTree();
+
+ updateTree(tree);
+
+ ISeamPackage seamPackage = findSeamPackage(tree, "package1");
+
+ assertTrue("Expected package 'package1' was not" +
+ " found",seamPackage!=null);
+ }
+
public void testAddComponentInXmlFile(){
SeamCorePlugin.getSeamProject(project, true);
@@ -80,6 +129,7 @@
navigator.getCommonViewer().expandAll();
+
Tree tree = navigator.getCommonViewer().getTree();
updateTree(tree);
@@ -323,6 +373,8 @@
}
public void testDeleteComponentInClass(){
+ classFile = project.getFile("JavaSource/demo/Person.java");
+
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
@@ -395,25 +447,16 @@
return part;
}
-
-
private void showTreeItem(TreeItem item, int level){
for(int i=0;i<level;i++)
System.out.print("-");
- System.out.print(item.getText());
- System.out.println("Item "+item.getData());
- if(item.getData() instanceof ISeamScope){
- ISeamScope scope = (ISeamScope)item.getData();
- Iterator<ISeamPackage> iter = scope.getAllPackages().iterator();
- while(iter.hasNext())
- showSeamPackage(iter.next(), level+1);
-
-
- List<ISeamComponent> components = scope.getComponents();
- for(int i=0;i<components.size();i++)
- showSeamComponent(components.get(i), level+1);
- }
+ System.out.print("Item "+item.getText());
+ System.out.println(" Data "+item.getData());
+ if(item.getData() instanceof ISeamPackage)
+ showSeamPackage((ISeamPackage)item.getData(),1);
+ else if(item.getData() instanceof ISeamComponent)
+ showSeamComponent((ISeamComponent)item.getData(),1);
for(int i=0;i<item.getItemCount();i++){
showTreeItem(item.getItem(i),level+1);
@@ -421,8 +464,8 @@
}
private void showSeamPackage(ISeamPackage seamPackage, int level){
- for(int i=0;i<level;i++)
- System.out.print("-");
+// for(int i=0;i<level;i++)
+// System.out.print("-");
System.out.println("Package - "+seamPackage.getName()+" "+seamPackage.getQualifiedName());
@@ -432,8 +475,8 @@
}
private void showSeamComponent(ISeamComponent component, int level){
- for(int i=0;i<level;i++)
- System.out.print("-");
+// for(int i=0;i<level;i++)
+// System.out.print("-");
System.out.println("Component - "+component.getName()+" "+component.getClassName());
}
@@ -450,17 +493,17 @@
return null;
}
- private ISeamPackage findSeamPackage(ISeamScope seamScope, String name){
- ISeamPackage seamPackage=null;
-
- Iterator<ISeamPackage> iter = seamScope.getAllPackages().iterator();
- while(iter.hasNext()){
- seamPackage = iter.next();
- if(seamPackage.getName().equals(name)) return seamPackage;
- }
-
- return null;
- }
+// private ISeamPackage findSeamPackage(ISeamScope seamScope, String name){
+// ISeamPackage seamPackage=null;
+//
+// Iterator<ISeamPackage> iter = seamScope.getAllPackages().iterator();
+// while(iter.hasNext()){
+// seamPackage = iter.next();
+// if(seamPackage.getName().equals(name)) return seamPackage;
+// }
+//
+// return null;
+// }
private ISeamPackage findSeamPackage(TreeItem item, String name){
ISeamPackage seamPackage=null;
@@ -469,12 +512,15 @@
TreeItem cur = item.getItem(i);
if(cur.getData() instanceof ISeamPackage) {
ISeamPackage pkg =(ISeamPackage)cur.getData();
- if(name.equals(pkg.getName())) {
+ //System.out.println("Searching: "+name+" found: "+pkg.getQualifiedName());
+ if(name.equals(pkg.getQualifiedName())) {
seamPackage = pkg;
+ //System.out.println("Found!");
break;
}
}else {
seamPackage = findSeamPackage(cur, name);
+ if(seamPackage != null) return seamPackage;
}
}
17 years, 4 months
JBoss Tools SVN: r3590 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: editor/form and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-12 11:35:49 -0400 (Wed, 12 Sep 2007)
New Revision: 3590
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/AbstractSectionEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ErrorMode.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/FormPlace.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/custom/ColoredFontData.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommandRunner.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizardDialog.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XTable.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/AbstractSectionEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/AbstractSectionEditor.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/AbstractSectionEditor.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -23,6 +23,7 @@
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.editor.DefaultEditorPart;
public abstract class AbstractSectionEditor extends DefaultEditorPart {
@@ -37,7 +38,11 @@
errorMode = null;
disposeGui();
if(!wrapper.isDisposed()) {
- try { wrapper.dispose(); } catch (Exception e) {}
+ try {
+ wrapper.dispose();
+ } catch (SWTException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
wrapper = null;
control = null;
@@ -56,7 +61,9 @@
guiControl.setLayout(l);
try {
wrapper.setWeights(new int[]{10, 30});
- } catch (Exception e) {}
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
return wrapper;
}
@@ -73,7 +80,11 @@
protected void disposeGui() {
if(control != null) {
- try { if(!control.isDisposed()) control.dispose(); } catch (Exception e) {}
+ try {
+ if(!control.isDisposed()) control.dispose();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
control = null;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ErrorMode.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ErrorMode.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ErrorMode.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -18,6 +18,7 @@
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class ErrorMode {
private ScrolledComposite errors = null;
@@ -55,7 +56,11 @@
public void dispose() {
if(errors != null) {
- try { errors.dispose(); } catch (Exception e) {}
+ try {
+ if(!errors.isDisposed()) errors.dispose();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
errors = null;
labels.clear();
es = "";
@@ -173,8 +178,8 @@
messages[2] = s.substring(k + 1);
int qi = q.indexOf(':');
if(qi > 0) {
- try { line = Integer.parseInt(q.substring(0, qi)); } catch (Exception e) {}
- try { position = Integer.parseInt(q.substring(qi + 1)); } catch (Exception e) {}
+ line = getInt(q.substring(0, qi), line);
+ position = getInt(q.substring(qi + 1), position);
}
} else {
messages[0] = "ERROR";
@@ -186,6 +191,16 @@
}
}
+ int getInt(String s, int def) {
+ if(s == null || s.length() == 0) return def;
+ try {
+ return Integer.parseInt(s);
+ } catch (NumberFormatException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ return def;
+ }
+ }
+
public void go() {
if(listener != null) listener.errorSelected(line, position);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/FormPlace.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/FormPlace.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/FormPlace.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -75,7 +75,11 @@
if(form != null) form.dispose();
form = null;
if(composite != null) {
- try { composite.dispose(); } catch (Exception e) {}
+ try {
+ if(!composite.isDisposed()) composite.dispose();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
composite = null;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -121,8 +121,14 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
this.viewer = viewer;
- try { viewer.refresh(); } catch (Exception e) {}
+ try {
+ if(viewer != null) viewer.refresh();
+ } catch (Exception e) {
+ ignore();
+ }
}
+
+ void ignore() {}
public Object[] getChildren(Object parentElement) {
return new Object[0];
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -22,7 +22,6 @@
import org.jboss.tools.common.model.XFilteredTree;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public class DefaultXAttributeTreeContentProvider implements ITreeContentProvider {
@@ -105,19 +104,24 @@
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- try { viewer.refresh(); } catch (Exception e) {}
+ try {
+ viewer.refresh();
+ } catch (Exception e) {
+ ignore();
+ }
}
+
+ void ignore() {
+ //do nothing
+ }
protected XFilteredTree createFilteredTree(String filteredTreeName) {
String classname = model.getMetaData().getMapping("FilteredTrees").getValue(filteredTreeName);
- try {
- XFilteredTree tree = (XFilteredTree)ModelFeatureFactory.getInstance().createFeatureInstance(classname);
- tree.setModel(model);
- tree.setConstraint(new Object[]{attribute, object});
- return tree;
- } catch(Exception exception) {
- return null;
- }
+ XFilteredTree tree = (XFilteredTree)ModelFeatureFactory.getInstance().createFeatureInstance(classname);
+ if(tree == null) return null;
+ tree.setModel(model);
+ tree.setConstraint(new Object[]{attribute, object});
+ return tree;
}
public XFilteredTree getFilteredTree() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/custom/ColoredFontData.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/custom/ColoredFontData.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/custom/ColoredFontData.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -50,21 +50,21 @@
if(q == 0) {
if(!"default".equals(t)) data.setName(t);
} else if(t.startsWith("size=")) {
- try { data.setHeight(Integer.parseInt(t.substring(5))); } catch (Exception e) {}
+ data.setHeight(getInt(t.substring(5), data.getHeight()));
} else if(t.startsWith("style=")) {
- try { data.setStyle(Integer.parseInt(t.substring(6))); } catch (Exception e) {}
+ data.setStyle(getInt(t.substring(6), data.getStyle()));
} else if(t.startsWith("color=")) {
String sc = t.substring(6);
int red = color.red, green = color.green, blue = color.blue;
int i = sc.indexOf('-');
if(i < 0) continue;
- try { red = Integer.parseInt(sc.substring(0, i)); } catch (Exception e) {}
+ red = getInt(sc.substring(0, i), red);
sc = sc.substring(i + 1);
i = sc.indexOf('-');
if(i < 0) continue;
- try { green = Integer.parseInt(sc.substring(0, i)); } catch (Exception e) {}
+ green = getInt(sc.substring(0, i), green);
sc = sc.substring(i + 1);
- try { blue = Integer.parseInt(sc); } catch (Exception e) {}
+ blue = getInt(sc, blue);
color = new RGB(red, green, blue);
}
++q;
@@ -75,6 +75,16 @@
return d;
}
+ private static int getInt(String s, int def) {
+ if(s == null || s.length() == 0) return def;
+ try {
+ return Integer.parseInt(s);
+ } catch (NumberFormatException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ return def;
+ }
+ }
+
public static String toString(FontData data, RGB rgb) {
StringBuffer sb = new StringBuffer();
if(data.getName().equals(DEFAULT.getFontData().getName()))
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -138,9 +138,12 @@
if (IPropertyEditor.VALUE.equals(event.getPropertyName())) {
Object v = event.getNewValue();
String s = (v == null) ? "" : v.toString();
- try {
- if(!s.equals(stringValue)) {
- stringValue = s;
+ if(!s.equals(stringValue)) {
+ stringValue = s;
+
+ if(viewer == null || viewer.getTree() == null || viewer.getTree().isDisposed()) {
+ //do nothing
+ } else {
if(lock == 0) {
lock++;
Tree tree = viewer.getTree();
@@ -157,11 +160,8 @@
}
lock--;
}
-
viewer.refresh();
}
- } catch (Exception e) {
- //ignore
}
}
valueProvider.addValueChangeListener(this);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -458,8 +458,10 @@
f.setAccessible(true);
Text text = (Text)f.get(comboField);
return (text != null && !text.isDisposed()) ? text : null;
- } catch (Exception e) {
+ } catch (NoSuchFieldException e) {
return null;
+ } catch (IllegalAccessException e1) {
+ return null;
}
}
/**
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -329,6 +329,7 @@
((IControlDropListener)provider).drop(p);
}
} catch (ActionDeclinedException de) {
+ ignore();
} catch (Exception e) {
ModelUIPlugin.getPluginLog().logError(e);
}
@@ -336,6 +337,10 @@
}
}
+ void ignore() {
+ //do nothing
+ }
+
private static Vector<TreeItem> getTreeExpandedItems(Tree tree) {
TreeItem[] items = tree.getItems();
Vector<TreeItem> result = new Vector<TreeItem>();
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.editor;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.resources.IMarker;
@@ -49,12 +50,21 @@
try {
Class editorClass = editor.getClass();
Method method = editorClass.getMethod("gotoMarker",new Class[]{IMarker.class});
+ method.setAccessible(true);
method.invoke(editor,new Object[]{marker});
- } catch(Exception ex) {
- // Eat exception
- }
+ } catch(NoSuchMethodException e1) {
+ ignore();
+ } catch(IllegalAccessException e2) {
+ ignore();
+ } catch(InvocationTargetException e3) {
+ ModelUIPlugin.getPluginLog().logError(e3);
+ }
}
}
+
+ void ignore() {
+ //do nothing
+ }
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
input = XModelObjectEditorInput.checkInput(input);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommandRunner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommandRunner.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommandRunner.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.editors.dnd;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;
@@ -60,8 +61,13 @@
Method m = AbstractTextEditor.class.getDeclaredMethod("getSourceViewer", new Class[0]);
m.setAccessible(true);
return (ISourceViewer)m.invoke(ae, new Object[0]);
- } catch (Exception t) {}
- return null;
+ } catch (NoSuchMethodException e1) {
+ return null;
+ } catch (InvocationTargetException e2) {
+ return null;
+ } catch (IllegalAccessException e2) {
+ return null;
+ }
}
public int execute() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizardDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizardDialog.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizardDialog.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -35,12 +35,8 @@
}
protected int getPreferredWidth() {
- try {
- String os_name = System.getProperty("os.name");
- if(os_name != null && os_name.indexOf("Windows") >= 0) return DO_WIDTH_VALUE;
- } catch (Exception e) {
- //ignore
- }
+ String os_name = System.getProperty("os.name");
+ if(os_name != null && os_name.indexOf("Windows") >= 0) return DO_WIDTH_VALUE;
return DO_WIDTH_VALUE_LINUX;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -11,8 +11,10 @@
package org.jboss.tools.common.model.ui.editors.dnd.context;
import java.io.File;
+import java.net.MalformedURLException;
import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.FileTransfer;
@@ -107,9 +109,12 @@
private String getURL(XModelObject o) {
if(o.getFileType() == XModelObject.FILE) {
IFile f = (IFile)EclipseResourceUtil.getResource(o);
+ if(f == null || !f.exists()) return null;
try {
return f.getLocation().toFile().toURL().toString();
- } catch (Exception e) {}
+ } catch (MalformedURLException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -285,7 +285,9 @@
p.setProperty("name", name);
try {
XActionInvoker.invoke("AnyElementNew", "EditActions.EditAttribute", xmo, p);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
void delete() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -79,8 +79,10 @@
public void stopEditing() {
try {
- objectEditor.stopEditing();
- } catch (Exception e) {}
+ if(objectEditor != null) objectEditor.stopEditing();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
public void dispose() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XTable.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XTable.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XTable.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -26,6 +26,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class XTable {
protected XTableProvider provider;
@@ -193,11 +194,17 @@
}
for (int i = table.getItemCount() - 1; i >= provider.getRowCount() ; i--) {
item = table.getItem(i);
- try { item.dispose(); } catch (Exception e) {}
+ try {
+ item.dispose();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
if(r >= 0) try {
table.setSelection(r);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ //ignore
+ }
resizeLock = false;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -65,7 +66,8 @@
QualifiedName qn = new QualifiedName(ModelUIPlugin.ID_PLUGIN, ModelUIPlugin.PROJECT_OVERRIDE);
try {
ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(qn, "" + b);
- } catch (Exception e) {
+ } catch (CoreException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.texteditors.preferences;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -46,11 +47,19 @@
Method m = AbstractUIPlugin.class.getDeclaredMethod("initializeDefaultPluginPreferences", new Class[0]);
m.setAccessible(true);
m.invoke(plugin, new Object[0]);
- } catch (Exception e) {
- //ignore
+ } catch(NoSuchMethodException e1) {
+ ignore();
+ } catch(IllegalAccessException e2) {
+ ignore();
+ } catch(InvocationTargetException e3) {
+ ModelUIPlugin.getPluginLog().logError(e3);
}
store = (plugin == null) ? null : plugin.getPreferenceStore();
store.setDefault(BasePreferenceConstants.EDITOR_REPLACE_TAB_WITH_WHITESPACE, false);
}
+
+ static void ignore() {
+ //do nothing
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -11,6 +11,8 @@
package org.jboss.tools.common.model.ui.wizards.query.list;
import java.util.Properties;
+
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.action.CommandBar;
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
import org.eclipse.jface.viewers.*;
@@ -51,9 +53,12 @@
super.setObject(data);
Properties p = (Properties)data;
vs = (String[][])p.get("data");
- try {
- expandingLevel = Integer.parseInt(p.getProperty("expandingLevel"));
- } catch (Exception e) {}
+ String s = p.getProperty("expandingLevel");
+ if(s != null && s.length() > 0) try {
+ expandingLevel = Integer.parseInt(s);
+ } catch (NumberFormatException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
makeObject();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -152,7 +152,9 @@
if(dialog == null) return;
try {
if(dialog.getShell() != null && !dialog.getShell().isDisposed()) dialog.close();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
dialog = null;
}
@@ -179,20 +181,13 @@
validationRunnable.setData(validator, data);
validationRunnable.safeUpdateValidationData();
-/// synchronized(validationMonitor) {
-/// try { validationMonitor.notifyAll(); } catch (Exception e) {}
-/// }
}
private ValidationRunnable validationRunnable = new ValidationRunnable();
-/// Object validationMonitor = new Object();
public void stopValidator() {
if(validationRunnable == null) return;
validationRunnable = null;
-/// synchronized(validationMonitor) {
-/// try { validationMonitor.notifyAll(); } catch (Exception e) {}
-/// }
}
class ValidationRunnable implements Runnable {
@@ -207,16 +202,6 @@
}
public void run() {
-/// while(validationRunnable != null) {
-/// while(timeStamp != lastTimeStamp) {
-/// try { Thread.sleep(100); } catch (Exception e) {}
-/// lastTimeStamp = timeStamp;
-/// safeUpdateValidationData();
-/// }
-/// synchronized(validationMonitor) {
-/// try { validationMonitor.wait(); } catch (Exception e) {}
-/// }
-/// }
}
void safeUpdateValidationData() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java 2007-09-12 15:27:55 UTC (rev 3589)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java 2007-09-12 15:35:49 UTC (rev 3590)
@@ -13,14 +13,17 @@
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class BundleModel {
IFile main;
@@ -122,7 +125,11 @@
createPropertyModel(p[i][0], p[i][1], "");
}
IResource[] rs = new IResource[0];
- try { rs = main.getParent().members(); } catch (Exception e) {}
+ try {
+ rs = main.getParent().members();
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
for (int i = 0; i < rs.length; i++) {
if(!(rs[i] instanceof IFile)) continue;
IFile f = (IFile)rs[i];
@@ -175,7 +182,11 @@
values.add(p.getProperty(key));
}
}
- } catch (Exception e) {}
+ } catch (CoreException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IOException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
String[][] r = new String[keys.size()][2];
for (int i = 0; i < r.length; i++) {
r[i][0] = keys.get(i).toString();
@@ -212,7 +223,11 @@
String[] ls = (String[])removedLocales.toArray(new String[0]);
for (int i = 0; i < ls.length; i++) {
IFile f = getFile(ls[i]);
- if(f.exists()) try { f.delete(true, true, null); } catch (Exception e) {}
+ if(f.exists()) try {
+ f.delete(true, true, null);
+ } catch (CoreException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
removedLocales.clear();
ls = (String[])locales.toArray(new String[0]);
@@ -230,7 +245,8 @@
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
p0.store(os, null);
- } catch (Exception e) {
+ } catch (IOException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
continue;
}
String s = os.toString();
@@ -242,7 +258,9 @@
try {
if(f.exists()) f.setContents(is, true, true, null);
else f.create(is, true, null);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
}
setModified(false);
}
17 years, 4 months
JBoss Tools SVN: r3588 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common: model/engines/impl and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-12 10:36:58 -0400 (Wed, 12 Sep 2007)
New Revision: 3588
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -47,12 +47,9 @@
if(parameter == null) return null;
if(parameter.startsWith("%")) {
int j = parameter.length() - 1;
- try {
- parameter = getMetaModel().getMapping(mapping)
- .getValue(parameter.substring(1, j));
- } catch (Exception e) {
- return null;
- }
+ XMapping m = getMetaModel().getMapping(mapping);
+ if(m == null) return null;
+ parameter = m.getValue(parameter.substring(1, j));
}
return parameter;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -57,8 +57,8 @@
public final void stop() {
if(!isRunning()) return;
- try { process.destroy(); } catch (Exception e) {}
- try { waitFor(); } catch (Exception e) {}
+ process.destroy();
+ waitFor();
clear();
}
@@ -86,8 +86,10 @@
exit = process.waitFor();
if(errc != null) errc.waitFor();
if(outc != null) outc.waitFor();
- } catch (Exception e) {}
- return exit;
+ return exit;
+ } catch (InterruptedException e) {
+ return exit;
+ }
}
protected void write(String s) {}
@@ -121,19 +123,19 @@
public HookMonitor() {
if(!isRunning()) return;
- try {
- sdhook = new Thread(new SD());
- Runtime.getRuntime().addShutdownHook(sdhook);
- new Thread(this).start();
- } catch (Exception t) {}
+ sdhook = new Thread(new SD());
+ Runtime.getRuntime().addShutdownHook(sdhook);
+ new Thread(this).start();
}
public void run() {
- try { process.waitFor(); } catch (Exception e) {}
+ try {
+ process.waitFor();
+ } catch (InterruptedException e) {
+ //do nothing
+ }
stop();
- try {
- Runtime.getRuntime().removeShutdownHook(sdhook);
- } catch (Exception t) {}
+ Runtime.getRuntime().removeShutdownHook(sdhook);
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -509,8 +509,9 @@
if(loaderCount <= 0) return;
try {
loaderMonitor.wait();
- } catch (Exception e) {
+ } catch (InterruptedException e) {
//ignore
+ return;
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -36,21 +36,6 @@
toSave.clear();
XModelObject[] modified = getModified();
if(modified.length == 0) return;
-/*
- String mes = "Struts project ";
- for (int i = 0; i < modified.length; i++) {
- if(i > 0) mes += ", ";
- mes += modified[i].getPresentationString();
- }
- mes += " is modified.\n Do you want to save changes?";
- try {
- MessageDialog d = new MessageDialog(null, "Save", null, mes, MessageDialog.QUESTION, new String[]{"Yes", "No"}, 0);
- int q = d.open();
- if(q != 0) return;
- } catch (Exception e) {
- XStudioPlugin.log("Warning: could not call save dialog from XStudioSaveParticipant.", e);
- }
-*/
for (int i = 0; i < modified.length; i++) toSave.add(modified[i].getModel());
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -12,6 +12,7 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
public class XUndoManager {
private XModel model = null;
@@ -142,7 +143,7 @@
try {
if(t.canUndo()) t.undo();
} catch (Exception e) {
- //ignore
+ ModelPlugin.getPluginLog().logError(e);
}
current = t.prev();
current.setNext(null);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2007-09-12 14:03:17 UTC (rev 3587)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2007-09-12 14:36:58 UTC (rev 3588)
@@ -89,13 +89,6 @@
s = s.substring(j + 1);
String v = found.getProperty(q);
if(v == null) {
- if(v == null && context != null) {
- try {
- v = context.lookup(q).toString();
- } catch (Exception e) {
- //ignore
- }
- }
v = (model == null) ? null : model.getProperties().getProperty(q);
if(v == null && model != null) {
int d = q.lastIndexOf('.');
17 years, 4 months