Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbridgha2006-07-26 23:03:08 +0000
committercbridgha2006-07-26 23:03:08 +0000
commitba83d95a3128c6747331c3ab14f15fcbaa29c789 (patch)
tree0004832e2e81a44453cac4ab0741666c24d4f404
parent4dc7b31a55c230c6050c7e699c4158a9368327b4 (diff)
downloadwebtools.javaee-ba83d95a3128c6747331c3ab14f15fcbaa29c789.tar.gz
webtools.javaee-ba83d95a3128c6747331c3ab14f15fcbaa29c789.tar.xz
webtools.javaee-ba83d95a3128c6747331c3ab14f15fcbaa29c789.zip
[151934] Remove Auto Migration
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java2
-rw-r--r--plugins/org.eclipse.wst.web.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.wst.web.ui/plugin.xml10
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java125
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties1
5 files changed, 140 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java
index e944dc470..598bc4be0 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java
@@ -281,6 +281,7 @@ public class J2EEComponentProjectMigrator implements IComponentProjectMigrator {
try {
edit = StructureEdit.getStructureEditForWrite(aProject);
if (edit == null) return; // Not a component project....
+ edit.getModuleStructuralModel().setUseOldFormat(true);
if (edit.getComponent() == null) return; // Can't migrate
ComponentType type = edit.getComponent().getComponentType();
if (type == null) return; // Can't migrate
@@ -292,6 +293,7 @@ public class J2EEComponentProjectMigrator implements IComponentProjectMigrator {
finally {
if (edit != null) {
edit.save(null);
+ edit.getModuleStructuralModel().setUseOldFormat(false);
edit.dispose();
}
}
diff --git a/plugins/org.eclipse.wst.web.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.wst.web.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..b702e187b
--- /dev/null
+++ b/plugins/org.eclipse.wst.web.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Wed Jul 26 13:39:02 EDT 2006
+eclipse.preferences.version=1
+encoding//static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties=8859_1
diff --git a/plugins/org.eclipse.wst.web.ui/plugin.xml b/plugins/org.eclipse.wst.web.ui/plugin.xml
index 5fc6a5520..9a44ae4a4 100644
--- a/plugins/org.eclipse.wst.web.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.web.ui/plugin.xml
@@ -39,7 +39,7 @@
</extension>
- <!-- ====================================================== -->
+<!-- ====================================================== -->
<!-- Extension point: org.eclipse.ui.projectNatureImages -->
<!-- Purpose: Attach icon overlays for J2EE project natures -->
<!-- ====================================================== -->
@@ -57,5 +57,13 @@
<page class="org.eclipse.wst.web.ui.internal.wizards.SimpleWebFacetInstallPage"/>
</wizard-pages>
</extension>
+
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ markerType="org.eclipse.wst.common.modulecore.ModuleCoreValidatorMarker"
+ class="org.eclipse.wst.web.ui.internal.ModuleCoreValidatorMarkerResolutions">
+ </markerResolutionGenerator>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java
new file mode 100644
index 000000000..6b44ee4c4
--- /dev/null
+++ b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java
@@ -0,0 +1,125 @@
+/******************************************************************************
+ * Copyright (c) 2005 BEA Systems, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * Konstantin Komissarchik - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.wst.web.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.ui.IMarkerResolutionGenerator;
+import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
+import org.eclipse.wst.common.componentcore.internal.ModuleMigratorManager;
+
+/**
+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
+ */
+
+public final class ModuleCoreValidatorMarkerResolutions
+
+ implements IMarkerResolutionGenerator
+
+{
+ public IMarkerResolution[] getResolutions( IMarker marker )
+ {
+ return new IMarkerResolution[]
+ {
+ new ModuleCoreMigrationResolution( marker )
+ };
+ }
+
+ private class ModuleCoreMigrationResolution extends WorkbenchMarkerResolution
+
+ implements IMarkerResolution,IMarkerResolution2
+
+ {
+ private final IMarker theMarker;
+ private final String MARKERTYPE = "org.eclipse.wst.common.modulecore.ModuleCoreValidatorMarker";
+ private final IMarker[] NO_MARKERS= new IMarker[0];
+
+ public ModuleCoreMigrationResolution( IMarker marker )
+ {
+ this.theMarker = marker;
+ }
+
+ public String getLabel()
+ {
+ return Resources.migrateMetaData;
+ }
+
+
+
+ public void run( IMarker marker )
+ {
+
+ IProject proj = marker.getResource().getProject();
+
+ try
+ {
+ ModuleMigratorManager manager = ModuleMigratorManager.getManager(proj);
+ if (!manager.isMigrating() && !ResourcesPlugin.getWorkspace().isTreeLocked())
+ manager.migrateOldMetaData(proj,true);
+ }
+ catch( Exception e )
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public String getDescription() {
+ return Resources.migrateMetaData;
+ }
+
+ public Image getImage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IMarker[] findOtherMarkers(IMarker[] markers) {
+ List marks = new ArrayList();
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ try {
+ if (marker.getType().equals(MARKERTYPE) && !(marker.equals(theMarker)))
+ marks.add(marker);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return (IMarker[])marks.toArray(new IMarker[marks.size()]);
+ }
+
+ }
+
+ private static final class Resources
+
+ extends NLS
+
+ {
+ public static String migrateMetaData;
+
+ static
+ {
+ initializeMessages( ModuleCoreValidatorMarkerResolutions.class.getName(),
+ Resources.class );
+ }
+ }
+
+
+}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties
new file mode 100644
index 000000000..094e33c9c
--- /dev/null
+++ b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties
@@ -0,0 +1 @@
+migrateMetaData=Migrate WTP metadata

Back to the top