Author: scabanovich
Date: 2009-09-30 13:06:27 -0400 (Wed, 30 Sep 2009)
New Revision: 17822
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/ant.meta
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelUtil.java
Log:
Dead code removed
Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2009-09-30 17:05:14 UTC
(rev 17821)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2009-09-30 17:06:27 UTC
(rev 17822)
@@ -127,8 +127,6 @@
class="org.jboss.tools.common.meta.help.HelpHandler"/>
<xclass id="org.jboss.tools.common.model.engines.impl.EnginesLoader"
class="org.jboss.tools.common.model.engines.impl.EnginesLoader"/>
- <xclass id="org.jboss.tools.common.model.engines.impl.StopProcessHandler"
- class="org.jboss.tools.common.model.engines.impl.StopProcessHandler"/>
<xclass
id="org.jboss.tools.common.model.files.handlers.InvokingWizardHandler"
class="org.jboss.tools.common.model.files.handlers.InvokingWizardHandler"/>
<xclass
id="org.jboss.tools.common.model.filesystems.impl.CreateFileHandler"
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/meta/ant.meta
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/meta/ant.meta 2009-09-30
17:05:14 UTC (rev 17821)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/meta/ant.meta 2009-09-30
17:06:27 UTC (rev 17822)
@@ -89,9 +89,6 @@
<XActionItem
HandlerClassName="org.jboss.tools.common.model.handlers.RunAntHandler"
ICON="action.start" displayName="Run Ant..."
kind="action" name="Run"/>
- <XActionItem HIDE="disabled"
-
HandlerClassName="org.jboss.tools.common.model.engines.impl.StopProcessHandler"
- ICON="action.stop" displayName="Stop" kind="action"
name="Stop"/>
</XActionItem>
<XActionItem ICON="action.empty" kind="list"
name="Properties">
<XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java 2009-09-30
17:05:14 UTC (rev 17821)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithExternalHandler.java 2009-09-30
17:06:27 UTC (rev 17822)
@@ -84,12 +84,6 @@
if(OpenWithHelper.validatePath(actionname, editor)) new OWEProcess(editor,
filename).start();
}
- public static void startExplorer(XModel model, String url) throws XModelException {
- XModelObject editor = model.getByPath("%Options%/External Programs/Internet
Browser"); //$NON-NLS-1$
- if(editor == null) throw new XModelException("External Program 'Internet
Browser' is not set in Options.");
- if(OpenWithHelper.validatePath("Open", editor)) new OWEProcess(editor,
url, true).start(); //$NON-NLS-1$
- }
-
}
class OWEProcess extends XProcess {
Deleted:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java 2009-09-30
17:05:14 UTC (rev 17821)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/StopProcessHandler.java 2009-09-30
17:06:27 UTC (rev 17822)
@@ -1,41 +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.common.model.engines.impl;
-
-import java.text.MessageFormat;
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.util.*;
-import org.jboss.tools.common.meta.action.impl.*;
-
-public class StopProcessHandler extends AbstractHandler {
-
- public StopProcessHandler() {}
-
- public boolean isEnabled(XModelObject object) {
- if(object == null) return false;
- return (object != null &&
XProcessStorage.getDefaultStorage().getRunningInstances(object.getPath()) != null);
- }
-
- public void executeHandler(XModelObject object, Properties p) throws XModelException
{
- if(!isEnabled(object)) return;
- String path = object.getPath();
- XProcessStorage s = XProcessStorage.getDefaultStorage();
- HashMap<Long,XProcess> map = s.getRunningInstances(path);
- Long[] ls = map.keySet().toArray(new Long[0]);
- for (int i = 0; i < ls.length; i++) {
- s.stopInstance(path, ls[i].longValue());
- object.getModel().getOut().println(MessageFormat.format("Process
executing {0} ({1}) stopped.",
- FindObjectHelper.makeRef(object), new Date(ls[i].longValue())));
- }
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java 2009-09-30
17:05:14 UTC (rev 17821)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java 2009-09-30
17:06:27 UTC (rev 17822)
@@ -1,66 +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.common.model.engines.impl;
-
-import java.util.*;
-
-public class XProcessStorage {
- private static XProcessStorage storage = new XProcessStorage();
-
- public static XProcessStorage getDefaultStorage() {
- return storage;
- }
-
- private HashMap<String,HashMap<Long,XProcess>> objects = new
HashMap<String,HashMap<Long,XProcess>>();
-
- public XProcessStorage() {}
-
- public void addInstance(String path, XProcess p) {
- if(p == null || !p.isRunning()) return;
- getInstances(path).put(Long.valueOf(System.currentTimeMillis()), p);
- }
-
- private HashMap<Long,XProcess> getInstances(String path) {
- HashMap<Long,XProcess> is = objects.get(path);
- if(is == null) {
- is = new HashMap<Long,XProcess>();
- objects.put(path, is);
- }
- return is;
- }
-
- public HashMap<Long,XProcess> getRunningInstances(String path) {
- HashMap<Long,XProcess> is = objects.get(path);
- if(is == null) return null;
- validate(is);
- return (is.size() == 0) ? null : is;
- }
-
- private void validate(HashMap<Long,XProcess> is) {
- Iterator ks = is.keySet().iterator();
- while(ks.hasNext()) {
- Object k = ks.next();
- XProcess p = is.get(k);
- if(!p.isRunning()) ks.remove();
- }
- }
-
- public void stopInstance(String path, long time) {
- HashMap<Long,XProcess> is = getRunningInstances(path);
- if(is == null) return;
- Long l = Long.valueOf(time);
- XProcess p = is.get(l);
- if(p == null) return;
- p.stop();
- is.remove(l);
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java 2009-09-30
17:05:14 UTC (rev 17821)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java 2009-09-30
17:06:27 UTC (rev 17822)
@@ -1,22 +0,0 @@
-package org.jboss.tools.common.model.util;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.common.model.util.XBundle"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelUtil.java 2009-09-30
17:05:14 UTC (rev 17821)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelUtil.java 2009-09-30
17:06:27 UTC (rev 17822)
@@ -14,31 +14,11 @@
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
-import org.jboss.tools.common.model.impl.*;
public class XModelUtil {
- private static final String DEFAULT_MODEL_VERSION = "5.0"; //$NON-NLS-1$
-
private static final String PROPERTIES_ACTION = "Properties/Properties";
//$NON-NLS-1$
private static final String EDIT_ACTION = "Edit"; //$NON-NLS-1$
- public static void addModifyListener(XModel model, Object listener) {
- RootImpl impl = (RootImpl)model.getRoot();
- impl.addModifyListener(listener);
- }
-
- public static void addHistoryListener(XModel model, Object listener) {
- model.getUndoManager().addListener(listener);
- }
-
- public static String getModelVersion(XModel model) {
- XModelObject fss = FileSystemsHelper.getFileSystems(model);
- if(fss == null) return DEFAULT_MODEL_VERSION;
- String modelVersionStr = fss.getAttributeValue(XModelConstants.MODEL_VERSION);
- return (modelVersionStr == null || "".equals(modelVersionStr)) ?
DEFAULT_MODEL_VERSION : modelVersionStr; //$NON-NLS-1$
- }
-
public static void openProperyDialog(XModelObject object){
XActionInvoker.invoke(PROPERTIES_ACTION, object, new Properties());
}