Author: scabanovich
Date: 2009-05-12 06:54:15 -0400 (Tue, 12 May 2009)
New Revision: 15225
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:38:43 UTC (rev
15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:54:15 UTC (rev
15225)
@@ -191,8 +191,8 @@
class="org.jboss.tools.jst.web.tld.model.handlers.PaletteAdopt"/>
<xclass
id="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"
class="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"/>
- <xclass id="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
- class="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"/>
+ <xclass id="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
+ class="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"/>
<xclass id="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"
class="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"/>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12
10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12
10:54:15 UTC (rev 15225)
@@ -334,7 +334,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -490,7 +490,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12
10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12
10:54:15 UTC (rev 15225)
@@ -349,7 +349,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -523,7 +523,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
@@ -822,7 +822,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -996,7 +996,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action"
name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+
HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp"
kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java 2009-05-12
10:54:15 UTC (rev 15225)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.model.handlers;
+
+import java.util.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.impl.*;
+import org.jboss.tools.common.meta.action.impl.*;
+
+public class ResetFileDateHandler extends AbstractHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ return (object != null && getParentFolder(object) != null);
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException
{
+ FolderImpl f = getParentFolder(object);
+ if(f != null) f.changeChildTimeStamp(object);
+ }
+
+ private FolderImpl getParentFolder(XModelObject o) {
+ XModelObject p = o.getParent();
+ if(!(p instanceof FolderImpl)) return null;
+ return (FolderImpl)p;
+ }
+
+}
+
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12
10:38:43 UTC (rev 15224)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12
10:54:15 UTC (rev 15225)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.filesystems.impl.*;
-import org.jboss.tools.common.meta.action.impl.*;
-
-public class ResetFileDateHandler extends AbstractHandler {
-
- public boolean isEnabled(XModelObject object) {
- return (object != null && getParentFolder(object) != null);
- }
-
- public void executeHandler(XModelObject object, Properties p) throws XModelException
{
- FolderImpl f = getParentFolder(object);
- if(f != null) f.changeChildTimeStamp(object);
- }
-
- private FolderImpl getParentFolder(XModelObject o) {
- XModelObject p = o.getParent();
- if(!(p instanceof FolderImpl)) return null;
- return (FolderImpl)p;
- }
-
-}
-
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12
10:38:43 UTC (rev 15224)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12
10:54:15 UTC (rev 15225)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.impl.handlers.*;
-import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
-
-public class ResetWebAppDateHandler extends DefaultRedirectHandler {
-
- protected XModelObject getTrueSource(XModelObject source) {
- return WebAppHelper.getWebApp(source.getModel());
- }
-
-}
-
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12
10:38:43 UTC (rev 15224)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12
10:54:15 UTC (rev 15225)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.icons.impl.*;
-import org.jboss.tools.jst.web.WebModelPlugin;
-
-public class TomcatStateIcon implements ImageComponent {
-
- public TomcatStateIcon() {}
-
- public int getHash(XModelObject obj) {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- return (b) ? 72618 : 37156;
- }
-
- public Image getImage(XModelObject obj) {
- try {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- String s = (b) ? "struts.tomcat.running" :
"struts.tomcat.stopped";
- return obj.getModelEntity().getMetaModel().getIconList().getImage(s,
"default.unknown");
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- return null;
- }
- }
-
-}
Deleted:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12
10:38:43 UTC (rev 15224)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12
10:54:15 UTC (rev 15225)
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.io.File;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.launching.*;
-import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.options.Preference;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.jst.web.*;
-
-public class TomcatVMHelper {
-
- static String TOOLS_JAR_SUFFIX = File.separator + "lib" + File.separator +
"tools.jar";
-
- public static String findToolsJarInVM(String jvmPath) {
- if(jvmPath == null) return null;
- File jvmFile = new File(jvmPath);
- if(!jvmFile.exists()) return null;
- String path = jvmPath + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- path = jvmFile.getParent() + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- return null;
- }
-
- public static String createVM(String path) throws XModelException {
- String jvm = findVM(path);
- if(jvm == null) {
- jvm = new File(path).getName();
- if("jre".equals(jvm)) jvm = new File(path).getParentFile().getName();
- if(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm) != null) {
- int i = 0;
- while(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm + (++i))
!= null);
- jvm = jvm + i;
- }
-
- IVMInstallType type =
JavaRuntime.getVMInstallType("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
- IVMInstall vm = type.createVMInstall(jvm);
- vm.setInstallLocation(new File(path));
- vm.setLibraryLocations(type.getDefaultLibraryLocations(new File(path)));
- vm.setName(jvm);
- try {
- JavaRuntime.saveVMConfiguration();
- } catch (CoreException e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
-
- }
- if(!jvm.equals(JavaRuntime.getDefaultVMInstall().getName())) {
- getUseDefaultJVMPreference().setValue("no");
- }
- getJVMNamePreference().setValue(jvm);
- return jvm;
- }
-
- static String findVM(String path) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- File installPath = js[j].getInstallLocation();
- if(installPath!=null && installPath.getAbsolutePath().equalsIgnoreCase(path))
{
- return js[j].getName();
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall(String name) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getName().equals(name)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstallById(String id) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getId().equals(id)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall() {
- if("no".equals(getUseDefaultJVMPreference().getValue())) {
- IVMInstallType[] jvmType = JavaRuntime.getVMInstallTypes();
- String selectedJVMName = getJVMNamePreference().getValue();
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("Finding selected JVM is " +
selectedJVMName);
- }
- for (int i = 0; i < jvmType.length; i++) {
- IVMInstall[] jvmInstall = jvmType[i].getVMInstalls();
- for (int j = 0; j < jvmInstall.length; j++) {
-
- if(jvmInstall[j].getName().equals(selectedJVMName)) {
- return jvmInstall[j];
- }
- }
- }
- }
- return JavaRuntime.getDefaultVMInstall();
- }
-
- public static Preference getUseDefaultJVMPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_USE_DEFAULT_JVM = " +
WebPreference.USE_DEFAULT_JVM.getValue());
- }
- return WebPreference.USE_DEFAULT_JVM;
- }
-
- public static Preference getJVMNamePreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_JVM = " +
WebPreference.SERVER_JVM.getValue());
- }
- return WebPreference.SERVER_JVM;
- }
-
- public static Preference getWarningPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_WARNING = " +
WebPreference.SERVER_WARNING.getValue());
- }
- return WebPreference.SERVER_WARNING;
- }
-
-}