JBoss Tools SVN: r7098 - trunk/esb/features/org.jboss.tools.esb.feature.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-03-24 19:22:16 -0400 (Mon, 24 Mar 2008)
New Revision: 7098
Modified:
trunk/esb/features/org.jboss.tools.esb.feature/feature.xml
Log:
removing empty <requires> clause, this causes PDE build to blow up
Modified: trunk/esb/features/org.jboss.tools.esb.feature/feature.xml
===================================================================
--- trunk/esb/features/org.jboss.tools.esb.feature/feature.xml 2008-03-24 19:09:15 UTC (rev 7097)
+++ trunk/esb/features/org.jboss.tools.esb.feature/feature.xml 2008-03-24 23:22:16 UTC (rev 7098)
@@ -218,9 +218,6 @@
litigation.
</license>
- <requires>
- </requires>
-
<plugin
id="org.jboss.tools.esb.core"
download-size="0"
18 years
JBoss Tools SVN: r7097 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-03-24 15:09:15 -0400 (Mon, 24 Mar 2008)
New Revision: 7097
Modified:
trunk/jsf/docs/userguide/en/modules/JSFStruts_tools.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-162 - updating jsf faces-config editor section
Modified: trunk/jsf/docs/userguide/en/modules/JSFStruts_tools.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/JSFStruts_tools.xml 2008-03-24 18:36:14 UTC (rev 7096)
+++ trunk/jsf/docs/userguide/en/modules/JSFStruts_tools.xml 2008-03-24 19:09:15 UTC (rev 7097)
@@ -808,7 +808,9 @@
template.</para>
</section>
- <!--para>At this point, you have a fully configured project to </para-->
+ <para>At this point, you have a fully configured project and now you can
+ bring some new logic to it starting from JSF configuration
+ file.</para>
</section>
<section id="GraphicalEditorAndViewingForJSFConfigurationFiles76331">
@@ -1108,6 +1110,8 @@
file</para>
</listitem>
</itemizedlist>
+
+ <para>Thus, in this section we will guides you through all this possibilities.</para>
<section id="CodeGenerationForManagedBeans421">
18 years
JBoss Tools SVN: r7096 - in trunk/seam: plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-03-24 14:36:14 -0400 (Mon, 24 Mar 2008)
New Revision: 7096
Added:
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/SeamFolderRenameParticipant.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/SeamJavaPackageRenameParticipant.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/refactoring/SeamProjectRenameParticipant.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameParticipant.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1919 Added package name refactoring.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-03-24 18:36:14 UTC (rev 7096)
@@ -293,8 +293,8 @@
point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameProjectParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameProjectParticipant"
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
name="seam-RenameProjectParticipant">
<enablement>
<with variable="element">
@@ -305,8 +305,8 @@
</enablement>
</renameParticipant>
<renameParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameFolderParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameFolderParticipant"
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
name="seam-RenameFolderParticipant">
<enablement>
<with variable="element">
@@ -316,6 +316,18 @@
</with>
</enablement>
</renameParticipant>
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
+ name="seam-JavaPackageRenameParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
</extension>
Copied: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java (from rev 7049, trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,96 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamFolderRenameChange extends SeamProjectChange {
+
+ private IPath oldPath;
+ private IPath newPath;
+
+ private List<String> relevantProperties = new ArrayList<String>();
+
+ public SeamFolderRenameChange(IProject project, String newName, IPath oldPath) {
+ super(project);
+ this.oldPath = oldPath;
+ this.newPath = oldPath.removeLastSegments(1).append(newName);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
+ String propertyValue = ps.get(FOLDER_PROPERTIES[i], null);
+ if(propertyValue==null) {
+ continue;
+ }
+ String oldPathString = oldPath.toString();
+ if(propertyValue.equals(oldPathString) ||
+ propertyValue.startsWith(oldPathString + "/")) {
+ relevantProperties.add(FOLDER_PROPERTIES[i]);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
+ */
+ @Override
+ public boolean isRelevant() {
+ return relevantProperties.size()>0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ if(!isRelevant()) {
+ return null;
+ }
+ try {
+ pm.beginTask(getName(), 1);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (String propertyName: relevantProperties) {
+ String propertyValue = ps.get(propertyName, "");
+ String oldPathString = oldPath.toString();
+ if(propertyValue.equals(oldPathString)) {
+ ps.put(propertyName, newPath.toString());
+ } else if(propertyValue.startsWith(oldPathString + "/")) {
+ String newPathString = newPath.toString() + propertyValue.substring(oldPathString.length());
+ ps.put(propertyName, newPathString);
+ }
+ }
+
+ try {
+ ps.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return new SeamFolderRenameChange(project, oldPath.lastSegment(), newPath);
+ } finally {
+ pm.done();
+ }
+ }
+}
\ No newline at end of file
Copied: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameParticipant.java (from rev 7050, trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,58 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Updates seam settings of seam projects if somebody renames source folder.
+ * @author Alexey Kazakov
+ */
+public class SeamFolderRenameParticipant extends SeamRenameParticipant {
+
+ public static final String PARTICIPANT_NAME="seam-FolderRenameParticipant";
+
+ private IPath oldPath;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+ */
+ @Override
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+ */
+ @Override
+ protected boolean initialize(Object element) {
+ if(!(element instanceof IFolder)) {
+ return false;
+ }
+ oldPath = ((IResource)element).getFullPath();
+
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamRenameParticipant#createChange(org.eclipse.core.resources.IProject, java.lang.String)
+ */
+ @Override
+ protected SeamProjectChange createChange(IProject project, String newName) {
+ return new SeamFolderRenameChange(project, newName, oldPath);
+ }
+}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,111 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.jdt.core.IPackageFragmentRoot;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamJavaPackageRenameChange extends SeamProjectChange {
+
+ protected static String[] PACKAGE_NAME_PROPERTIES = {
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME
+ };
+ protected static String[] SOURCE_NAME_PROPERTIES = {
+ ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER,
+ ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER,
+ ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER
+ };
+
+ private IPackageFragmentRoot source;
+ private String newName;
+ private String oldName;
+ private List<Integer> relevantPropertyIndexes = new ArrayList<Integer>();
+
+ /**
+ * @param project
+ */
+ public SeamJavaPackageRenameChange(IProject project, IPackageFragmentRoot source, String newName, String oldName) {
+ super(project);
+ this.source = source;
+ this.newName = newName;
+ this.oldName = oldName;
+ IEclipsePreferences ps = getSeamPreferences();
+ for (int i = 0; i < PACKAGE_NAME_PROPERTIES.length; i++) {
+ String name = ps.get(PACKAGE_NAME_PROPERTIES[i], null);
+ if(name!=null && (oldName.equals(name) || name.startsWith(oldName + "."))) {
+ relevantPropertyIndexes.add(new Integer(i));
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
+ */
+ @Override
+ public boolean isRelevant() {
+ return relevantPropertyIndexes.size()>0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ if(!isRelevant()) {
+ return null;
+ }
+ try {
+ pm.beginTask(getName(), 1);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (Integer index: relevantPropertyIndexes) {
+ String sourceFolderProperty = ps.get(SOURCE_NAME_PROPERTIES[index], null);
+ if(!source.getResource().getFullPath().toString().equals(sourceFolderProperty)) {
+ continue;
+ }
+ String packageProperty = PACKAGE_NAME_PROPERTIES[index];
+ String name = ps.get(packageProperty, null);
+ if(name==null) {
+ continue;
+ }
+ if(oldName.equals(name)) {
+ ps.put(packageProperty, newName);
+ } else if(name.startsWith(oldName + ".")) {
+ ps.put(packageProperty, newName + name.substring(oldName.length()));
+ }
+ }
+
+ try {
+ ps.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return new SeamJavaPackageRenameChange(project, source, oldName, newName);
+ } finally {
+ pm.done();
+ }
+ }
+}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,59 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamJavaPackageRenameParticipant extends SeamRenameParticipant {
+
+ public static final String PARTICIPANT_NAME="seam-JavaPackageRenameParticipant";
+
+ private String oldName;
+ private IPackageFragmentRoot source;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getName()
+ */
+ @Override
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ @Override
+ protected boolean initialize(Object element) {
+ if(!(element instanceof IPackageFragment)) {
+ return false;
+ }
+ IPackageFragment packageFragment = (IPackageFragment)element;
+ oldName = packageFragment.getElementName();
+ IJavaElement parent = packageFragment.getParent();
+ if(parent instanceof IPackageFragmentRoot) {
+ source = (IPackageFragmentRoot)parent;
+ return true;
+ }
+
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamRenameParticipant#createChange(org.eclipse.core.resources.IProject, java.lang.String)
+ */
+ @Override
+ protected SeamProjectChange createChange(IProject project, String newName) {
+ return new SeamJavaPackageRenameChange(project, source, newName, oldName);
+ }
+}
\ No newline at end of file
Copied: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java (from rev 7049, trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamProjectRenameChange extends SeamProjectChange {
+
+ protected String newName;
+ protected String oldName;
+
+ private List<String> relevantProjectNameProperties = new ArrayList<String>();
+ private List<String> relevantSourceFolderProperties = new ArrayList<String>();
+
+ /**
+ * @param project
+ * @param newName
+ * @param oldName
+ */
+ public SeamProjectRenameChange(IProject project, String newName, String oldName) {
+ super(project);
+ this.newName = newName;
+ this.oldName = oldName;
+ IEclipsePreferences ps = getSeamPreferences();
+ for (int i = 0; i < PROJECT_NAME_PROPERTIES.length; i++) {
+ if(oldName.equals(ps.get(PROJECT_NAME_PROPERTIES[i], null))) {
+ relevantProjectNameProperties.add(PROJECT_NAME_PROPERTIES[i]);
+ }
+ }
+ for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
+ if(ps.get(FOLDER_PROPERTIES[i], "").startsWith("/" + oldName + "/")) {
+ relevantSourceFolderProperties.add(FOLDER_PROPERTIES[i]);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
+ */
+ @Override
+ public boolean isRelevant() {
+ return relevantProjectNameProperties.size() > 0 || relevantSourceFolderProperties.size() > 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ if(!isRelevant()) {
+ return null;
+ }
+ try {
+ pm.beginTask(getName(), 1);
+
+ if(project.getName().equals(oldName)) {
+ IResource newProject = ResourcesPlugin.getWorkspace().getRoot().findMember(newName);
+ if(!project.exists() && (newProject instanceof IProject) && newProject.exists()) {
+ project = (IProject)newProject;
+ }
+ }
+ IEclipsePreferences ps = getSeamPreferences();
+ for (String property: relevantProjectNameProperties) {
+ if(oldName.equals(ps.get(property, null))) {
+ ps.put(property, newName);
+ }
+ }
+ String oldPrefix = "/" + oldName + "/";
+ for (String property: relevantSourceFolderProperties) {
+ String oldProperty = ps.get(property, "");
+ if(oldProperty.startsWith(oldPrefix) && oldProperty.length()>oldPrefix.length()) {
+ ps.put(property, "/" + newName + "/" + oldProperty.substring(oldPrefix.length()));
+ }
+ }
+
+ try {
+ ps.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return new SeamProjectRenameChange(project, oldName, newName);
+ } finally {
+ pm.done();
+ }
+ }
+}
\ No newline at end of file
Copied: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameParticipant.java (from rev 7049, trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IProject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamProjectRenameParticipant extends SeamRenameParticipant {
+
+ public static final String PARTICIPANT_NAME="seam-ProjectRenameParticipant";
+
+ private String oldName;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getName()
+ */
+ @Override
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ @Override
+ protected boolean initialize(Object element) {
+ if(!(element instanceof IProject)) {
+ return false;
+ }
+ oldName = ((IProject)element).getName();
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.refactoring.SeamRenameParticipant#createChange(org.eclipse.core.resources.IProject, java.lang.String)
+ */
+ @Override
+ protected SeamProjectChange createChange(IProject project, String newName) {
+ return new SeamProjectRenameChange(project, newName, oldName);
+ }
+}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderChange.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -1,96 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.refactoring;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author Alexey Kazakov
- */
-public class SeamRenameFolderChange extends SeamProjectChange {
-
- private IPath oldPath;
- private IPath newPath;
-
- private List<String> relevantProperties = new ArrayList<String>();
-
- public SeamRenameFolderChange(IProject project, String newName, IPath oldPath) {
- super(project);
- this.oldPath = oldPath;
- this.newPath = oldPath.removeLastSegments(1).append(newName);
-
- IEclipsePreferences ps = getSeamPreferences();
- for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
- String propertyValue = ps.get(FOLDER_PROPERTIES[i], null);
- if(propertyValue==null) {
- continue;
- }
- String oldPathString = oldPath.toString();
- if(propertyValue.equals(oldPathString) ||
- propertyValue.startsWith(oldPathString + "/")) {
- relevantProperties.add(FOLDER_PROPERTIES[i]);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
- */
- @Override
- public boolean isRelevant() {
- return relevantProperties.size()>0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public Change perform(IProgressMonitor pm) throws CoreException {
- if(!isRelevant()) {
- return null;
- }
- try {
- pm.beginTask(getName(), 1);
-
- IEclipsePreferences ps = getSeamPreferences();
- for (String propertyName: relevantProperties) {
- String propertyValue = ps.get(propertyName, "");
- String oldPathString = oldPath.toString();
- if(propertyValue.equals(oldPathString)) {
- ps.put(propertyName, newPath.toString());
- } else if(propertyValue.startsWith(oldPathString + "/")) {
- String newPathString = newPath.toString() + propertyValue.substring(oldPathString.length());
- ps.put(propertyName, newPathString);
- }
- }
-
- try {
- ps.flush();
- } catch (BackingStoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- return new SeamRenameFolderChange(project, oldPath.lastSegment(), newPath);
- } finally {
- pm.done();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameFolderParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -1,78 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.refactoring;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * Updates seam settings of seam projects if somebody renames source folder.
- * @author Alexey Kazakov
- */
-public class SeamRenameFolderParticipant extends RenameParticipant {
- public static final String PARTICIPANT_NAME="seam-RenameFolderParticipant";
-
- private IPath oldPath;
-
- public SeamRenameFolderParticipant() {
- }
-
- @Override
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
- return null;
- }
-
- @Override
- public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- if (!pm.isCanceled()) {
- String newName = getArguments().getNewName();
- if(newName == null || newName.trim().length() == 0) {
- return null;
- }
- CompositeChange change = new CompositeChange("Update Seam Projects");
- IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < ps.length; i++) {
- SeamRenameFolderChange c = new SeamRenameFolderChange(ps[i], newName, oldPath);
- if(c.isRelevant()) change.add(c);
- }
- if(change.getChildren().length > 0) {
- return change;
- }
- }
- return null;
- }
-
- @Override
- public String getName() {
- return PARTICIPANT_NAME;
- }
-
- @Override
- protected boolean initialize(Object element) {
- if(!(element instanceof IFolder)) {
- return false;
- }
- oldPath = ((IResource)element).getFullPath();
-
- return true;
- }
-}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -0,0 +1,63 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+
+/**
+ * @author Alexey Kazakov
+ */
+abstract public class SeamRenameParticipant extends RenameParticipant {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ if (!pm.isCanceled()) {
+ String newName = getArguments().getNewName();
+ if(newName == null || newName.trim().length() == 0) {
+ return null;
+ }
+ CompositeChange change = new CompositeChange("Update Seam Projects");
+ IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (int i = 0; i < ps.length; i++) {
+ SeamProjectChange c = createChange(ps[i], newName);
+ if(c.isRelevant()) change.add(c);
+ }
+ if(change.getChildren().length > 0) {
+ return change;
+ }
+ }
+ return null;
+ }
+
+ abstract protected SeamProjectChange createChange(IProject project, String newName);
+}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.refactoring;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public class SeamRenameProjectChange extends SeamProjectChange {
-
- protected String newName;
- protected String oldName;
-
- private List<String> relevantProjectNameProperties = new ArrayList<String>();
- private List<String> relevantSourceFolderProperties = new ArrayList<String>();
-
- /**
- * @param project
- * @param newName
- * @param oldName
- */
- public SeamRenameProjectChange(IProject project, String newName, String oldName) {
- super(project);
- this.newName = newName;
- this.oldName = oldName;
- IEclipsePreferences ps = getSeamPreferences();
- for (int i = 0; i < PROJECT_NAME_PROPERTIES.length; i++) {
- if(oldName.equals(ps.get(PROJECT_NAME_PROPERTIES[i], null))) {
- relevantProjectNameProperties.add(PROJECT_NAME_PROPERTIES[i]);
- }
- }
- for (int i = 0; i < FOLDER_PROPERTIES.length; i++) {
- if(ps.get(FOLDER_PROPERTIES[i], "").startsWith("/" + oldName + "/")) {
- relevantSourceFolderProperties.add(FOLDER_PROPERTIES[i]);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange#isRelevant()
- */
- @Override
- public boolean isRelevant() {
- return relevantProjectNameProperties.size() > 0 || relevantSourceFolderProperties.size() > 0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public Change perform(IProgressMonitor pm) throws CoreException {
- if(!isRelevant()) return null;
- try {
- pm.beginTask(getName(), 1);
-
- if(project.getName().equals(oldName)) {
- IResource newProject = ResourcesPlugin.getWorkspace().getRoot().findMember(newName);
- if(!project.exists() && (newProject instanceof IProject) && newProject.exists()) {
- project = (IProject)newProject;
- }
- }
- IEclipsePreferences ps = getSeamPreferences();
- for (String property: relevantProjectNameProperties) {
- if(oldName.equals(ps.get(property, null))) {
- ps.put(property, newName);
- }
- }
- String oldPrefix = "/" + oldName + "/";
- for (String property: relevantSourceFolderProperties) {
- String oldProperty = ps.get(property, "");
- if(oldProperty.startsWith(oldPrefix) && oldProperty.length()>oldPrefix.length()) {
- ps.put(property, "/" + newName + "/" + oldProperty.substring(oldPrefix.length()));
- }
- }
-
- try {
- ps.flush();
- } catch (BackingStoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- return new SeamRenameProjectChange(project, oldName, newName);
- } finally {
- pm.done();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.refactoring;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public class SeamRenameProjectParticipant extends RenameParticipant {
- public static final String PARTICIPANT_NAME="seam-RenameProjectParticipant";
-
- IProject project;
- String oldName;
-
- public SeamRenameProjectParticipant() {}
-
- @Override
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
- return null;
- }
-
- @Override
- public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- if (!pm.isCanceled()) {
- String newName = getArguments().getNewName();
- if(newName == null || newName.trim().length() == 0) return null;
- CompositeChange change = new CompositeChange("Update Seam Projects");
- IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < ps.length; i++) {
- SeamRenameProjectChange c = new SeamRenameProjectChange(ps[i], newName, oldName);
- if(c.isRelevant()) change.add(c);
- }
- if(change.getChildren().length > 0) return change;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.Change#getName()
- */
- @Override
- public String getName() {
- return PARTICIPANT_NAME;
- }
-
- @Override
- protected boolean initialize(Object element) {
- if(!(element instanceof IProject)) {
- return false;
- }
- project = (IProject)element;
- oldName = project.getName();
- return true;
- }
-}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-03-24 18:00:37 UTC (rev 7095)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-03-24 18:36:14 UTC (rev 7096)
@@ -23,7 +23,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -62,6 +64,9 @@
static String testSourceFolderPath = "/" + testProjectName + "/" + testSourceFolderName;
static String viewFolderName = "WebContent";
static String viewFolderPath = "/" + warProjectName + "/" + viewFolderName;
+ static String actionPackageName = "ejbdemo";
+ static String modelPackageName = "wardemo";
+ static String testPackageName = "testdemo";
static IProject warProject;
static IProject ejbProject;
static IProject testProject;
@@ -115,18 +120,7 @@
updateFields();
warProject = renameProject(warProject, warProjectName);
seamWarProject = SeamCorePlugin.getSeamProject(warProject, true);
-
- String newParentName = seamEjbProject.getParentProjectName();
- assertEquals("WAR project was renamed but parent seam project property for EJB project was not.", warProjectName, newParentName);
- newParentName = seamTestProject.getParentProjectName();
- assertEquals("WAR project was renamed but parent seam project property for test project was not.", warProjectName, newParentName);
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String modelSources = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "");
- assertEquals("WAR project was renamed but model source folder property was not.", modelSourceFolderPath, modelSources);
-
- String viewFolder = pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "");
- assertEquals("WAR project was renamed but view folder property was not.", viewFolderPath, viewFolder);
+ assertCorrectProperties();
}
public void testEjbProjectRename() throws CoreException {
@@ -134,13 +128,7 @@
updateFields();
ejbProject = renameProject(ejbProject, ejbProjectName);
seamEjbProject = SeamCorePlugin.getSeamProject(ejbProject, true);
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String newEjbName = pref.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, "");
- assertEquals("EJB project was renamed but property was not.", ejbProjectName, newEjbName);
-
- String actionSources = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "");
- assertEquals("EJB project was renamed but action source folder property was not.", actionSourceFolderPath, actionSources);
+ assertCorrectProperties();
}
public void testTestProjectRename() throws CoreException {
@@ -148,53 +136,91 @@
updateFields();
testProject = renameProject(testProject, testProjectName);
seamTestProject = SeamCorePlugin.getSeamProject(testProject, true);
-
- String newTestName = SeamCorePlugin.getSeamPreferences(warProject).get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, "");
- assertEquals("Test project was renamed but property was not.", testProjectName, newTestName);
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String testSources = pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "");
- assertEquals("Test project was renamed but test source folder property was not.", testSourceFolderPath, testSources);
+ assertCorrectProperties();
}
public void testActionSourceFolderRename() throws CoreException {
actionSourceFolderName = "newActionSrc";
renameSourceFolder(actionSourceFolderPath, actionSourceFolderName);
- updateFields();
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String actionSources = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "");
- assertEquals("Action source folder was renamed but property was not.", actionSourceFolderPath, actionSources);
+ assertCorrectProperties();
}
public void testModelSourceFolderRename() throws CoreException {
modelSourceFolderName = "newModelSrc";
renameSourceFolder(modelSourceFolderPath, modelSourceFolderName);
- updateFields();
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String modelSources = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "");
- assertEquals("Model source folder was renamed but property was not.", modelSourceFolderPath, modelSources);
+ assertCorrectProperties();
}
public void testTestSourceFolderRename() throws CoreException {
testSourceFolderName = "newTestSrc";
renameSourceFolder(testSourceFolderPath, testSourceFolderName);
- updateFields();
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
- String testSources = pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "");
- assertEquals("Test source folder was renamed but property was not.", testSourceFolderPath, testSources);
+ assertCorrectProperties();
}
public void testViewFolderRename() throws CoreException {
viewFolderName = "newViewFolder";
renameFolder(viewFolderPath, viewFolderName);
+ assertCorrectProperties();
+ }
+
+ public void testActionPackageRename() throws CoreException {
+ String oldName = actionPackageName;
+ actionPackageName = "newejbdemo";
+ renamePackage(actionSourceFolderPath, oldName, actionPackageName);
+ assertCorrectProperties();
+ }
+
+ public void testModelPackageRename() throws CoreException {
+ String oldName = modelPackageName;
+ modelPackageName = "newwardemo";
+ renamePackage(modelSourceFolderPath, oldName, modelPackageName);
+ assertCorrectProperties();
+ }
+
+ public void testTestPackageRename() throws CoreException {
+ String oldName = testPackageName;
+ testPackageName = "newtestdemo";
+ renamePackage(testSourceFolderPath, oldName, testPackageName);
+ assertCorrectProperties();
+ }
+
+ private void assertCorrectProperties() {
updateFields();
IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
+
+ String parentName = seamEjbProject.getParentProjectName();
+ assertEquals("Parent seam project property for EJB project was not updated.", warProjectName, parentName);
+
+ parentName = seamTestProject.getParentProjectName();
+ assertEquals("Parent seam project property for Test project was not updated.", warProjectName, parentName);
+
+ String ejbName = pref.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, "");
+ assertEquals("EJB project name property was not updated.", ejbProjectName, ejbName);
+
+ String testName = pref.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, "");
+ assertEquals("Test project name property was not updated.", testProjectName, testName);
+
+ String actionSources = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "");
+ assertEquals("Action source folder property was not updated.", actionSourceFolderPath, actionSources);
+
+ String modelSources = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "");
+ assertEquals("Model source folder property was not.", modelSourceFolderPath, modelSources);
+
+ String testSources = pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "");
+ assertEquals("Test source folder property was not updated.", testSourceFolderPath, testSources);
+
String viewFolder = pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "");
- assertEquals("View folder was renamed but property was not.", viewFolderPath, viewFolder);
+ assertEquals("View folder property was not updated.", viewFolderPath, viewFolder);
+
+ String actionPackage = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "");
+ assertEquals("Action package name property was not updated.", actionPackageName, actionPackage);
+
+ String modelPackage = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "");
+ assertEquals("Model package name property was not updated.", modelPackageName, modelPackage);
+
+ String testPackage = pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "");
+ assertEquals("Test package name property was not updated.", testPackageName, testPackage);
}
private void updateFields() {
@@ -278,6 +304,52 @@
return (IFolder)resource;
}
+ private IPackageFragment renamePackage(String sourceFolderPath, String oldPackageName, String newPackageName) throws CoreException {
+ IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(sourceFolderPath);
+ assertNotNull("Can't find source folder: " + sourceFolderPath, resource);
+ IProject project = resource.getProject();
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+ assertNotNull("Can't find java project: " + project.getName(), javaProject);
+ IPackageFragmentRoot root = null;
+ try {
+ IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();
+ for (int i = 0; i < roots.length; i++) {
+ if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE && roots[i].getResource().getFullPath().toString().equals(sourceFolderPath)) {
+ root = roots[i];
+ break;
+ }
+ }
+ } catch (JavaModelException e) {
+ JUnitUtils.fail("Can't find source folder: " + sourceFolderPath, e);
+ }
+ assertNotNull("Can't find source folder: " + sourceFolderPath, root);
+
+ IPackageFragment oldPackage = findPackage(root, oldPackageName);
+ assertNotNull("Can't find package \"" + oldPackageName + "\". So it's impossible to rename it.", oldPackage);
+
+ IJavaElement[] packages = root.getChildren();
+ performRename(RenameSupport.create(oldPackage, newPackageName, RenameSupport.UPDATE_REFERENCES));
+
+ IPackageFragment newPackage = findPackage(root, newPackageName);
+ assertNotNull("Can't find renamed package \"" + newPackageName + "\". It seems this package was not renamed.", newPackage);
+ return null;
+ }
+
+ private IPackageFragment findPackage(IPackageFragmentRoot root, String packageName) {
+ IJavaElement[] packages = null;
+ try {
+ packages = root.getChildren();
+ } catch (JavaModelException e) {
+ JUnitUtils.fail("Can't find package: " + packageName, e);
+ }
+ for (IJavaElement javaElement : packages) {
+ if(javaElement instanceof IPackageFragment && javaElement.getElementName().equals(packageName)) {
+ return (IPackageFragment)javaElement;
+ }
+ }
+ return null;
+ }
+
private IProject renameProject(IProject project, String newProjectName) throws CoreException {
performRename(RenameSupport.create(JavaCore.create(project), newProjectName, RenameSupport.UPDATE_REFERENCES));
18 years
JBoss Tools SVN: r7095 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-03-24 14:00:37 -0400 (Mon, 24 Mar 2008)
New Revision: 7095
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
Code adjustment
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-24 16:43:40 UTC (rev 7094)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-24 18:00:37 UTC (rev 7095)
@@ -275,7 +275,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="submit" value="{jsfvalue(@value)}"
+ <input type="button" value="{jsfvalue(@value)}"
class="{@styleClass}" style="{@style}" title="{tagstring()}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
18 years
JBoss Tools SVN: r7094 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-03-24 12:43:40 -0400 (Mon, 24 Mar 2008)
New Revision: 7094
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
code adjustment
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-03-24 16:21:38 UTC (rev 7093)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-03-24 16:43:40 UTC (rev 7094)
@@ -97,20 +97,19 @@
/** REGEX_EL */
private static final Pattern REGEX_EL = Pattern.compile(
- "[\\$|\\#]\\{.*\\}", Pattern.MULTILINE + Pattern.DOTALL);
+ "[\\$|\\#]\\{.*\\}", Pattern.MULTILINE + Pattern.DOTALL); //$NON-NLS-1$
- private static final String PSEUDO_ELEMENT = "br";
- private static final String PSEUDO_ELEMENT_ATTR = "vpe:pseudo-element";
- private static final String INIT_ELEMENT_ATTR = "vpe:init-element";
- private static final String MOZ_ANONCLASS_ATTR = "_MOZ_ANONCLASS";
- private static final String COMMENT_STYLE = "font-style:italic; color:green";
- private static final String COMMENT_PREFIX = "";
- private static final String COMMENT_SUFFIX = "";
- private static final String INCLUDE_ELEMENT_ATTR = "vpe:include-element";
+ private static final String PSEUDO_ELEMENT = "br"; //$NON-NLS-1$
+ private static final String PSEUDO_ELEMENT_ATTR = "vpe:pseudo-element"; //$NON-NLS-1$
+ private static final String INIT_ELEMENT_ATTR = "vpe:init-element"; //$NON-NLS-1$
+ private static final String MOZ_ANONCLASS_ATTR = "_MOZ_ANONCLASS"; //$NON-NLS-1$
+ private static final String COMMENT_STYLE = "font-style:italic; color:green"; //$NON-NLS-1$
+ private static final String COMMENT_PREFIX = ""; //$NON-NLS-1$
+ private static final String COMMENT_SUFFIX = ""; //$NON-NLS-1$
+ private static final String INCLUDE_ELEMENT_ATTR = "vpe:include-element"; //$NON-NLS-1$
private static final int DRAG_AREA_WIDTH = 10;
private static final int DRAG_AREA_HEIGHT = 10;
- private static final String ATTR_XMLNS = "xmlns";
- private static final String ATTR_DRAG_AVAILABLE_CLASS = "__drag__available_style";
+ private static final String ATTR_DRAG_AVAILABLE_CLASS = "__drag__available_style"; //$NON-NLS-1$
private MozillaEditor visualEditor;
private XulRunnerEditor xulRunnerEditor;
@@ -126,24 +125,23 @@
/** faceletFile */
private boolean faceletFile = false;
- private static final String ATTR_VPE = "vpe";
- private static final String ATTR_VPE_INLINE_LINK_VALUE = "inlinelink";
+ private static final String ATTR_VPE = "vpe"; //$NON-NLS-1$
+ private static final String ATTR_VPE_INLINE_LINK_VALUE = "inlinelink"; //$NON-NLS-1$
- private static final String ATTR_REL_STYLESHEET_VALUE = "stylesheet";
+ private static final String ATTR_REL_STYLESHEET_VALUE = "stylesheet"; //$NON-NLS-1$
- private static final String YES_STRING = "yes";
- private static final String NO_STRING = "no";
- private static final String ZERO_STRING = "0";
- private static final String EMPTY_STRING = "";
+ private static final String YES_STRING = "yes"; //$NON-NLS-1$
+ private static final String ZERO_STRING = "0"; //$NON-NLS-1$
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String ATRIBUTE_BORDER = "border";
- private static final String ATRIBUTE_CELLSPACING = "cellspacing";
- private static final String ATRIBUTE_CELLPADDING = "cellpadding";
+ private static final String ATRIBUTE_BORDER = "border"; //$NON-NLS-1$
+ private static final String ATRIBUTE_CELLSPACING = "cellspacing"; //$NON-NLS-1$
+ private static final String ATRIBUTE_CELLPADDING = "cellpadding"; //$NON-NLS-1$
- private static final String DOTTED_BORDER_STYLE = "border : 1px dotted #808080";
- private static final String DOTTED_BORDER_STYLE_FOR_IMG = "1px dotted #808080";
- private static final String DOTTED_BORDER_STYLE_FOR_TD = "border-left : 1px dotted #808080; border-right : 1px dotted #808080; border-top : 1px dotted #808080; border-bottom : 0px; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only";
- private static final String DOTTED_BORDER_STYLE_FOR_SPAN = "border : 1px solid #0051DD; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only";
+ private static final String DOTTED_BORDER_STYLE = "border : 1px dotted #808080"; //$NON-NLS-1$
+ private static final String DOTTED_BORDER_STYLE_FOR_IMG = "1px dotted #808080"; //$NON-NLS-1$
+ private static final String DOTTED_BORDER_STYLE_FOR_TD = "border-left : 1px dotted #808080; border-right : 1px dotted #808080; border-top : 1px dotted #808080; border-bottom : 0px; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only"; //$NON-NLS-1$
+ private static final String DOTTED_BORDER_STYLE_FOR_SPAN = "border : 1px solid #0051DD; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only"; //$NON-NLS-1$
static private HashSet<String> unborderedSourceNodes = new HashSet<String>();
static {
@@ -595,7 +593,7 @@
if (l != null) {
for (int i = 0; i < l.length; i++) {
ResourceReference item = l[i];
- addLinkNodeToHead("file:///" + item.getLocation(), YES_STRING);
+ addLinkNodeToHead("file:///" + item.getLocation(), YES_STRING); //$NON-NLS-1$
}
}
}
@@ -617,7 +615,7 @@
if ((isLink || (isStyle && ATTR_VPE_INLINE_LINK_VALUE
.equalsIgnoreCase(element.getAttribute(ATTR_VPE))))
&& YES_STRING.equalsIgnoreCase(element
- .getAttribute("ext"))) {
+ .getAttribute(VpeTemplateManager.ATTR_LINK_EXT))) {
headNode.removeChild(node);
}
}
@@ -725,12 +723,12 @@
if (!templateManager.isWithoutPseudoElementContainer(visualParent
.getNodeName())) {
if (VpeDebug.VISUAL_ADD_PSEUDO_ELEMENT) {
- System.out.println("-------------------- addPseudoElement: "
+ System.out.println("-------------------- addPseudoElement: " //$NON-NLS-1$
+ visualParent.getNodeName());
}
nsIDOMElement visualPseudoElement = visualDocument
.createElement(PSEUDO_ELEMENT);
- visualPseudoElement.setAttribute(PSEUDO_ELEMENT_ATTR, "yes");
+ visualPseudoElement.setAttribute(PSEUDO_ELEMENT_ATTR, YES_STRING);
visualParent.appendChild(visualPseudoElement);
}
}
@@ -1306,7 +1304,7 @@
*/
if (!YES_STRING.equalsIgnoreCase(((nsIDOMElement) node
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
- .getAttribute("ext"))) {
+ .getAttribute(VpeTemplateManager.ATTR_LINK_EXT))) {
// int linkAddress =
// MozillaSupports.queryInterface(node,
// nsIStyleSheetLinkingElement.NS_ISTYLESHEETLINKINGELEMENT_IID);
@@ -1718,7 +1716,7 @@
}
protected void setTooltip(nsIDOMElement visualElement, String titleValue) {
- visualElement.setAttribute("title", titleValue);
+ visualElement.setAttribute(HTML.ATTR_TITLE, titleValue);
nsIDOMNodeList children = visualElement.getChildNodes();
long len = children.getLength();
for (long i = 0; i < len; i++) {
@@ -1739,9 +1737,9 @@
String titleValue = getTooltip(sourceElement);
if (titleValue != null) {
- titleValue = titleValue.replaceAll("&", "&");
- titleValue = titleValue.replaceAll("<", "<");
- titleValue = titleValue.replaceAll(">", ">");
+ titleValue = titleValue.replaceAll("&", "&"); //$NON-NLS-1$//$NON-NLS-2$
+ titleValue = titleValue.replaceAll("<", "<"); //$NON-NLS-1$//$NON-NLS-2$
+ titleValue = titleValue.replaceAll(">", ">"); //$NON-NLS-1$//$NON-NLS-2$
}
if (titleValue != null) {
@@ -1751,7 +1749,7 @@
}
private void resetTooltip(nsIDOMElement visualElement, String titleValue) {
- visualElement.setAttribute("title", titleValue);
+ visualElement.setAttribute(HTML.ATTR_TITLE, titleValue);
nsIDOMNodeList children = visualElement.getChildNodes();
long len = children.getLength();
for (long i = 0; i < len; i++) {
@@ -1773,18 +1771,18 @@
int len = attrs.getLength();
for (int i = 0; i < len; i++) {
if (i == 7) {
- return buffer.append("\n\t... ").toString();
+ return buffer.append("\n\t... ").toString(); //$NON-NLS-1$
}
int valueLength = attrs.item(i).getNodeValue().length();
if (valueLength > 30) {
StringBuffer temp = new StringBuffer();
temp.append(attrs.item(i).getNodeValue().substring(0, 15)
- + " ... "
+ + " ... " //$NON-NLS-1$
+ attrs.item(i).getNodeValue().substring(
valueLength - 15, valueLength));
- buffer.append("\n" + attrs.item(i).getNodeName() + ": " + temp);
+ buffer.append("\n" + attrs.item(i).getNodeName() + ": " + temp); //$NON-NLS-1$ //$NON-NLS-2$
} else
- buffer.append("\n" + attrs.item(i).getNodeName() + ": "
+ buffer.append("\n" + attrs.item(i).getNodeName() + ": " //$NON-NLS-1$ //$NON-NLS-2$
+ attrs.item(i).getNodeValue());
}
@@ -1867,8 +1865,8 @@
protected void setReadOnlyElement(nsIDOMElement node) {
String style = node.getAttribute(VpeStyleUtil.ATTRIBUTE_STYLE);
- style = VpeStyleUtil.setParameterInStyle(style, "-moz-user-modify",
- "read-only");
+ style = VpeStyleUtil.setParameterInStyle(style, "-moz-user-modify", //$NON-NLS-1$
+ "read-only"); //$NON-NLS-1$
node.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
}
@@ -1884,7 +1882,7 @@
if (styleClasses == null
|| !(styleClasses.contains(ATTR_DRAG_AVAILABLE_CLASS))) {
// change cursor style to move
- styleClasses = ATTR_DRAG_AVAILABLE_CLASS + " "
+ styleClasses = ATTR_DRAG_AVAILABLE_CLASS + " " //$NON-NLS-1$
+ styleClasses;
}
} else {
@@ -1892,7 +1890,7 @@
if (styleClasses != null) {
styleClasses = styleClasses.replaceAll(
- ATTR_DRAG_AVAILABLE_CLASS, "");
+ ATTR_DRAG_AVAILABLE_CLASS, ""); //$NON-NLS-1$
}
}
selectedElement.setAttribute(HTML.ATTR_CLASS, styleClasses);
@@ -2166,9 +2164,9 @@
XModel model = nature.getModel();
XModelObject webXML = WebAppHelper.getWebApp(model);
XModelObject param = WebAppHelper.findWebAppContextParam(
- webXML, "javax.faces.DEFAULT_SUFFIX");
+ webXML, "javax.faces.DEFAULT_SUFFIX"); //$NON-NLS-1$
if (param != null) {
- String value = param.getAttributeValue("param-value");
+ String value = param.getAttributeValue("param-value"); //$NON-NLS-1$
if (value.length() != 0 && iFile.getName().endsWith(value)) {
isFacelet = true;
18 years
JBoss Tools SVN: r7093 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-24 12:21:38 -0400 (Mon, 24 Mar 2008)
New Revision: 7093
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/WebPromptingProvider.java
Log:
JBIDE-893
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/WebPromptingProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/WebPromptingProvider.java 2008-03-24 16:21:30 UTC (rev 7092)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/WebPromptingProvider.java 2008-03-24 16:21:38 UTC (rev 7093)
@@ -33,7 +33,7 @@
try {
IWebPromptingProvider p = (IWebPromptingProvider)ModelFeatureFactory.getInstance().createFeatureInstance(pns[i][0]);
if(p != null) l.add(p);
- } catch (Exception e) {
+ } catch (ClassCastException e) {
WebModelPlugin.getPluginLog().logError(e);
}
}
18 years
JBoss Tools SVN: r7092 - trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-24 12:21:30 -0400 (Mon, 24 Mar 2008)
New Revision: 7092
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/ITilesDefinitionSetContributor.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/TilesDefinitionSet.java
Log:
JBIDE-893
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/ITilesDefinitionSetContributor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/ITilesDefinitionSetContributor.java 2008-03-24 16:21:22 UTC (rev 7091)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/ITilesDefinitionSetContributor.java 2008-03-24 16:21:30 UTC (rev 7092)
@@ -13,9 +13,10 @@
import java.util.*;
import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
public interface ITilesDefinitionSetContributor {
- Set getTileFiles(XModel model);
+ Set<XModelObject> getTileFiles(XModel model);
boolean isRelevant(XModelTreeEvent event);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/TilesDefinitionSet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/TilesDefinitionSet.java 2008-03-24 16:21:22 UTC (rev 7091)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/helpers/TilesDefinitionSet.java 2008-03-24 16:21:30 UTC (rev 7092)
@@ -30,17 +30,13 @@
static void loadContributors() {
ArrayList<ITilesDefinitionSetContributor> list = new ArrayList<ITilesDefinitionSetContributor>();
for (int i = 0; i < CONTRIBUTORS.length; i++) {
- try {
- Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(CONTRIBUTORS[i]);
- if(watcher instanceof ITilesDefinitionSetContributor)
- list.add((ITilesDefinitionSetContributor)watcher);
- else
- if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!");
- }
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
- }
+ Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(CONTRIBUTORS[i]);
+ if(watcher instanceof ITilesDefinitionSetContributor)
+ list.add((ITilesDefinitionSetContributor)watcher);
+ else
+ if(ModelPlugin.isDebugEnabled()) {
+ ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!");
+ }
}
contributors = list.toArray(new ITilesDefinitionSetContributor[0]);
}
@@ -57,8 +53,8 @@
}
XModel model;
- Set tiles = new HashSet();
- Map definitions = new HashMap();
+ Set<XModelObject> tiles = new HashSet<XModelObject>();
+ Map<String,XModelObject> definitions = new HashMap<String,XModelObject>();
Set<ITilesDefinitionSetListener> listeners = new HashSet<ITilesDefinitionSetListener>();
void setModel(XModel model) {
@@ -66,7 +62,7 @@
update();
}
- public Map getDefinitions() {
+ public Map<String,XModelObject> getDefinitions() {
return definitions;
}
@@ -95,7 +91,7 @@
}
public void update() {
- Set s = new HashSet();
+ Set<XModelObject> s = new HashSet<XModelObject>();
for (int i = 0; i < contributors.length; i++) {
s.addAll(contributors[i].getTileFiles(model));
}
@@ -104,25 +100,25 @@
}
void updateDefinitions() {
- Map d = new HashMap();
- Iterator it = tiles.iterator();
+ Map<String,XModelObject> d = new HashMap<String,XModelObject>();
+ Iterator<XModelObject> it = tiles.iterator();
while(it.hasNext()) {
XModelObject o = (XModelObject)it.next();
XModelObject[] cs = o.getChildren(TilesConstants.ENT_DEFINITION);
for (int i = 0; i < cs.length; i++) d.put(cs[i].getAttributeValue("name"), cs[i]);
}
- Map old = definitions;
+ Map<String,XModelObject> old = definitions;
definitions = d;
- Set removed = new HashSet();
- Set added = new HashSet();
- it = old.keySet().iterator();
+ Set<XModelObject> removed = new HashSet<XModelObject>();
+ Set<XModelObject> added = new HashSet<XModelObject>();
+ Iterator<String> it2 = old.keySet().iterator();
while(it.hasNext()) {
- String key = it.next().toString();
+ String key = it2.next();
if(!d.containsKey(key)) removed.add(old.get(key));
}
- it = d.keySet().iterator();
- while(it.hasNext()) {
- String key = it.next().toString();
+ Iterator<String> kit = d.keySet().iterator();
+ while(kit.hasNext()) {
+ String key = kit.next();
if(!old.containsKey(key)) added.add(d.get(key));
}
if(!removed.isEmpty() || !added.isEmpty()) {
18 years
JBoss Tools SVN: r7091 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-24 12:21:22 -0400 (Mon, 24 Mar 2008)
New Revision: 7091
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java 2008-03-24 16:21:15 UTC (rev 7090)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java 2008-03-24 16:21:22 UTC (rev 7091)
@@ -11,7 +11,6 @@
import java.beans.PropertyChangeListener;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.impl.RegularObjectImpl;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.verification.vrules.*;
import org.jboss.tools.common.verification.vrules.impl.VResultFactoryImpl;
@@ -232,7 +231,7 @@
if (classname == null || classname.length() == 0) return null;
try {
action = (VAction)ModelFeatureFactory.getInstance().createFeatureInstance(classname);
- } catch (Exception th) {
+ } catch (ClassCastException th) {
if(VerificationPlugin.isDebugEnabled()) {
VerificationPlugin.getPluginLog().logError("Unable to create action \""+classname+"\": " + "VRuleModel:getAction");
}
18 years
JBoss Tools SVN: r7090 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-24 12:21:15 -0400 (Mon, 24 Mar 2008)
New Revision: 7090
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsTreeListener.java
Log:
JBIDE-893
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsTreeListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsTreeListener.java 2008-03-24 16:21:06 UTC (rev 7089)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsTreeListener.java 2008-03-24 16:21:15 UTC (rev 7090)
@@ -16,7 +16,6 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
-import org.jboss.tools.jst.web.WebModelPlugin;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.jst.web.ui.WebUiPlugin;
@@ -39,7 +38,7 @@
TreeViewerModelListenerImpl impl = (TreeViewerModelListenerImpl)ModelFeatureFactory.getInstance().createFeatureInstance(classname);
if(impl == null) continue;
listeners.put(nature, impl);
- } catch (Exception e) {
+ } catch (ClassCastException e) {
WebUiPlugin.getPluginLog().logError(e);
}
}
18 years
JBoss Tools SVN: r7089 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools: common/meta/action/impl/handlers and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-24 12:21:06 -0400 (Mon, 24 Mar 2008)
New Revision: 7089
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SpecialWizardFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/UndoRedoHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/ProcessOut.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -13,6 +13,7 @@
import java.util.Hashtable;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.meta.action.impl.*;
import org.jboss.tools.common.meta.action.impl.handlers.ReplaceSignificanceMessageImpl;
@@ -49,8 +50,8 @@
private SignificanceMessage getImplInstance(String clsname) {
try {
return (SignificanceMessage)ModelFeatureFactory.getInstance().createFeatureInstance(clsname);
- } catch (Exception t) {
- //ignore
+ } catch (ClassCastException t) {
+ ModelPlugin.getPluginLog().logError(t);
return defaultFactory;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SpecialWizardFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SpecialWizardFactory.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SpecialWizardFactory.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -17,7 +17,7 @@
public static SpecialWizard createSpecialWizard(String classname) {
try {
return (SpecialWizard)ModelFeatureFactory.getInstance().createFeatureInstance(classname);
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/UndoRedoHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/UndoRedoHandler.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/UndoRedoHandler.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -10,20 +10,11 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
-import java.lang.reflect.*;
-
-import org.eclipse.core.runtime.Status;
-
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.*;
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
public class UndoRedoHandler extends AbstractHandler {
- private String wizardname = (System.getProperty("testmodel") == null)
- ? "XXX.UndoRedoWizard"
- : "XXX.UndoRedoWizard";
public UndoRedoHandler() {}
@@ -33,27 +24,12 @@
public void executeHandler(XModelObject object, java.util.Properties p) throws XModelException {
if(!isEnabled(object)) return;
- call(object.getModel());
+ //obsolete
}
public boolean isEnabled(XModelObject object) {
if(object == null) return false;
return object.getModel().getRoot().isModified();
-/// return object.getModel().getUndoManager().canUndo() ||
-/// object.getModel().getUndoManager().canRedo();
}
- private int call(XModel model) {
- try {
- Object o = ModelFeatureFactory.getInstance().createFeatureInstance(wizardname);
- Class[] types = new Class[]{String.class, XModel.class};
- Method m = o.getClass().getMethod("showDialog", types);
- Object r = m.invoke(o, new Object[]{"Undo/Redo History", model});
- return ((Integer)r).intValue();
- } catch (Exception e) {
- ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load class " + wizardname + ". Or invoke his method 'showDialog'",e));
- return -1;
- }
- }
-
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -234,12 +234,12 @@
if(loader == null || loader.length() == 0) {
adapter = new XAdapter();
} else {
+ String clsname = loader.indexOf('.') >= 0 ? loader : XAttributeImpl.ATTRIBUTE_PREFIX + loader;
try {
- String clsname = loader.indexOf('.') >= 0 ? loader : XAttributeImpl.ATTRIBUTE_PREFIX + loader;
if(loader.length() > 0) {
adapter = (XAdapter)ModelFeatureFactory.getInstance().createFeatureInstance(clsname);
}
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError("XAttributeImpl:loadAdapter:" + e.getMessage());
}
}
@@ -295,14 +295,14 @@
if(loader.length() > 0) {
constraint = (XAttributeConstraint)ModelFeatureFactory.getInstance().createFeatureInstance(clsname);
}
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" + e.getMessage());
+ } catch (ClassCastException e) {
+ ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" + e.getMessage(), e);
}
if(constraint == null) constraint = new XAttributeConstraintImpl();
if(element != null) try {
((XAttributeConstraintImpl)constraint).load(element);
} catch (Exception t) {
- ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" + t.getMessage());
+ ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" + t.getMessage(), t);
}
loader = null;
element = null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -454,7 +454,7 @@
if(adoptclass != null && adoptclass.length() > 0) {
entity.adopt = (XAdoptManager)ModelFeatureFactory.getInstance().createFeatureInstance(adoptclass);
}
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError("XModelEntityImpl:setAdoptManager:" + e.getMessage());
entity.adopt = null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/ProcessOut.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/ProcessOut.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/ProcessOut.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -29,7 +29,7 @@
private boolean isAlive() {
try {
if(is != null && is.available() > 0) return true;
- } catch (Exception e) {
+ } catch (IOException e) {
return fireDead();
}
return p != null || fireDead();
@@ -39,7 +39,7 @@
synchronized(waitMonitor) {
try {
waitMonitor.notifyAll();
- } catch (Exception e) {
+ } catch (IllegalMonitorStateException e) {
//ignore
}
is = null;
@@ -57,7 +57,7 @@
if((av = is.available()) < 1) {
try {
Thread.sleep(200);
- } catch (Exception e) {
+ } catch (InterruptedException e) {
//ignore
}
continue;
@@ -66,7 +66,7 @@
av = is.read(b, 0, av);
}
writer.write(new String(b, 0, av));
- } catch (Exception e) {
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
}
@@ -80,7 +80,7 @@
if(!isAlive()) return;
try {
wait();
- } catch (Exception e) {
+ } catch (InterruptedException e) {
//ignore
}
}
@@ -90,10 +90,10 @@
public void run() {
try {
p.waitFor();
- } catch (Exception e) {
+ } catch (InterruptedException e) {
try {
p.exitValue();
- } catch (Exception e2) {
+ } catch (IllegalThreadStateException e2) {
run();
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XModelObjectIcon.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -14,6 +14,7 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.meta.XMapping;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public class XModelObjectIcon {
@@ -132,8 +133,8 @@
XModelObjectIcon.components.put(key, c);
}
imageComponent = c;
- } catch (Exception e) {
- ///XStudioPlugin.getDefault().getLog().log(new Status(Status.ERROR, XStudioPlugin.PLUGIN_ID, Status.OK, "Cannot load icon " + keys[i] + " " + v,e));
+ } catch (ClassCastException e) {
+ ModelPlugin.getPluginLog().logError(e);
XModelObjectIcon.components.remove(key);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/trees/FileSystemsTree.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -54,7 +54,7 @@
XFilteredTreeConstraint c = null;
try {
c = (XFilteredTreeConstraint)ModelFeatureFactory.getInstance().createFeatureInstance(v);
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
}
if(c == null) continue;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -201,10 +201,12 @@
element.removeAttribute("NAME");
element.removeAttribute("EXTENSION");
return serialize(element, object);
- } catch (Exception e) {
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
- return null;
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
}
+ return null;
}
protected String getDocName() {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -186,7 +186,7 @@
private ServiceDialog createServiceDialog() {
try {
return (ServiceDialog)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.common.model.ui.wizards.one.ServiceDialogImpl");
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError("Cannot create service dialog.");
}
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/Watcher.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -65,19 +65,14 @@
if(contributors.containsKey(nature)) {
continue;
} else {
- try {
- Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(CONTRIBUTORS[i][0]);
- if(watcher instanceof IWatcherContributor) {
- IWatcherContributor c = (IWatcherContributor)watcher;
- c.init(model);
- contributors.put(nature, c);
- } else
- if(ModelPlugin.isDebugEnabled()) {
- ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!");
- }
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
- }
+ Object watcher = ModelFeatureFactory.getInstance().createFeatureInstance(CONTRIBUTORS[i][0]);
+ if(watcher instanceof IWatcherContributor) {
+ IWatcherContributor c = (IWatcherContributor)watcher;
+ c.init(model);
+ contributors.put(nature, c);
+ } else if(ModelPlugin.isDebugEnabled()) {
+ ModelPlugin.getPluginLog().logInfo("Class is not implemented IWatcherContributor interface!");
+ }
}
} else {
contributors.remove(nature);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/ModelFeatureFactory.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -85,6 +86,10 @@
instanceFailures.add(id);
if(!isActive()) return null;
ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e);
+ } catch (InvalidRegistryObjectException e) {
+ instanceFailures.add(id);
+ if(!isActive()) return null;
+ ModelPlugin.getPluginLog().logError("Cannot create model feature instance " + id + ".", e);
}
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java 2008-03-24 16:20:28 UTC (rev 7088)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/WebProjectFactory.java 2008-03-24 16:21:06 UTC (rev 7089)
@@ -18,7 +18,7 @@
static {
try {
instance = (IWebProjectFactory)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.web.tld.WebProjectFactoryImpl");
- } catch (Exception e) {
+ } catch (ClassCastException e) {
ModelPlugin.getPluginLog().logError(e);
}
}
18 years