This commit was manufactured by cvs2svn to create tag 'v20050209'.
diff --git a/plugins/org.eclipse.jem.util/.classpath b/plugins/org.eclipse.jem.util/.classpath
deleted file mode 100644
index 76c372b..0000000
--- a/plugins/org.eclipse.jem.util/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="jemutil/"/>
- <classpathentry kind="src" path="property_files/"/>
- <classpathentry kind="src" path="jemutil-nonworkbnech/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jem.util/.cvsignore b/plugins/org.eclipse.jem.util/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/plugins/org.eclipse.jem.util/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/plugins/org.eclipse.jem.util/.options b/plugins/org.eclipse.jem.util/.options
deleted file mode 100644
index 0565417..0000000
--- a/plugins/org.eclipse.jem.util/.options
+++ /dev/null
@@ -1,3 +0,0 @@
-org.eclipse.jem.util/debug/logtrace=false
-org.eclipse.jem.util/debug/logtracefile=false
-org.eclipse.jem.util/debug/loglevel=WARNING
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/.project b/plugins/org.eclipse.jem.util/.project
deleted file mode 100644
index e0e4120..0000000
--- a/plugins/org.eclipse.jem.util/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jem.util</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jem.util/README_for_PerformanceMonitorUtil_Compile_Errors.txt b/plugins/org.eclipse.jem.util/README_for_PerformanceMonitorUtil_Compile_Errors.txt
deleted file mode 100644
index e028980..0000000
--- a/plugins/org.eclipse.jem.util/README_for_PerformanceMonitorUtil_Compile_Errors.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-If you are getting compile errors in PerformanceMonitorUtil and PresentPerformanceMonitor classes it is because you
-don't have org.eclipse.perfmsr.core plugin installed. This is an optional plugin that is usually never needed
-except for performance testing.
-
-So to get around the compile errors we've created a stub plugin that you can use just for compiling. To use this
-go to CVS Repository view and check out as a project the org.eclipse.jem.util/org.eclipse.permsr.core.stub directory.
-This will create a plugin project with this as a stub for the performance monitor. You can then compile and run
-from the Run Runtime Workbench launches.
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/about.html b/plugins/org.eclipse.jem.util/about.html
deleted file mode 100644
index 9db411a..0000000
--- a/plugins/org.eclipse.jem.util/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, "Program" will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or
-other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/build.properties b/plugins/org.eclipse.jem.util/build.properties
deleted file mode 100644
index e2660e1..0000000
--- a/plugins/org.eclipse.jem.util/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-source.util.jar = jemutil/,\
- property_files/,\
- jemutil-nonworkbnech/
-output.util.jar = bin/
-bin.includes = plugin.xml,\
- util.jar,\
- .options,\
- about.html,\
- plugin.properties
-src.includes = schema/,\
- about.html
diff --git a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/LogEntry.java b/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/LogEntry.java
deleted file mode 100644
index fc66d66..0000000
--- a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/LogEntry.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: LogEntry.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintWriter;
-
-/**
- * This class should be used when logging information which should be grouped together. Instead of creating a new instance of this class every time it
- * is needed, for performance reasons, create an instance and reuse it.
- *
- *
- * @since 1.0.0
- */
-public class LogEntry {
-
- private int _executionMap = 0;
-
- private Throwable _caughtException = null;
-
- private String _propertiesFileName = null;
-
- private String localeOfOrigin = null;
-
- private String sourceIdentifier;
-
- private String elapsedTime;
-
- private String text;
-
- private String messageTypeIdentifier;
-
- /**
- * The file name parameter must be a name which can be used by ResourceBundle to load the string from the .properties file. The parameter must not
- * be null or the empty string.
- *
- * @param propertiesFileName
- *
- * @since 1.0.0
- */
- public LogEntry(String propertiesFileName) {
- setPropertiesFileName(propertiesFileName);
- }
-
- /**
- * Default Constructor
- */
- public LogEntry() {
- }
-
- /**
- * Get execution map
- *
- * @return execution map
- *
- * @since 1.0.0
- */
- public int getExecutionMap() {
- return _executionMap;
- }
-
- /**
- * Get the properties file name
- *
- * @return properties file name or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public String getPropertiesFileName() {
- return _propertiesFileName;
- }
-
- /**
- * Get target exception
- *
- * @return target exception or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public Throwable getTargetException() {
- return _caughtException;
- }
-
- /**
- * Get locale of origin
- *
- * @return locale of origin or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public String getLocaleOfOrigin() {
- return localeOfOrigin;
- }
-
- /**
- * Get source identifier.
- *
- * @return source identifier or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public String getSourceidentifier() {
- return sourceIdentifier;
- }
-
- /**
- * Get elapsed time
- *
- * @return elapsed time
- *
- * @since 1.0.0
- */
- public String getElapsedTime() {
- return elapsedTime;
- }
-
- /**
- * Get the message type identifier
- *
- * @return message type identifier or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public String getMessageTypeIdentifier() {
- return messageTypeIdentifier;
- }
-
- /**
- * Set execution map
- *
- * @param map
- *
- * @since 1.0.0
- */
- public void setExecutionMap(int map) {
- _executionMap = map;
- }
-
- /**
- * Set properties file name
- *
- * @param fName
- *
- * @since 1.0.0
- */
- public void setPropertiesFileName(String fName) {
- _propertiesFileName = fName;
- }
-
- /**
- * Set target exception
- *
- * @param exc
- *
- * @since 1.0.0
- */
- public void setTargetException(Throwable exc) {
- _caughtException = exc;
- }
-
- /**
- * Append stacktrace of current stack (at the time of call to this method) to the text buffer.
- *
- *
- * @since 1.0.0
- */
- public void appendStackTrace() {
- // Grab the stack trace from the Thread ...
- ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
- PrintWriter printWriter = new PrintWriter(byteOutput);
- // Can't call Thread.dumpStack() because it doesn't take a writer as input.
- // Copy its mechanism instead.
- new Exception("Stack trace").printStackTrace(printWriter); //$NON-NLS-1$
- printWriter.flush();
-
- // and update the text to the LogEntry's text.
- StringBuffer buffer = new StringBuffer();
- buffer.append(getText());
- buffer.append("\n"); //$NON-NLS-1$
- buffer.append(byteOutput.toString());
- setText(buffer.toString());
- }
-
- /**
- * Get the text.
- *
- * @return text or or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public String getText() {
- return text;
- }
-
- /**
- * Set the text
- *
- * @param string
- *
- * @since 1.0.0
- */
- public void setText(String string) {
- text = string;
- }
-
- /**
- * Set every entry to the default value except the properties file name.
- *
- *
- * @since 1.0.0
- */
- public void reset() {
- setExecutionMap(0);
- setTargetException(null);
- localeOfOrigin = null;
- sourceIdentifier = null;
- elapsedTime = null;
- setText(null);
- }
-
- /**
- * Set locale of origin.
- *
- * @param origin
- *
- * @since 1.0.0
- */
- public void setLocaleOfOrigin(String origin) {
- localeOfOrigin = origin;
- }
-
- /**
- * Set source id.
- *
- * @param id
- *
- * @since 1.0.0
- */
- public void setSourceID(String id) {
- sourceIdentifier = id;
- }
-
- /**
- * Set elapsed time.
- *
- * @param time
- *
- * @since 1.0.0
- */
- public void setElapsedTime(long time) {
- elapsedTime = String.valueOf(time);
- }
-
- /**
- * Set source identifier.
- *
- * @param string
- *
- * @since 1.0.0
- */
- public void setSourceIdentifier(String string) {
- setSourceID(string);
- }
-
- /**
- * Set message type identifier.
- *
- * @param string
- *
- * @since 1.0.0
- */
- public void setMessageTypeIdentifier(String string) {
- messageTypeIdentifier = string;
- }
-
- /**
- * Set message type id. Same as <code>setMessageTypeIdentifier.</code>
- * @param string
- *
- * @since 1.0.0
- */
- public void setMessageTypeID(String string) {
- setMessageTypeIdentifier(string);
- }
-
- /**
- * Set tokens. (Currently this is ignored).
- *
- * @param strings
- *
- * @since 1.0.0
- */
- public void setTokens(String[] strings) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer b = new StringBuffer();
- if (text != null)
- b.append(text);
- if (_caughtException != null)
- b.append(_caughtException.toString());
- return b.toString();
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer.java b/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer.java
deleted file mode 100644
index 042c36e..0000000
--- a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: ILogRenderer.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxy;
-
-/**
- * Basic log renderer interface. It is replaced by the extension <code>ILogRenderer2.</code>
- *
- * @since 1.0.0
- */
-public interface ILogRenderer {
-
- /**
- * Logged to console.
- */
- final public static String CONSOLE_DESCRIPTION = "console"; //$NON-NLS-1$
-
- /**
- * Logged to workbench.
- */
- final public static String WORKBENCH_DESCRIPTION = "workbench log"; //$NON-NLS-1$
-
- /**
- * Not logged.
- */
- final public static String NOLOG_DESCRIPTION = ""; //$NON-NLS-1$
-
- /**
- * Log levels. These are deprecated, use <code>java.util.logging.Level</code> codes instead.
- */
- final public static int LOG_ERROR = 0;
-
- final public static int LOG_TRACE = 1;
-
- final public static int LOG_WARNING = 2;
-
- final public static int LOG_INFO = 3;
-
- final public static String DefaultPluginID = "org.eclipse.jem.util"; //$NON-NLS-1$
-
- /**
- * Log the string at the specified type.
- *
- * @param msg
- * @param type
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(String msg, int type);
-
- /**
- * Start or stop the tracing.
- *
- * @param Flag
- * <code>true</code> to start the tracing.
- *
- * @since 1.0.0
- */
- public void setTraceMode(boolean Flag);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer2.java b/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer2.java
deleted file mode 100644
index 9c70d50..0000000
--- a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/ILogRenderer2.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: ILogRenderer2.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxy;
-
-import java.util.logging.Level;
-
-/**
- * Log renderer that provides more function. Basically it can handle
- * the logging of specific types in a different manner than the default
- * conversion to string supplied by Logger.
- *
- * It also uses the Level classes from java.util.logging as the logging levels.
- *
- * @since 1.0.0
- */
-public interface ILogRenderer2 extends ILogRenderer {
-
- /**
- * When Logger.setLevel(DEFAULT): restore to what the default level was.
- * When log(...,DEFAULT): Log at the default level for the type of object.
- */
- static final Level DEFAULT = new Logger.LocalLevel("DEFAULT", Integer.MAX_VALUE-1);
-
- /**
- * When log(...,TRACE) : Log only when in trace mode.
- * Don't use in Logger.setLevel(). Has no meaning in that case.
- */
- static final Level TRACE = new Logger.LocalLevel("TRACE", Integer.MAX_VALUE-2);
-
- /**
- * Log the throwable at the given level (if DEFAULT, use default level for a throwable).
- *
- * @param t
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(Throwable t, Level level);
-
- /**
- * Log the object at the given level (if DEFAULT, use default level for an object).
- *
- * @param o
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(Object o, Level level);
-
- /**
- * Log the boolean at the given level (if DEFAULT, use default level for a boolean).
- *
- * @param b
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(boolean b, Level level);
-
- /**
- * Log the char at the given level (if DEFAULT, use default level for a char).
- *
- * @param c
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(char c, Level level);
-
- /**
- * Log the byte at the given level (if DEFAULT, use default level for a byte).
- *
- * @param b
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(byte b, Level level);
-
- /**
- * Log the short at the given level (if DEFAULT, use default level for a short).
- *
- * @param s
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(short s, Level level);
-
- /**
- * Log the int at the given level (if DEFAULT, use default level for an int).
- *
- * @param i
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(int i, Level level);
-
- /**
- * Log the long at the given level (if DEFAULT, use default level for a long).
- *
- * @param l
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(long l, Level level);
-
- /**
- * Log the float at the given level (if DEFAULT, use default level for a float).
- *
- * @param f
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(float f, Level level);
-
- /**
- * Log the double at the given level (if DEFAULT, use default level for a double).
- *
- * @param d
- * @param level
- * @return
- *
- * @since 1.0.0
- */
- String log(double d, Level level);
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/JDKConsoleRenderer.java b/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/JDKConsoleRenderer.java
deleted file mode 100644
index a491ef5..0000000
--- a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/JDKConsoleRenderer.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: JDKConsoleRenderer.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxy;
-
-import java.util.logging.Level;
-
-/**
- * Default log renderer to use when not running under Eclipse. It logs to sysout and syserr.
- *
- * @since 1.1.0
- */
-
-public class JDKConsoleRenderer implements ILogRenderer2 {
-
- private boolean fTraceMode = false; // will we actually punch trace messaged or not
-
- private boolean fSettingTrace = false;
-
- private Logger fMyLogger = null;
-
- /**
- * Constructer taking a logger.
- *
- * @param logger
- *
- * @since 1.1.0
- */
- public JDKConsoleRenderer(Logger logger) {
- super();
- fMyLogger = logger;
- fTraceMode = fMyLogger.getTraceMode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer#log(java.lang.String, int)
- */
- public String log(String msg, int type) {
-
- if (type == ILogRenderer.LOG_TRACE && !fTraceMode)
- return null;
-
- if (type == ILogRenderer.LOG_ERROR)
- System.err.println(msg);
- else
- System.out.println(msg);
- return ILogRenderer.CONSOLE_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer#setTraceMode(boolean)
- */
- public void setTraceMode(boolean flag) {
-
- if (fSettingTrace)
- return;
- fSettingTrace = true;
- fTraceMode = flag;
- fMyLogger.setTraceMode(flag);
- fSettingTrace = false;
- }
-
- /**
- * Log the string at the given level.
- *
- * @param msg
- * @param level
- * @return <code>CONSOLE_DESCRIPTION</code>
- *
- * @since 1.1.0
- */
- protected String log(String msg, Level level) {
- if (level == Level.SEVERE)
- System.err.println(msg);
- else
- System.out.println(msg);
- return ILogRenderer.CONSOLE_DESCRIPTION;
- }
-
- /**
- * Answer if logging at the given level
- *
- * @param logLevel
- * @return <code>true</code> if logging at the given level.
- *
- * @since 1.1.0
- */
- protected boolean isLogging(Level logLevel) {
- return fTraceMode || fMyLogger.isLoggingLevel(logLevel);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(boolean, java.util.logging.Level)
- */
- public String log(boolean b, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(b), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(byte, java.util.logging.Level)
- */
- public String log(byte b, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(b), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(char, java.util.logging.Level)
- */
- public String log(char c, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(c), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(double, java.util.logging.Level)
- */
- public String log(double d, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(d), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(float, java.util.logging.Level)
- */
- public String log(float f, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(f), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(int, java.util.logging.Level)
- */
- public String log(int i, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(i), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(long, java.util.logging.Level)
- */
- public String log(long l, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(l), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(java.lang.Object, java.util.logging.Level)
- */
- public String log(Object o, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(o), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(short, java.util.logging.Level)
- */
- public String log(short s, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(String.valueOf(s), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(java.lang.Throwable, java.util.logging.Level)
- */
- public String log(Throwable t, Level level) {
- if (level == DEFAULT)
- level = Level.SEVERE;
- if (isLogging(level))
- return log(fMyLogger.getGenericMsg(fMyLogger.exceptionToString(t), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/Logger.java b/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/Logger.java
deleted file mode 100644
index 45b394e..0000000
--- a/plugins/org.eclipse.jem.util/jemutil-nonworkbnech/org/eclipse/jem/util/logger/proxy/Logger.java
+++ /dev/null
@@ -1,836 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: Logger.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxy;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.*;
-import java.util.logging.Level;
-
-/**
- * This is a base, UI independent logger. It will
- * construct a consistent msg. body, and call an enfironment specific ILogRenderer.
- * By default, this logger will use a console based ILogRenderer,
- * and a J2EE Plugin identification.
- *
- * <p>
- * When running outside of Eclipse, the trace and logging level come from the system properties
- * <ul>
- * <li>"debug" (="true") - The default is <code>false</code>.
- * <li>"logLevel" (="level" where "level" is a level string, e.g. SEVERE, WARNING, etc. from the <code>java.util.logging.Level</code> class).
- * The default is "WARNING".
- * </ul>
- *
- *
- * @since 1.0.0
- */
-public class Logger {
-
- // This is used by ILogRenderer2 to define the default level.
- static class LocalLevel extends Level {
- public LocalLevel(String name, int level) {
- super(name, level);
- }
- }
-
- private boolean fTraceMode = false; // will we actually punch trace messaged or not
- private String fPluginID;
- private ILogRenderer fRenderer = null;
- private ILogRenderer2 renderer2 = null;
- public String fLineSeperator;
- private Level level;
- private Level defaultLevel = Level.SEVERE; // By default only severe or greater are logged.
- private String logFileName;
- private final static String DefaultLoggerPlugin = ILogRenderer.DefaultPluginID;
- static private Hashtable Loggers = new Hashtable(); // Keep track of all the Loggers
- final protected static String[] LogMark = { "*** ERROR *** ", //$NON-NLS-1$
- "[Trace] ", //$NON-NLS-1$
- "+++ Warning +++ ", //$NON-NLS-1$
- "Info " }; //$NON-NLS-1$
-
- final protected static String Filler = " "; // Use this to indent msg. body //$NON-NLS-1$
-
- protected Logger() {
- this(ILogRenderer.DefaultPluginID);
- }
-
- protected Logger(String pluginID) {
- fPluginID = pluginID;
- setRenderer(new JDKConsoleRenderer(this)); // Set up default to this. Someone can change it later.
- }
-
- /**
- * Return the stacktrace as a print formatted string.
- * @param e
- * @return the stacktrace as a string.
- *
- * @since 1.0.0
- */
- public String exceptionToString(Throwable e) {
- StringWriter stringWriter = new StringWriter();
- e.printStackTrace(new PrintWriter(stringWriter));
- return stringWriter.toString();
- }
-
- /**
- * Get the system default logger. This is used for clients that don't know if they
- * are running in Eclipse or outside of it. This way they have a common logger format
- * which switch correctly.
- * @return default logger.
- *
- * @since 1.0.0
- */
- static public Logger getLogger() {
- Logger defaultLogger = (Logger) Loggers.get(DefaultLoggerPlugin);
- if (defaultLogger == null) {
- defaultLogger = new Logger();
- defaultLogger.init();
- Loggers.put(DefaultLoggerPlugin, defaultLogger);
- }
- return defaultLogger;
- }
-
- /**
- * Get the logger for a specific plugin.
- * @param pluginId
- * @return logger for a specific pluggin.
- *
- * @since 1.0.0
- */
- static public Logger getLogger(String pluginId) {
- if (pluginId == null)
- return Logger.getLogger();
- Logger Logger = (Logger) Loggers.get(pluginId);
- if (Logger == null) {
- Logger = new Logger(pluginId);
- Logger.init();
- Loggers.put(pluginId, Logger);
- }
- return Logger;
- }
-
- /**
- * Used by subclass to get a logger if it exists, but not create one.
- * @param pluginId
- * @return logger.
- *
- * @since 1.0.0
- */
- static protected Logger getLoggerIfExists(String pluginId) {
- if (pluginId == null)
- return Logger.getLogger();
- else
- return (Logger) Loggers.get(pluginId);
- }
-
- /**
- * Get the plugin id for this logger.
- * @return pluginid
- *
- * @since 1.0.0
- */
- public String getPluginID() {
- return fPluginID;
- }
-
- /**
- * Get the trace mode for this logger
- * @return <code>true</code> if tracing is going on.
- *
- * @since 1.0.0
- */
- public boolean getTraceMode() {
- return fTraceMode;
- }
-
- /*
- * Indent the Msg. Body to make it easier to read the log
- */
- private void indentMsg(String msg, StringBuffer logMsg) {
- // Line seperator is different on different platform, unix = \n, windows \r\n and mac \r
- String sep = fLineSeperator;
- if (msg.indexOf("\r\n") != -1) //$NON-NLS-1$
- sep = "\r\n"; //$NON-NLS-1$
- else if (msg.indexOf("\n") != -1) //$NON-NLS-1$
- sep = "\n"; //$NON-NLS-1$
- else if (msg.indexOf("\r") != -1) //$NON-NLS-1$
- sep = "\r"; //$NON-NLS-1$
- StringTokenizer tokenizer = new StringTokenizer(msg, sep);
- boolean first = true;
- while (tokenizer.hasMoreTokens()) {
- if (first) {
- first = false;
- logMsg.append(Filler + tokenizer.nextToken());
- } else
- logMsg.append(fLineSeperator + Filler + tokenizer.nextToken());
- }
- }
- /*
- * If Eclipse is started with the -XDebug or -debug turn traces on for this Logger
- * Creation date: (8/23/2001 7:37:04 PM)
- */
- private void init() {
- if (System.getProperty("debug") != null) //$NON-NLS-1$
- fTraceMode = true;
- level = defaultLevel = Level.parse(System.getProperty("logLevel", Level.WARNING.getName()));
-
- try {
- fLineSeperator = System.getProperty("line.separator"); // Diff on Win/Unix/Mac //$NON-NLS-1$
- } catch (Throwable e) {
- fLineSeperator = "\n"; //$NON-NLS-1$
- }
- }
- /*
- * Generic log.
- * Creation date: (8/24/2001 1:55:34 PM)
- * @return java.lang.String
- * @param msg java.lang.String
- * @param type int
- */
- private String logAny(String msg, int type) {
- StringBuffer logMsg = new StringBuffer();
- logMsg.append(fLineSeperator);
- logMsg.append(LogMark[type]);
- return punchLog(logRest(msg, logMsg), type);
- }
-
- /**
- * This is to be used by renderers that want to put a msg out
- * in a generic format. This just returns the string that
- * should be logged. It puts things like headers on it.
- *
- * @param msg
- * @param aLevel
- * @return The generic message for the string and level.
- *
- * @since 1.0.0
- */
- public String getGenericMsg(String msg, Level aLevel) {
- StringBuffer genMsg = new StringBuffer(msg.length()+16);
- genMsg.append(fLineSeperator);
- genMsg.append(getLevelHeader(aLevel));
- genMsg.append(": ");
- genMsg.append(new Date());
- indentMsg(msg, genMsg);
- return genMsg.toString();
- }
-
- private static final Level[] LEVEL_SEARCH = new Level[] {
- Level.SEVERE,
- Level.WARNING,
- Level.INFO,
- ILogRenderer2.TRACE
- };
-
- private static final String[] LEVEL_MARK = new String[] {
- "*** ERROR ***",
- "+++ Warning +++",
- "Info",
- "[Trace]"
- };
-
- private String getLevelHeader(Level aLevel) {
- for (int i=0; i<LEVEL_SEARCH.length; i++)
- if (LEVEL_SEARCH[i] == aLevel)
- return LEVEL_MARK[i];
- return aLevel.getName(); // Not found, just use level string.
- }
-
- // The write's are here for history. Will implement using log(obj, Level) for all of the types.
-
-
- /**
- * deprecated use log(Level, Exception)
- * @param aLevel
- * @param ex
- * @return
- *
- * @since 1.0.0
- *
- */
- public String write(Level aLevel, Exception ex) {
- return log(aLevel, ex);
- }
-
- /**
- * deprecated use log(Throwable)
- * @param ex
- * @return
- *
- * @since 1.0.0
- *
- */
- public String write(Throwable ex) {
- return log(ex);
- }
-
- /**
- * deprecated use log(Object, Level)
- * @param aLevel
- * @param logEntry
- * @return
- *
- * @since 1.0.0
- */
- public String write(Level aLevel, Object logEntry) {
- return log(logEntry, aLevel);
- }
-
- /**
- * deprecated use log(String, Level)
- * @param aLevel
- * @param string
- * @return
- *
- * @since 1.0.0
- */
- public String write(Level aLevel, String string) {
- return log(string, aLevel);
- }
- /**
- * deprecated use log(Throwable, Level)
- * @param aLevel
- * @param ex
- * @return
- *
- * @since 1.0.0
- */
- public String write(Level aLevel, Throwable ex) {
- return log(ex, aLevel);
- }
- /**
- * deprecated use log(Throwable, Level)
- * @param aLevel
- * @param ex
- * @return
- *
- * @since 1.0.0
- */
- public String log(Level aLevel, Exception ex) {
- return log(ex, aLevel);
- }
- /**
- * deprecated use log(Throwable, Level)
- * @param aLevel
- * @param ex
- * @return
- *
- * @since 1.0.0
- */
- public String log(Level aLevel, Throwable ex) {
- return log(ex, aLevel);
- }
-
- /**
- * Get the logging level
- * @return logging level
- *
- * @since 1.0.0
- */
- public Level getLevel() {
- return level;
- }
-
- /**
- * Check if the requested level is being logged. (e.g. if current level is SEVERE, then FINE will not be logged).
- * @param requestlevel
- * @return <code>true</code> if the level will be logged.
- *
- * @since 1.0.0
- */
- public boolean isLoggingLevel(Level requestlevel) {
- if (requestlevel == ILogRenderer2.TRACE && !getTraceMode())
- return false; // We aren't tracing but requested trace.
-
- return !(requestlevel.intValue() < getLevel().intValue() || getLevel() == Level.OFF);
- }
-
- /**
- * Log an error string.
- * @param msg
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logError(String msg) {
- return log(msg, Level.SEVERE);
- }
-
- /**
- * Log an error throwable
- * @param e
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logError(Throwable e) {
- return log(e, Level.SEVERE);
- }
-
- /**
- * Log an info message.
- * @param msg
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logInfo(String msg) {
- return log(msg, Level.INFO);
- }
-
-/**
- * Log a throwable as a warning.
- * @param e
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logInfo(Throwable e) {
- return log(e, Level.INFO);
- }
-
- /**
- * Append the string to logMsg buffer passed in. Append the date and format the
- * string with nice indentation.
- *
- * @param msg
- * @param logMsg
- * @return the string from the logMsg after logging the rest.
- *
- * @since 1.0.0
- */
- protected String logRest(String msg, StringBuffer logMsg) {
- logMsg.append(new Date());
- indentMsg(msg, logMsg);
- return logMsg.toString();
- }
-
- /**
- * Log the msg as trace only.
- * @param msg
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logTrace(String msg) {
- if (fTraceMode)
- return log(msg, ILogRenderer2.TRACE);
- else
- return ILogRenderer.NOLOG_DESCRIPTION;
- }
-
- /**
- * Log the throwable as trace only.
- * @param e
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logTrace(Throwable e) {
- return log(e, ILogRenderer2.TRACE);
- }
-
- /**
- * Log the message as warning.
- * @param msg
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logWarning(String msg) {
- return log(msg, Level.WARNING);
- }
- /**
- * Log the throwable as a warning.
- * @param e
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String logWarning(Throwable e) {
- return log(e, Level.WARNING);
- }
-
- /**
- * Ask the Renderer to punch the msg. in the log.. one
- * caller at the time
- * Creation date: (8/24/2001 9:19:17 AM)
- * @return java.lang.String
- * @param msg java.lang.String
- * @param type int
- */
- protected synchronized String punchLog(String msg, int type) {
- return fRenderer.log(msg, type);
- }
-
- /**
- * Set the renderer to use.
- * @param renderer
- *
- * @since 1.0.0
- */
- public void setRenderer(ILogRenderer renderer) {
- fRenderer = renderer;
- renderer2 = (renderer instanceof ILogRenderer2) ? (ILogRenderer2) renderer : null;
- renderer.setTraceMode(getTraceMode());
- }
-
- /**
- * Set the trace mode.
- * @param flag <code>true</code> to turn on tracing.
- *
- * @since 1.0.0
- */
- public void setTraceMode(boolean flag) {
- fTraceMode = flag;
- if (fRenderer != null)
- fRenderer.setTraceMode(flag);
- }
-
- /**
- * Set the level cutoff for logging. Anything below this level will not log.
- * Do not set level to <code>ILogRenderer2.TRACE</code>. It doesn't make sense.
- *
- * @param level (Use <code>ILogRenderer2.DEFAULT</code> to restore to default for this logger.
- *
- * @since 1.0.0
- */
- public void setLevel(Level level) {
- this.level = level != ILogRenderer2.DEFAULT ? level : defaultLevel;
- }
-
- /**
- * Set the default level for this logger. It won't touch the current level.
- *
- * @param level
- *
- * @since 1.0.0
- */
- public void setDefaultLevel(Level level) {
- this.defaultLevel = level;
- }
-
- /**
- * Get the log file name.
- * @return Returns the logFileName.
- */
- public String getLogFileName() {
- return logFileName;
- }
-
- /**
- * Set the log file name.
- * @param logFileName The logFileName to set.
- */
- public void setLogFileName(String logFileName) {
- this.logFileName = logFileName;
- }
-
- // Now all of the log() types that use a Level.
-
- /**
- * Log the throwable at the default level for a throwable.
- * @param e
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(Throwable e) {
- return log(e, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the throwable at the given level.
- * @param e
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(Throwable e, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(e, logLevel);
- } else {
- // Do it the old way.
- String stackTrace = exceptionToString(e);
- return logAny(stackTrace, getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.SEVERE));
- }
- }
-
- public String log(Object o) {
- return log(o, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the object at the given level.
- * @param o
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(Object o, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(o, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(o), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- // The following are added to match up with Hyades so that primitives can be logged too.
-
- /**
- * Log a boolean at the default level.
- * @param b
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(boolean b) {
- return log(b, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log a boolean at the given level.
- * @param b
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(boolean b, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(b, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(b), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the character at the default level.
- * @param c
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(char c) {
- return log(c, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the character at the given level.
- * @param c
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(char c, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(c, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(c), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the byte at the default level.
- * @param b
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(byte b) {
- return log(b, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the byte at the given level.
- * @param b
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(byte b, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(b, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(b), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the short at the default level.
- * @param s
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(short s) {
- return log(s, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the short at the given level.
- * @param s
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(short s, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(s, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(s), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the int at the default level.
- * @param i
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(int i) {
- return log(i, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the int at the default level.
- * @param i
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(int i, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(i, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(i), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the long at the default level.
- * @param l
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(long l) {
- return log(l, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the long at the given level.
- * @param l
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(long l, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(l, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(l), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the float at the default level.
- * @param f
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(float f) {
- return log(f, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the float at the given level.
- * @param f
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(float f, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(f, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(f), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /**
- * Log the double at the default level
- * @param d
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(double d) {
- return log(d, ILogRenderer2.DEFAULT);
- }
-
- /**
- * Log the double at the given level
- *
- * @param d
- * @param logLevel
- * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
- *
- * @since 1.0.0
- */
- public String log(double d, Level logLevel) {
- if (renderer2 != null) {
- return renderer2.log(d, logLevel);
- } else {
- // Do it the old way.
- return logAny(String.valueOf(d), getOldType(logLevel != ILogRenderer2.DEFAULT ? level : Level.FINEST));
- }
- }
-
- /*
- * Turn new type into old type. The defaultLevel is the
- * level to use if the incoming level is marked as default.
- */
- private int getOldType(Level aLevel) {
- if (aLevel == Level.SEVERE)
- return ILogRenderer.LOG_ERROR;
- else if (aLevel == Level.WARNING)
- return ILogRenderer.LOG_WARNING;
- else if (aLevel == Level.INFO)
- return ILogRenderer.LOG_INFO;
- else if (aLevel == ILogRenderer2.TRACE)
- return ILogRenderer.LOG_TRACE;
- else
- return ILogRenderer.LOG_INFO;
- }
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java
deleted file mode 100644
index 92bafc9..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: EMFWorkbenchContextFactory.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench;
-
-import java.util.*;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import org.eclipse.jem.internal.util.emf.workbench.nls.EMFWorkbenchResourceHandler;
-import org.eclipse.jem.util.RegistryReader;
-import org.eclipse.jem.util.emf.workbench.*;
-import org.eclipse.jem.util.emf.workbench.nature.EMFNature;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-
-public class EMFWorkbenchContextFactory {
- public static final EMFWorkbenchContextFactory INSTANCE;
-
- static {
- INSTANCE = createFactoryInstance();
- }
- private final Class CONTRIBUTOR_CLASS = IEMFContextContributor.class;
- protected Map emfContextCache = new WeakHashMap();
-
-
- private static EMFWorkbenchContextFactory createFactoryInstance() {
- EMFWorkbenchContextFactory factory = createFactoryInstanceFromExtension();
- if (factory == null)
- factory = new EMFWorkbenchContextFactory();
- return factory;
- }
-
- private static EMFWorkbenchContextFactory createFactoryInstanceFromExtension() {
- final EMFWorkbenchContextFactory[] factoryHolder = new EMFWorkbenchContextFactory[1];
- RegistryReader reader = new RegistryReader(JEMUtilPlugin.ID, "internalWorkbenchContextFactory") { //$NON-NLS-1$
- public boolean readElement(IConfigurationElement element) {
- if (element.getName().equals("factoryClass")) //$NON-NLS-1$
- try {
- factoryHolder[0] = (EMFWorkbenchContextFactory)element.createExecutableExtension("name"); //$NON-NLS-1$
- return true;
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- return false;
- }
- };
- reader.readRegistry();
- return factoryHolder[0];
- }
-
- /**
- * Constructor for EMFNatureFactory.
- */
- protected EMFWorkbenchContextFactory() {
- super();
-
- }
-
-
- protected void cacheEMFContext(IProject aProject, EMFWorkbenchContextBase emfContext) {
- if (aProject != null && emfContext != null)
- emfContextCache.put(aProject, emfContext);
- }
-
- protected EMFWorkbenchContextBase getCachedEMFContext(IProject aProject) {
- if (aProject != null)
- return (EMFWorkbenchContextBase) emfContextCache.get(aProject);
- return null;
- }
-
- /**
- * <code>aProject</code> is either being closed or deleted so we need to cleanup our cache.
- */
- public void removeCachedProject(IProject aProject) {
- if (aProject != null)
- emfContextCache.remove(aProject);
-
- }
- /**
- * Return a new or existing EMFNature on <code>aProject</code>. Allow the <code>contributor</code>
- * to contribute to the new or existing nature prior to returning.
- */
- public EMFWorkbenchContextBase createEMFContext(IProject aProject, IEMFContextContributor contributor) {
- if (aProject == null)
- throw new IllegalStateException("[EMFWorkbenchContextBase]" + EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextFactory_UI_0")); //$NON-NLS-1$ //$NON-NLS-2$
- if (!aProject.isAccessible())
- throw new IllegalStateException("[EMFWorkbenchContextBase]" + EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextFactory_UI_1", new Object[]{aProject.getName()})); //$NON-NLS-1$ //$NON-NLS-2$
- EMFWorkbenchContextBase context = getCachedEMFContext(aProject);
- if (context == null) {
- context = primCreateEMFContext(aProject);
- cacheEMFContext(aProject, context);
- if (contributor == null)
- initializeEMFContextFromContributors(aProject, context);
- }
- if (contributor != null && context != null)
- contributor.primaryContributeToContext(context);
- return context;
- }
-
- protected void initializeEMFContextFromContributors(IProject aProject, EMFWorkbenchContextBase emfContext) {
- if (aProject == null || emfContext == null)
- return;
- List runtimes = EMFNature.getRegisteredRuntimes(aProject);
- for (int i = 0; i < runtimes.size(); i++) {
- IProjectNature nature = (IProjectNature) runtimes.get(i);
- if (nature != null && CONTRIBUTOR_CLASS.isInstance(nature))
- ((IEMFContextContributor) nature).primaryContributeToContext(emfContext);
- }
- }
-
- protected boolean isNatureEnabled(IProject aProject, String natureId) {
- try {
- return aProject.isNatureEnabled(natureId);
- } catch (CoreException e) {
- return false;
- }
- }
-
- protected String[] getNatureIds(IProject aProject) {
- try {
- if (aProject.isAccessible())
- return aProject.getDescription().getNatureIds();
- } catch (CoreException e) {
- }
- return null;
- }
-
- protected IProjectNature getNature(IProject aProject, String natureId) {
- try {
- return aProject.getNature(natureId);
- } catch (CoreException e) {
- return null;
- }
- }
-
- protected EMFWorkbenchContextBase primCreateEMFContext(IProject aProject) {
- return new EMFWorkbenchContextBase(aProject);
- }
- /**
- * Return an existing EMFNature on <code>aProject</code>.
- */
- public EMFWorkbenchContextBase getEMFContext(IProject aProject) {
- return getCachedEMFContext(aProject);
- }
-
- public ResourceSetWorkbenchSynchronizer createSynchronizer(ResourceSet aResourceSet, IProject aProject) {
- return new ResourceSetWorkbenchSynchronizer(aResourceSet, aProject);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl.java
deleted file mode 100644
index 20021eb..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ProjectResourceSetImpl.java,v $$
- * $$Revision: 1.6 $$ $$Date: 2005/02/04 23:12:28 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench;
-
-import java.io.IOException;
-import java.util.*;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-import org.eclipse.jem.util.emf.workbench.*;
-import org.eclipse.jem.util.emf.workbench.nature.EMFNature;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-public class ProjectResourceSetImpl extends ResourceSetImpl implements ProjectResourceSet {
- private boolean isReleasing = false;
- private IProject project;
- protected List resourceHandlers = new ArrayList();
- protected ResourceSetWorkbenchSynchronizer synchronizer;
- protected ProjectResourceSetImpl() {
- setURIResourceMap(new HashMap(10)); // Tell it to cache uri->resource access.
- getLoadOptions().put(XMLResource.OPTION_USE_PARSER_POOL, EMFNature.SHARED_PARSER_POOL);
- }
- public ProjectResourceSetImpl(IProject aProject) {
- this();
- setProject(aProject);
- initializeSharedCacheListener();
- }
- protected void initializeSharedCacheListener() {
- JEMUtilPlugin.getSharedCache().beginListening(this);
- }
- protected boolean isReleasing() {
- return isReleasing;
- }
- /**
- * @see org.eclipse.emf.ecore.resource.impl.ResourceSetImpl#delegatedGetResource(URI, boolean)
- */
- protected Resource delegatedGetResource(URI uri, boolean loadOnDemand) {
- Resource res = super.delegatedGetResource(uri, loadOnDemand);
- if (res == null)
- res = getResourceFromHandlers(uri);
- return res;
- }
- public Resource createResource(URI uri) {
- if (isReleasing) return null;
- //Check the map first when creating the resource and do not
- //normalize if a value is found.
- boolean isMapped = !(((URIConverterImpl.URIMap)getURIConverter().getURIMap()).getURI(uri).equals(uri));
- URI converted = uri;
- if (!isMapped)
- converted = getURIConverter().normalize(uri);
- Resource result = createResourceFromHandlers(converted);
- if (result == null)
- result = super.createResource(converted);
-
- return result;
- }
- /**
- * @see org.eclipse.emf.ecore.resource.impl.ResourceSetImpl#demandLoad(Resource)
- */
- protected void demandLoad(Resource resource) throws IOException {
- if (!isReleasing)
- super.demandLoad(resource);
- }
-
- /**
- * See if any resource handlers from the WorkbenchContext
- * decide to create the Resource in another manner.
- */
- protected Resource createResourceFromHandlers(URI uri) {
- Resource resource = null;
- ResourceHandler handler = null;
- for (int i = 0; i < resourceHandlers.size(); i++) {
- handler = (ResourceHandler) resourceHandlers.get(i);
- resource = handler.createResource(this, uri);
- if (resource != null)
- return resource;
- }
- return null;
- }
- /**
- * See if any resource handlers from the WorkbenchContext
- * can return a Resource from a <code>uri</code>.
- */
- protected Resource getResourceFromHandlers(URI uri) {
- if (isReleasing) return null;
- for (int i = 0; i < resourceHandlers.size(); i++) {
- Resource resource = ((ResourceHandler) resourceHandlers.get(i)).getResource(this, uri);
- if (resource != null)
- return resource;
- }
- return null;
- }
-
- public void release() {
- // Send out notification of release.
- if (eNotificationRequired()) {
- eNotify(new NotificationImpl(SPECIAL_NOTIFICATION_TYPE, null, null, Notification.NO_INDEX, false) {
- /* (non-Javadoc)
- * @see org.eclipse.emf.common.notify.impl.NotificationImpl#getFeatureID(java.lang.Class)
- */
- public int getFeatureID(Class expectedClass) {
- return PROJECTRESOURCESET_ABOUT_TO_RELEASE_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.common.notify.impl.NotificationImpl#getNotifier()
- */
- public Object getNotifier() {
- return ProjectResourceSetImpl.this;
- }
- });
- }
- setIsReleasing(true);
- if (synchronizer != null)
- synchronizer.dispose();
- synchronizer = null;
- removeAndUnloadAllResources();
- resourceHandlers = null;
- eAdapters().clear();
- setProject(null);
- JEMUtilPlugin.getSharedCache().stopListening(this);
- }
- protected void removeAndUnloadAllResources() {
- boolean caughtException = false;
- if (getResources().isEmpty()) return;
- List list = new ArrayList(getResources());
- getResources().clear();
- Resource res;
- int size = list.size();
- for (int i = 0; i < size; i++) {
- res = (Resource) list.get(i);
- try {
- res.unload();
- } catch (RuntimeException ex) {
- Logger.getLogger().logError(ex);
- caughtException = true;
- }
- }
- if (caughtException)
- throw new RuntimeException("Exception(s) unloading resources - check log files"); //$NON-NLS-1$
- }
- protected void setIsReleasing(boolean aBoolean) {
- isReleasing = aBoolean;
- }
- /**
- * Gets the project.
- * @return Returns a IProject
- */
- public IProject getProject() {
- return project;
- }
- /**
- * Sets the project.
- * @param project The project to set
- */
- protected void setProject(IProject project) {
- this.project = project;
- }
- /*
- * Javadoc copied from interface.
- */
- public EObject getEObject(URI uri, boolean loadOnDemand) {
- if (isReleasing) return null;
- Resource resource = getResource(uri.trimFragment(), loadOnDemand);
- EObject result = null;
- if (resource != null && resource.isLoaded())
- result = resource.getEObject(uri.fragment());
- if (result == null)
- result = getEObjectFromHandlers(uri, loadOnDemand);
- return result;
- }
- /**
- * See if any resource handlers from the WorkbenchContext
- * can return a EObject from a <code>uri</code> after
- * failing to find it using the normal mechanisms.
- */
- protected EObject getEObjectFromHandlers(URI uri, boolean loadOnDemand) {
- EObject obj = null;
- ResourceHandler handler = null;
- for (int i = 0; i < resourceHandlers.size(); i++) {
- handler = (ResourceHandler) resourceHandlers.get(i);
- obj = handler.getEObjectFailed(this, uri, loadOnDemand);
- if (obj != null)
- return obj;
- }
- return null;
- }
-
- public boolean add(ResourceHandler resourceHandler) {
- return resourceHandlers.add(resourceHandler);
- }
- public void addFirst(ResourceHandler resourceHandler) {
- resourceHandlers.add(0, resourceHandler);
- }
- public boolean remove(ResourceHandler resourceHandler) {
- return resourceHandlers.remove(resourceHandler);
- }
- /**
- * Returns the synchronizer.
- * @return ResourceSetWorkbenchSynchronizer
- */
- public ResourceSetWorkbenchSynchronizer getSynchronizer() {
- return synchronizer;
- }
- /**
- * Sets the synchronizer.
- * @param synchronizer The synchronizer to set
- */
- public void setSynchronizer(ResourceSetWorkbenchSynchronizer synchronizer) {
- this.synchronizer = synchronizer;
- }
- /**
- * @see org.eclipse.emf.ecore.resource.ResourceSet#setResourceFactoryRegistry(Registry)
- */
- public void setResourceFactoryRegistry(Resource.Factory.Registry factoryReg) {
- if (resourceFactoryRegistry != null && factoryReg != null) {
- preserveEntries(factoryReg.getExtensionToFactoryMap(), resourceFactoryRegistry.getExtensionToFactoryMap());
- preserveEntries(factoryReg.getProtocolToFactoryMap(), resourceFactoryRegistry.getProtocolToFactoryMap());
- }
- super.setResourceFactoryRegistry(factoryReg);
- }
- /*
- * Preserve the entries from map2 in map1 if no collision.
- */
- protected void preserveEntries(Map map1, Map map2) {
- if (map2.isEmpty())
- return;
- Iterator it = map2.entrySet().iterator();
- Map.Entry entry;
- while (it.hasNext()) {
- entry = (Map.Entry) it.next();
- if (!map1.containsKey(entry.getKey()))
- map1.put(entry.getKey(), entry.getValue());
- }
- }
- /*
- * Javadoc copied from interface.
- */
- public Resource getResource(URI uri, boolean loadOnDemand) {
- if (isReleasing) return null;
- return super.getResource(uri, loadOnDemand);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.util.emf.workbench.ProjectResourceSet#resetNormalizedURICache()
- */
- public void resetNormalizedURICache() {
- if (getURIResourceMap() != null)
- getURIResourceMap().clear();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceHandler.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceHandler.java
deleted file mode 100644
index d240b62..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceHandler.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkspaceResourceHandler.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-
-import org.eclipse.jem.util.emf.workbench.ResourceHandler;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-/**
- * The main purpose of this class is to redirect, if necessary, to another
- * ResourceSet. This class should be used in conjunction with the WorkbenchURIConverter
- * so that the URIs passed will use the platform protocol. Anything else will be considered
- * to be ambiguous and we will not be able to redirect.
- */
-public class WorkspaceResourceHandler implements ResourceHandler {
- /**
- * Constructor for WorkspaceResourceHandler.
- */
- public WorkspaceResourceHandler() {
- super();
- }
- /*
- * @see IResourceHandler#getResource(ResourceSet, URI)
- */
- public Resource getResource(ResourceSet originatingResourceSet, URI uri) {
- if (WorkbenchResourceHelperBase.isPlatformResourceURI(uri))
- return getResourceForPlatformProtocol(originatingResourceSet, uri);
- URI mappedURI = ((URIConverterImpl.URIMap)originatingResourceSet.getURIConverter().getURIMap()).getURI(uri);
- if (isGlobalPluginLoad(mappedURI))
- return getResourceForPlatformPluginProtocol(originatingResourceSet, uri);
- return null;
- }
- /**
- * Redirect to the correct project based on the project name in the <code>uri</code>.
- * The <code>uri</code> will be in the following format: platform:/resource/[project name].
- */
- protected Resource createResourceForPlatformProtocol(ResourceSet originatingResourceSet, URI uri) {
- String projectName = uri.segment(1);
- IProject project = getProject(projectName);
- if (project != null && project.isAccessible()) {
- ResourceSet set = WorkbenchResourceHelperBase.getResourceSet(project);
- if (originatingResourceSet != set)
- return createResource(uri, set);
- }
- return null;
- }
- /**
- * Redirect to the correct project based on the project name in the <code>uri</code>.
- * The <code>uri</code> will be in the following format: platform:/resource/[project name].
- */
- protected Resource createResourceForPlatformPluginProtocol(ResourceSet originatingResourceSet, URI uri) {
-
- ResourceSet set = JEMUtilPlugin.getPluginResourceSet();
- return createResource(uri, set);
- }
- protected Resource createResource(URI uri, ResourceSet redirectedResourceSet) {
- return redirectedResourceSet.createResource(uri);
- }
- /**
- * Redirect to the correct project based on the first segment in the file name.
- * This is for compatability purposes for people using the platform:/resource protocol.
- */
- protected Resource getResourceForPlatformProtocol(ResourceSet originatingResourceSet, URI uri) {
- String projectName = uri.segment(1);
- IProject project = getProject(projectName);
- if (project != null && project.isAccessible()) {
- ResourceSet set = WorkbenchResourceHelperBase.getResourceSet(project);
- if (originatingResourceSet != set)
- return getResource(uri, set);
- }
- return null;
- }
- /**
- * Redirect to the correct project based on the first segment in the file name.
- * This is for compatability purposes for people using the platform:/resource protocol.
- */
- protected Resource getResourceForPlatformPluginProtocol(ResourceSet originatingResourceSet, URI uri) {
-
- ResourceSet set = JEMUtilPlugin.getPluginResourceSet();
- return getResource(uri, set);
-
- }
- protected Resource getResource(URI uri, ResourceSet redirectedResourceSet) {
- return redirectedResourceSet.getResource(uri, false);
- }
-
- protected IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
- protected IProject getProject(String projectName) {
- IWorkspace ws = getWorkspace();
- if (ws == null)
- return null;
- return ws.getRoot().getProject(projectName);
- }
- protected IProject getProject(ResourceSet resourceSet) {
- return WorkbenchResourceHelperBase.getProject(resourceSet);
- }
- /**
- * @see org.eclipse.jem.util.ResourceHandler#createResource(ResourceSet, URI)
- */
- public Resource createResource(ResourceSet originatingResourceSet, URI uri) {
- if (WorkbenchResourceHelperBase.isPlatformResourceURI(uri))
- return createResourceForPlatformProtocol(originatingResourceSet, uri);
- URI mappedURI = ((URIConverterImpl.URIMap)originatingResourceSet.getURIConverter().getURIMap()).getURI(uri);
- if (isGlobalPluginLoad(mappedURI))
- return createResourceForPlatformPluginProtocol(originatingResourceSet, uri);
- return null;
- }
- /**
- * @see org.eclipse.jem.util.ResourceHandler#getEObjectFailed(ResourceSet, URI, boolean)
- * Subclasses may override.
- */
- public EObject getEObjectFailed(ResourceSet originatingResourceSet, URI uri, boolean loadOnDemand) {
- return null;
- }
-
- protected boolean isGlobalPluginLoad(URI aURI) {
- if (WorkbenchResourceHelperBase.isPlatformPluginResourceURI(aURI)) {
- String[] globalPlugins = JEMUtilPlugin.getGlobalLoadingPluginNames();
- for (int i=0;i<globalPlugins.length;i++) {
- if (aURI.segment(1).startsWith(globalPlugins[i]))
- return true;
- }
- }
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceNotifier.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceNotifier.java
deleted file mode 100644
index fc8785e..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/WorkspaceResourceNotifier.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkspaceResourceNotifier.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.notify.impl.NotifierImpl;
-
-import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
-
-/**
- * This class is used to capture all ADD and REMOVE notifications from each ProjectResourceSet
- * and forward it on to any interrested listeners. This is to allow you to listen to one object
- * to gain all ADD and REMOVE notifications for each ResourceSet within the system.
- */
-public class WorkspaceResourceNotifier extends NotifierImpl {
- protected Adapter projectAdapter = new WorkspaceResourceCacheAdapter();
-
- class WorkspaceResourceCacheAdapter extends AdapterImpl {
- /**
- * Forward ADD and REMOVE notification.
- */
- public void notifyChanged(Notification msg) {
- switch (msg.getEventType()) {
- case Notification.ADD :
- case Notification.ADD_MANY :
- case Notification.REMOVE :
- case Notification.REMOVE_MANY :
- eNotify(msg);
- break;
- }
- }
- }
-
- /**
- * Constructor for WorkspaceResourceCache.
- */
- public WorkspaceResourceNotifier() {
- super();
- }
-
- /**
- * Begin listening to a ProjectResourceSet.
- */
- public void beginListening(ProjectResourceSet aResourceSet) {
- if (aResourceSet != null) {
- if (aResourceSet.eAdapters() == null ||
- !aResourceSet.eAdapters().contains(projectAdapter))
- aResourceSet.eAdapters().add(projectAdapter);
- }
- }
- /**
- * Stop listening to a ProjectResourceSet.
- */
- public void stopListening(ProjectResourceSet aResourceSet) {
- if (aResourceSet != null)
- aResourceSet.eAdapters().remove(projectAdapter);
- }
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nature/EMFNatureRegistry.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nature/EMFNatureRegistry.java
deleted file mode 100644
index f29d2f8..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nature/EMFNatureRegistry.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: EMFNatureRegistry.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench.nature;
-
-import java.util.HashSet;
-import java.util.Set;
-
-
-import org.eclipse.core.runtime.*;
-
-import org.eclipse.jem.internal.util.emf.workbench.nls.EMFWorkbenchResourceHandler;
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-public class EMFNatureRegistry {
-
- private static final String NATURE_REGISTRATION_POINT = "org.eclipse.jem.util.nature_registration"; //$NON-NLS-1$
- private static final String NATURE = "nature"; //$NON-NLS-1$
- private static final String STATIC_ID = "id"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- private EMFNatureRegistry() {
- super();
- readRegistry();
- }
-
- private static EMFNatureRegistry singleton;
-
- public final Set REGISTERED_NATURE_IDS = new HashSet();
-
- public static EMFNatureRegistry singleton() {
- if (singleton == null)
- singleton = new EMFNatureRegistry();
- return singleton;
- }
-
- protected void readRegistry() {
- // register Nature IDs for the J2EENatures
- IExtensionRegistry r = Platform.getExtensionRegistry();
- IConfigurationElement[] ce = r.getConfigurationElementsFor(NATURE_REGISTRATION_POINT);
- String natureId;
- for (int i=0; i<ce.length; i++) {
- if (ce[i].getName().equals(NATURE)) {
- natureId = ce[i].getAttribute(STATIC_ID);
- if (natureId != null)
- registerNatureID(natureId);
- }
- }
- }
-
- /**
- * @param natureId
- */
- private void registerNatureID(String natureId) {
- if (!REGISTERED_NATURE_IDS.contains(natureId))
- REGISTERED_NATURE_IDS.add(natureId);
- else
- Logger.getLogger().logError(EMFWorkbenchResourceHandler.getString("EMFNatureRegistry_ERROR_0", new Object[] {natureId})); //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nls/EMFWorkbenchResourceHandler.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nls/EMFWorkbenchResourceHandler.java
deleted file mode 100644
index 63ef3fe..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/nls/EMFWorkbenchResourceHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: EMFWorkbenchResourceHandler.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.internal.util.emf.workbench.nls;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class EMFWorkbenchResourceHandler {
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("emfworkbench");//$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String, String) will return the key
- // it was called with
- }
- return null;
- }
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle= getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- } else {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-public static String getString(String key, Object[] args) {
-
- try {return MessageFormat.format(getString(key), args);}
- catch (IllegalArgumentException e) {return getString(key);}
-
-}
-public static String getString(String key, Object[] args, int x) {
-
- return getString(key);
- }
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/NotPresentPerformanceMonitor.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/NotPresentPerformanceMonitor.java
deleted file mode 100644
index 8c5bab0..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/NotPresentPerformanceMonitor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.jem.util;
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: NotPresentPerformanceMonitor.java,v $$
- * $$Revision: 1.2 $$ $$Date: 2005/01/12 16:57:32 $$
- */
-/**
- * This is the instantiation to use if the performance monitor plugin is not installed. It basically does nothing.
- *
- * <p>
- * This class is not intended to be instantiated by clients.
- * </p>
- *
- * @since 1.0.0
- */
-public class NotPresentPerformanceMonitor extends PerformanceMonitorUtil {
-
- /*
- * Only instantiated from this package.
- */
- NotPresentPerformanceMonitor() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#setVar(java.lang.String)
- */
- public void setVar(String var) {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#doSnapshot(int, int)
- */
- protected void doSnapshot(int step, int types) {
- }
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#doSnapshot(int)
- */
- protected void doSnapshot(int step) {
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PerformanceMonitorUtil.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PerformanceMonitorUtil.java
deleted file mode 100644
index e58a1a4..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PerformanceMonitorUtil.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: PerformanceMonitorUtil.java,v $
- * $Revision: 1.3 $ $Date: 2005/02/02 20:51:09 $
- */
-package org.eclipse.jem.util;
-import java.util.EventObject;
-
-import org.eclipse.perfmsr.core.IPerformanceMonitor;
-
-/**
- * This is a simplified wrapper to the IPerformanceMonitor that hides it so that the actual plugin can be optional and not required.
- *
- * <p>
- * This class is not meant to be subclassed by clients.
- * </p>
- *
- * @since 1.0.0
- */
-public abstract class PerformanceMonitorUtil {
- /**
- * Event for PerformanceListener notification.
- *
- * @since 1.1.0
- */
- public static class PerformanceEvent extends EventObject {
-
- PerformanceEvent(Object source, int step) {
- super(source);
- snapshowWithTypes = false;
- this.step = step;
- this.types = 0; // Not set.
- }
-
- PerformanceEvent(Object source, int step, int types) {
- super(source);
- snapshowWithTypes = true;
- this.step = step;
- this.types = types;
- }
-
-
- /**
- * Snapshot with types if <code>true</code>.
- * @since 1.1.0
- */
- public final boolean snapshowWithTypes;
-
- /**
- * Step of snapshot
- * @since 1.1.0
- */
- public final int step;
-
- /**
- * types of snapshot.
- * @since 1.1.0
- */
- public final int types;
- }
-
- /**
- * Performance Listener interface
- *
- * @since 1.1.0
- */
- public interface PerformanceListener {
- /**
- * Snapshot was called.
- * @param event
- *
- * @since 1.1.0
- */
- public void snapshot(PerformanceEvent event);
- }
-
- private PerformanceListener[] listeners;
-
- public interface Types {
-
- /**
- * 1 - Write out the performance counters from the operating system. These include working set, peak working set, elapsed time, user time, and
- * kernel time.
- */
- int OperatingSystemCounters = IPerformanceMonitor.Types.OperatingSystemCounters;
-
- /**
- * 2 - Write out the global performance info. This includes things like the total committed memory for the entire system.
- *
- * This function depends on the GetPerformanceInfo() function being available in the Windows psapi.dll. This is available in XP but is usually
- * not available in Win/2000. If it is not available then this function throws an UnsupportedOperationException.
- */
- int GlobalSystemCounters = IPerformanceMonitor.Types.GlobalSystemCounters;
-
- /**
- * 4 - Write out the size of the Java Heap.
- */
- int JavaHeapSize = IPerformanceMonitor.Types.JavaHeapSize;
-
- /**
- * 8 - Write out how much of the Java heap is being used. This calls the garbage collector so it may skew timing results.
- */
- int JavaHeapUsed = IPerformanceMonitor.Types.JavaHeapUsed;
-
- /**
- * 16 - The plugin startup and size information.
- */
- int PluginInfo = IPerformanceMonitor.Types.PluginInfo;
-
- /** 0xffff - Everything. */
- int All = IPerformanceMonitor.Types.All;
- }
-
- private static PerformanceMonitorUtil sharedMonitor;
-
- public static PerformanceMonitorUtil getMonitor() {
- if (sharedMonitor == null) {
- try {
- Class.forName("org.eclipse.perfmsr.core.PerfMsrCorePlugin"); // This just tests if the performance plugin is available. Throws
- // exception otherwise.
- Class presentClass = Class.forName("org.eclipse.jem.util.PresentPerformanceMonitor"); // Get the class we use wrapper it.
- sharedMonitor = (PerformanceMonitorUtil) presentClass.newInstance();
- if (!sharedMonitor.isValid())
- sharedMonitor = null;
- } catch (RuntimeException e) {
- // If any runtime exception, just use the not present one.
- } catch (ClassNotFoundException e) {
- // If class not found, then plugin not available, so just use the not present one.
- } catch (InstantiationException e) {
- // Problem instantiating, so just use the not present one.
- } catch (IllegalAccessException e) {
- // Some illegal access, so just use the not present one.
- }
- if (sharedMonitor == null) {
- // Couldn't get the performance one for some reason. Use not present one instead.
- sharedMonitor = new NotPresentPerformanceMonitor();
- }
- }
- return sharedMonitor;
- }
-
- protected boolean isValid() {
- return true;
- }
-
- /**
- * Set the variations that are in effect.
- *
- * @param var
- * a comma delimited string of variation numbers
- */
- public abstract void setVar(String var);
-
- /**
- * Take a snapshot of some default performance measurements.
- *
- * @param step
- * this identifies the step that the snapshot is for
- */
- public final void snapshot(int step) {
- doSnapshot(step);
- if (listeners != null)
- notifySnapshot(new PerformanceEvent(this, step));
- }
-
- private void notifySnapshot(PerformanceEvent event) {
- PerformanceListener[] list = listeners;
- for (int i = 0; i < list.length; i++) {
- list[i].snapshot(event);
- }
- }
-
- /**
- * Do the actual snapshot
- * @param step
- *
- * @see #snapshot(int)
- * @since 1.1.0
- */
- protected abstract void doSnapshot(int step);
-
- /**
- * Take a snapshot of the selected performance measurements.
- *
- * @param step
- * this identifies the step that the snapshot is for
- *
- * @param types
- * This controls which measurements are selected. It is an or'd together list of the IPerformanceMonitor.Types constants.
- *
- * @see IPerformanceMonitor.Types
- */
- public void snapshot(int step, int types) {
- doSnapshot(step, types);
- if (listeners != null)
- notifySnapshot(new PerformanceEvent(this, step, types));
- }
-
- /**
- * Do the actual snapshot
- * @param step
- *
- * @see #snapshot(int, int)
- * @since 1.1.0
- */
- protected abstract void doSnapshot(int step, int types);
-
- /**
- * Add listener to list.
- * @param listener
- *
- * @since 1.1.0
- */
- public void addPerformanceListener(PerformanceListener listener) {
- if (findListener(listener) != -1)
- return;
- PerformanceListener[] newList = new PerformanceListener[listeners != null ? listeners.length+1 : 1];
- if (listeners != null)
- System.arraycopy(listeners, 0, newList, 0, listeners.length);
- newList[newList.length-1] = listener;
- listeners = newList;
- }
-
- private int findListener(PerformanceListener listener) {
- if (listeners != null) {
- for (int i = 0; i < listeners.length; i++) {
- if (listeners[i] == listener)
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Remove the listener from the list.
- * @param listener
- *
- * @since 1.1.0
- */
- public void removePerformanceListener(PerformanceListener listener) {
- int index = findListener(listener);
- if (index != -1) {
- if (listeners.length == 1) {
- listeners = null;
- return;
- }
- PerformanceListener[] newList = new PerformanceListener[listeners.length-1];
- System.arraycopy(listeners, 0, newList, 0, index);
- System.arraycopy(listeners, index+1, newList, index, newList.length-index);
- listeners = newList;
- }
- }
- /**
- * Upload the results to the server. This causes the file to be
- * closed, and the monitor to be placed into the finished state.
- *
- * This method can only be called if the uploadhost, uploadport and uploaduserid
- * have been configured before hand.
- *
- * @param description an optional description (it can be null)
- *
- */
- public boolean upload(String description){return false;}
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PresentPerformanceMonitor.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PresentPerformanceMonitor.java
deleted file mode 100644
index 672977a..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/PresentPerformanceMonitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: PresentPerformanceMonitor.java,v $
- * $Revision: 1.3 $ $Date: 2005/02/02 20:51:09 $
- */
-package org.eclipse.jem.util;
-import org.eclipse.perfmsr.core.IPerformanceMonitor;
-import org.eclipse.perfmsr.core.PerfMsrCorePlugin;
-
-/**
- * This is the version used when the performance plugin is available.
- *
- * <p>
- * This class is not meant to be instantiated by clients.
- * </p>
- *
- * @since 1.0.0
- */
-public class PresentPerformanceMonitor extends PerformanceMonitorUtil {
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#upload(java.lang.String)
- */
- public boolean upload(String description) {
- return monitor.upload(description).success;
- }
-
- private IPerformanceMonitor monitor;
-
- /*
- * So that only instantiated by this package.
- */
- PresentPerformanceMonitor() {
- monitor = PerfMsrCorePlugin.getPerformanceMonitor(true);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#isValid()
- */
- protected boolean isValid() {
- return monitor != null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#setVar(java.lang.String)
- */
- public void setVar(String var) {
- monitor.setVar(var);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#doSnapshot(int)
- */
- protected void doSnapshot(int step) {
- monitor.snapshot(step);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.util.PerformanceMonitorUtil#doSnapshot(int, int)
- */
- protected void doSnapshot(int step, int types) {
- monitor.snapshot(step, types);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java
deleted file mode 100644
index 809b7aa..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: RegistryReader.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util;
-import org.eclipse.core.runtime.*;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * Class to read a registry. It is meant to be subclassed to provide specific function.
- *
- * @since 1.0.0
- */
-public abstract class RegistryReader {
-
- String pluginId;
-
- String extensionPointId;
-
- private static Bundle systemBundle;
-
- /**
- * Utility method to get the plugin id of a configuation element
- *
- * @param configurationElement
- * @return plugin id of configuration element
- * @since 1.0.0
- */
- public static String getPluginId(IConfigurationElement configurationElement) {
- String pluginId = null;
-
- if (configurationElement != null) {
- IExtension extension = configurationElement.getDeclaringExtension();
-
- if (extension != null)
- pluginId = extension.getNamespace();
- }
-
- return pluginId;
- }
-
- /**
- * Constructor for RegistryReader taking a registry, plugin id, and extension point id.
- *
- * @param registry
- * @param pluginID
- * @param extensionPoint
- *
- * @deprecated Use RegistryReader(plugin, extensionPoint) instead. The registry passed in is ignored.
- * @since 1.0.0
- */
- public RegistryReader(IPluginRegistry registry, String pluginID, String extensionPoint) {
- this(pluginID, extensionPoint);
- }
-
- /**
- * Constructor for RegistryReader taking the plugin id and extension point id.
- *
- * @param pluginID
- * @param extensionPoint
- *
- * @since 1.0.0
- */
- public RegistryReader(String pluginID, String extensionPoint) {
- super();
- this.pluginId = pluginID;
- extensionPointId = extensionPoint;
- }
-
- private void internalReadElement(IConfigurationElement element) {
- boolean recognized = this.readElement(element);
- if (!recognized) {
- logError(element, "Error processing extension: " + element); //$NON-NLS-1$
- }
- }
-
- /*
- * Logs the error in the desktop log using the provided text and the information in the configuration element.
- */
- protected void logError(IConfigurationElement element, String text) {
- IExtension extension = element.getDeclaringExtension();
- StringBuffer buf = new StringBuffer();
- buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append("\n" + text); //$NON-NLS-1$
- Logger.getLogger().logError(buf.toString());
- }
-
- /*
- * Logs a very common registry error when a required attribute is missing.
- */
- protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * Implement this method to read element attributes. If this element has subelements, the reader will recursively cycle through them and call this
- * method so don't do it here.
- */
- public abstract boolean readElement(IConfigurationElement element);
-
- /**
- * Read the extension point and parse it.
- *
- * @since 1.0.0
- */
- public void readRegistry() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pluginId, extensionPointId);
- if (point == null)
- return;
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- internalReadElement(elements[i]);
- }
- }
-
- /**
- * Tests to see if it is valid at this point in time to create an executable extension. A valid reason not to would be that the workspace is
- * shutting donw.
- *
- * @param element
- * @return <code>true</code> if it is valid point to create an executable extension.
- *
- * @since 1.0.0
- */
- public static boolean canCreateExecutableExtension(IConfigurationElement element) {
- if (Platform.isRunning() && getSystemBundle().getState() != Bundle.STOPPING)
- return true;
- return false;
- }
-
- /**
- * Get the system bundle
- *
- * @return system bundle.
- *
- * @since 1.0.0
- */
- protected static Bundle getSystemBundle() {
- if (systemBundle == null)
- systemBundle = Platform.getBundle("org.eclipse.osgi");
- return systemBundle;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/TimerTests.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/TimerTests.java
deleted file mode 100644
index 838af52..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/TimerTests.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: TimerTests.java,v $
- * $Revision: 1.2 $ $Date: 2005/02/07 18:18:47 $
- */
-package org.eclipse.jem.util;
-
-import java.text.NumberFormat;
-import java.util.*;
-
-/**
- *
- * @since 1.0.2
- */
-public class TimerTests {
-
- /**
- * Default TimerTests class to use when not using your own. It's a global.
- */
- public static TimerTests basicTest = new TimerTests();
-
- public static final String CURRENT_PARENT_ID = "current parent";
- protected String currentParentId = null;
-
-
- protected static class TimerStep {
- static final int START = 0;
- static final int STOP = 1;
- static final int START_CUMULATIVE = 2;
- static final int STOP_CUMULATIVE = 3;
- static final int START_ACCUMULATING = 4;
- static final int STOP_ACCUMULATING = 5;
- protected String id;
- protected int type;
- protected long currentTime;
- protected int threadId;
-}
-
- protected boolean testOn = false;
- protected List steps;
-
- public synchronized boolean startStep(String id) {
- if (!testOn)
- return true;
-
- TimerStep step = createTimerStep(id, TimerStep.START);
- return step != null;
- }
-
- protected TimerStep createTimerStep(String id, int stepType) {
- TimerStep newStep = new TimerStep();
- newStep.threadId = Thread.currentThread().hashCode();
- newStep.id = id;
- newStep.type = stepType;
- newStep.currentTime = System.currentTimeMillis();
- steps.add(newStep);
-
- return newStep;
- }
-
- public synchronized boolean stopStep(String id) {
- if (!testOn)
- return true;
- TimerStep step = createTimerStep(id, TimerStep.STOP);
- return step != null;
- }
-
- public synchronized boolean startAccumulating(String id) {
- if (!testOn)
- return true;
-
- return createTimerStep(id, TimerStep.START_ACCUMULATING) != null;
- }
-
- public synchronized boolean stopAccumulating(String id) {
- if (!testOn)
- return true;
-
- return createTimerStep(id, TimerStep.STOP_ACCUMULATING) != null;
- }
- public synchronized boolean startCumulativeStep(String id) {
- if (!testOn)
- return true;
-
- return createTimerStep(id, TimerStep.START_CUMULATIVE) != null;
- }
-
- public synchronized boolean stopCumulativeStep(String id) {
- if (!testOn)
- return true;
- return createTimerStep(id, TimerStep.STOP_CUMULATIVE) != null;
- }
-
- /**
- * Clear the tests so that you can restart and do some more tests.
- *
- *
- * @since 1.0.2
- */
- public synchronized void clearTests() {
- if (!testOn)
- return;
- steps.clear();
- currentParentId = null;
- }
-
- /**
- * Turn this test on. If not turned on then all calls will quickly return with no errors. This allows the code to stay in place even when not
- * debugging.
- * <p>
- * When turned off, it will clear the test.
- *
- * @param on
- *
- * @since 1.0.2
- */
- public synchronized void testState(boolean on) {
- if (on == testOn)
- return;
- if (on) {
- testOn = true;
- if (steps == null)
- steps = new ArrayList();
- } else {
- testOn = false;
- steps = null;
- }
- currentParentId = null;
- }
- private static class CumulativeInformation {
- public TimerStep currentCumulativeStep;
- public long cumTime;
- public int cumCount;
- public int cumCountNonZero;
- public long maxTime;
- public long minTime = Integer.MAX_VALUE;
- public long minTimeNonZero = Integer.MAX_VALUE;
- }
- public synchronized void printIt() {
- if (!testOn)
- return;
- if (steps == null)
- return;
- Map stepInfoByThreadId = new HashMap();
- Map indentsByThreadId = new HashMap();
- Map cumSteps;
- TimerStep prevStep = null;
- TimerStep startStep;
- NumberFormat percentFormatter = NumberFormat.getPercentInstance();
- double totalTime = 0;
- StringBuffer strb = new StringBuffer(150);
- if (steps.size() > 2){
- totalTime = ((TimerStep)steps.get(steps.size()-1)).currentTime - ((TimerStep)steps.get(0)).currentTime;
- }
- for (int i = 0; i < steps.size(); i++) {
- TimerStep step = (TimerStep) steps.get(i);
- Integer threadId = new Integer(step.threadId);
- switch (step.type) {
- case TimerStep.START:
- case TimerStep.STOP:
- Integer threadIndent = (Integer) indentsByThreadId.get(threadId);
- int indent = 0;
- if (step.type == TimerStep.START) {
- if (threadIndent != null)
- indent = threadIndent.intValue() + 1;
- indentsByThreadId.put(threadId, new Integer(indent));
- } else {
- if (threadIndent != null)
- indent = threadIndent.intValue();
- if (indent > 0)
- indentsByThreadId.put(threadId, new Integer(indent - 1));
- else {
- indentsByThreadId.remove(threadId);
- indent = 0;
- }
- }
- strb.setLength(0);
- strb.append(step.currentTime);
- strb.append("\t");
- for (int j = 0; j < indent; j++) {
- strb.append(" ");
- }
- switch (step.type) {
- case TimerStep.START:
- strb.append("Start");
- break;
-
- case TimerStep.STOP:
- strb.append("Stop ");
- break;
- default:
- break;
- }
- ;
- strb.append(" \"");
- strb.append(step.id);
- strb.append("\" id(");
- strb.append(step.threadId);
- strb.append(")");
- Map startSteps = (Map) stepInfoByThreadId.get(threadId);
- if (startSteps == null)
- stepInfoByThreadId.put(threadId, startSteps = new HashMap());
- if (step.type == TimerStep.START) {
- // Store the start step for later lookup when calulating the total time
- startSteps.put(step.id, step);
- } else {
- // This is the stop time for a step. We need to find
- // the corresponding start time and calculate the total time.
- Object item = startSteps.remove(step.id);
- if (item instanceof TimerStep) {
- startStep = (TimerStep) item;
- if (startStep != null) {
- int addchars = 100 - strb.length();
- for (int j = 0; j < addchars; j++) {
- strb.append(" ");
- }
- long delta = step.currentTime - startStep.currentTime;
- strb.append(" Total = " + delta + " ms");
- if (totalTime > 0)
- strb.append(" " + percentFormatter.format(delta/totalTime));
- }
- } else
- strb.append(" ---> Couldn't find Starting point for \"" + step.id + "\"");
- }
- if (i > 0 && (step.currentTime - prevStep.currentTime) > 0)
- System.out.println("-- " + (step.currentTime - prevStep.currentTime) + " ms --");
- prevStep = step;
- System.out.println(strb);
- break;
-
- case TimerStep.START_ACCUMULATING:
- cumSteps = (Map) stepInfoByThreadId.get(threadId);
- if (cumSteps == null)
- stepInfoByThreadId.put(threadId, cumSteps = new HashMap());
- cumSteps.put(step.id, new CumulativeInformation());
- threadIndent = (Integer) indentsByThreadId.get(threadId);
- indent = 0;
- if (threadIndent != null)
- indent = threadIndent.intValue();
- strb.setLength(0);
- strb.append(step.currentTime);
- strb.append("\t");
- for (int j = 0; j < indent; j++) {
- strb.append(" ");
- }
- strb.append("Start Accumulating");
- strb.append(" \"");
- strb.append(step.id);
- strb.append("\" id(");
- strb.append(step.threadId);
- strb.append(")");
- if (i > 0 && (step.currentTime - prevStep.currentTime) > 0)
- System.out.println("-- " + (step.currentTime - prevStep.currentTime) + " ms --");
- prevStep = step;
- System.out.println(strb);
- break;
-
- case TimerStep.START_CUMULATIVE:
- cumSteps = (Map) stepInfoByThreadId.get(threadId);
- if (cumSteps != null) {
- Object info = cumSteps.get(step.id);
- if (info instanceof CumulativeInformation)
- ((CumulativeInformation) info).currentCumulativeStep = step;
- }
- break;
-
- case TimerStep.STOP_CUMULATIVE:
- cumSteps = (Map) stepInfoByThreadId.get(threadId);
- if (cumSteps != null) {
- Object info = cumSteps.get(step.id);
- if (info instanceof CumulativeInformation) {
- CumulativeInformation cumInfo = (CumulativeInformation) info;
- if (cumInfo.currentCumulativeStep != null) {
- cumInfo.cumCount++;
- long delta = step.currentTime - cumInfo.currentCumulativeStep.currentTime;
- cumInfo.cumTime += delta;
- if (cumInfo.maxTime < delta)
- cumInfo.maxTime = delta;
- if (delta < cumInfo.minTime)
- cumInfo.minTime = delta;
- if (delta != 0) {
- cumInfo.cumCountNonZero++;
- if (delta < cumInfo.minTimeNonZero)
- cumInfo.minTimeNonZero = delta;
- }
- }
- }
- }
- break;
-
- case TimerStep.STOP_ACCUMULATING:
- threadIndent = (Integer) indentsByThreadId.get(threadId);
- indent = 0;
- if (threadIndent != null)
- indent = threadIndent.intValue();
- strb.setLength(0);
- strb.append(step.currentTime);
- strb.append("\t");
- for (int j = 0; j < indent; j++) {
- strb.append(" ");
- }
- strb.append("Stop Accumulating");
- strb.append(" \"");
- strb.append(step.id);
- strb.append("\" id(");
- strb.append(step.threadId);
- strb.append(")");
- cumSteps = (Map) stepInfoByThreadId.get(threadId);
- if (cumSteps != null) {
- Object info = cumSteps.get(step.id);
- if (info instanceof CumulativeInformation) {
- CumulativeInformation cumInfo = (CumulativeInformation) info;
- if (cumInfo.currentCumulativeStep != null) {
- strb.append(" cumulative time=");
- strb.append(cumInfo.cumTime);
- strb.append(" cumulative count=");
- strb.append(cumInfo.cumCount);
- strb.append(" max time=");
- strb.append(cumInfo.maxTime);
- strb.append(" min time=");
- strb.append(cumInfo.minTime);
- strb.append(" avg time=");
- strb.append(((double) cumInfo.cumTime)/cumInfo.cumCount);
- strb.append(" NonZero times: cumulative ~0 count=");
- strb.append(cumInfo.cumCountNonZero);
- if (cumInfo.cumCountNonZero != 0) {
- strb.append(" min ~0 time=");
- strb.append(cumInfo.minTimeNonZero);
- strb.append(" avg ~0 time=");
- strb.append(((double) cumInfo.cumTime) / cumInfo.cumCountNonZero);
- }
- }
- }
- }
- if (i > 0 && (step.currentTime - prevStep.currentTime) > 0)
- System.out.println("-- " + (step.currentTime - prevStep.currentTime) + " ms --");
- prevStep = step;
- System.out.println(strb);
- break;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java
deleted file mode 100644
index 3c42fe8..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: UIContextDetermination.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.*;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * Static utility class for UIContext determination.
- *
- * @since 1.0.0
- */
-public class UIContextDetermination {
-
- private static final int UNKNOWN = 100;
-
- public static final String HEADLESS_CONTEXT_LITERAL = "Headless";
-
- public static final String UI_CONTEXT_LITERAL = "UI";
-
- public static final int HEADLESS_CONTEXT = 102;
-
- public static final int UI_CONTEXT = 100;
-
- private static Map cachedExtensions = null;
-
- private static int currentContext = UNKNOWN;
-
- private UIContextDetermination() {
- }
-
- /**
- * Returns an instance of a given class based on the UI or Headless context.
- *
- * @param key
- * @return new class instance for the given key.
- * @throws IllegalArgumentException
- * If the key is invalid (e.g. no extension is found for the key)
- */
- public static Object createInstance(String key) {
- Object result = null;
- if (cachedExtensions == null)
- initExtensions();
- IConfigurationElement contextSensitiveClass = (IConfigurationElement) cachedExtensions.get(key);
- try {
- if (contextSensitiveClass != null)
- result = contextSensitiveClass
- .createExecutableExtension(UIContextDeterminationRegistryReader.UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR);
- } catch (CoreException e) {
- Logger.getLogger().logError("Problem loading extension not found for key \"" + key + "\".");
- Logger.getLogger().logError(e);
- }
- if (result == null)
- Logger.getLogger().logError("Extension not found for key \"" + key + "\".");
- return result;
- }
-
- /**
- * Returns the current context -- determines the value if necessary.
- *
- * @return current context
- * @see #HEADLESS_CONTEXT
- * @see #UI_CONTEXT
- */
- public static int getCurrentContext() {
- if (currentContext == UNKNOWN) {
- currentContext = HEADLESS_CONTEXT;
- new UITesterRegistryReader().readRegistry();
- }
- return currentContext;
- }
-
- /*
- * Invokes the UIContextDeterminationRegistryReader to cache all of the extensions, if necessary.
- *
- */
- private static void initExtensions() {
- if (cachedExtensions == null) {
- cachedExtensions = new HashMap();
- new UIContextDeterminationRegistryReader().readRegistry();
- }
- }
-
- /*
- * Converts the input to one of UI_CONTEXT or HEADLESS_CONTEXT. Defaults to HEADLESS on invalid input
- *
- * @param literal @return
- */
- private static int convertLiteral(String literal) {
- return (UI_CONTEXT_LITERAL.equals(literal)) ? UI_CONTEXT : HEADLESS_CONTEXT;
- }
-
- /*
- * Reads the registration of UI Context-sensitive class extensions and initializes the cache of the UIContextDetermination object.
- *
- * @author mdelder
- */
- private static class UIContextDeterminationRegistryReader extends RegistryReader {
-
- public static final String UI_CONTEXT_SENSTIVE_CLASS_ELEMENT = "uiContextSensitiveClass";
-
- public static final String UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR = "key";
-
- public static final String UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR = "className";
-
- public static final String UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR = "context";
-
- public UIContextDeterminationRegistryReader() {
- super(JEMUtilPlugin.PLUGIN_ID, JEMUtilPlugin.UI_CONTEXT_EXTENSION_POINT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- boolean result = false;
- if (element.getName().equals(UI_CONTEXT_SENSTIVE_CLASS_ELEMENT)) {
-
- String key = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR);
- String context = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR);
-
- if (!cachedExtensions.containsKey(key) || getCurrentContext() == convertLiteral(context))
- cachedExtensions.put(key, element);
- result = true;
- }
- return result;
- }
- }
-
- /*
- * Reads the uiTester extension and instantiate the any of the UITester classes it finds.
- *
- * The implementation has the side effect that if multiple UITesters are registered, any of them can trip the currentContext into the UI_CONTEXT
- * state.
- *
- * @author mdelder
- */
- private static class UITesterRegistryReader extends RegistryReader {
-
- public static final String UI_TESTER_ELEMENT = "uiTester"; //$NON-NLS-1$
-
- public static final String UI_TESTER_CLASSNAME_ATTR = "className"; //$NON-NLS-1$
-
- public UITesterRegistryReader() {
- super(JEMUtilPlugin.PLUGIN_ID, JEMUtilPlugin.UI_TESTER_EXTENSION_POINT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.emf.workbench.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- boolean result = false;
- if (element.getName().equals(UI_TESTER_ELEMENT)) {
- result = true;
- try {
- if (canCreateExecutableExtension(element)) {
- UITester tester = (UITester) element.createExecutableExtension(UI_TESTER_CLASSNAME_ATTR);
- if (tester.isCurrentContextUI())
- currentContext = UI_CONTEXT;
- }
- } catch (Throwable t) {
- Logger.getLogger().log("UIContextDetermination is proceeding in HEADLESS mode"); //$NON-NLS-1$
- }
- }
- return result;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java
deleted file mode 100644
index 06486f7..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.jem.util;
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: UITester.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-/**
- * Interface for a UITester. The "classname" attribute on the "uiTester" extension point should implement this class.
- *
- * @since 1.0.0
- */
-public interface UITester {
-
- /**
- * Answer if the current context is an UI context.
- *
- * @return <code>true</code> if an UI context.
- *
- * @since 1.0.0
- */
- public boolean isCurrentContextUI();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/EMFWorkbenchContextBase.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/EMFWorkbenchContextBase.java
deleted file mode 100644
index 7228847..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/EMFWorkbenchContextBase.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: EMFWorkbenchContextBase.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-
-import org.eclipse.jem.internal.util.emf.workbench.*;
-import org.eclipse.jem.internal.util.emf.workbench.nls.EMFWorkbenchResourceHandler;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * ContextBase for EMFWorkbench.
- *
- * <p>
- * This is meant to be subclassed as needed for additional or override function. It will be instantiated by default.
- * </p>
- *
- * @since 1.0.0
- */
-public class EMFWorkbenchContextBase {
-
- protected IProject project;
-
- protected ProjectResourceSet resourceSet;
-
- /**
- * Construct with a project.
- *
- * @param aProject
- *
- * @since 1.0.0
- */
- public EMFWorkbenchContextBase(IProject aProject) {
- if (aProject == null)
- throw new IllegalArgumentException(EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextBase_ERROR_1")); //$NON-NLS-1$
- project = aProject;
- }
-
- /**
- * Dispose of the context base.
- *
- *
- * @since 1.0.0
- */
- public void dispose() {
- if (resourceSet != null)
- resourceSet.release();
- resourceSet = null;
- project = null;
- }
-
- /**
- * Get the project this context is associated with.
- *
- * @return project
- *
- * @since 1.0.0
- */
- public IProject getProject() {
- return project;
- }
-
- /**
- * Return the resource set (creating if needed) for context.
- *
- * @return resource set
- *
- * @since 1.0.0
- */
- public ProjectResourceSet getResourceSet() {
- if (resourceSet == null) {
- resourceSet = createResourceSet();
- initializeResourceSet(resourceSet);
- }
- return resourceSet;
- }
-
- /**
- * Used for optimization; answer whether a resourceSet has been created
- *
- * @return <code>true</code> if a resource set has been created.
- *
- * @since 1.0.0
- */
- public boolean hasResourceSet() {
- return resourceSet != null;
- }
-
- /**
- * Initialize the resource set.
- *
- * @param aResourceSet
- *
- * @since 1.0.0
- */
- protected void initializeResourceSet(ProjectResourceSet aResourceSet) {
- createResourceSetSynchronizer(aResourceSet);
- aResourceSet.setURIConverter(createURIConverter(aResourceSet));
- aResourceSet.add(new WorkspaceResourceHandler());
- JEMUtilPlugin.getDefault().addExtendedResourceHandlers(aResourceSet);
-
- }
-
- /**
- * Create the resource set. By default it is a ProjectResourceSetImpl.
- *
- * @return project's new resource set.
- *
- * @since 1.0.0
- */
- protected ProjectResourceSet createResourceSet() {
- if (project == null)
- throw new IllegalStateException(EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextBase_ERROR_2")); //$NON-NLS-1$
- return new ProjectResourceSetImpl(project);
- }
-
- /**
- * Create a URIConverter for the resource set.
- *
- * @param aResourceSet
- * @return a uri converter.
- *
- * @since 1.0.0
- */
- protected WorkbenchURIConverter createURIConverter(ProjectResourceSet aResourceSet) {
- return new WorkbenchURIConverterImpl(getProject(), aResourceSet.getSynchronizer());
- }
-
- /**
- * Create a resource set workbench synchronizer.
- *
- * @param aResourceSet
- * @return a resource set workbench synchronizer.
- *
- * @since 1.0.0
- */
- protected ResourceSetWorkbenchSynchronizer createResourceSetSynchronizer(ProjectResourceSet aResourceSet) {
- return EMFWorkbenchContextFactory.INSTANCE.createSynchronizer(aResourceSet, getProject());
- }
-
- /**
- * Delete the resource from the workspace.
- *
- * @param aResource
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public void deleteResource(Resource aResource) throws CoreException {
- if (aResource != null)
- deleteFile(aResource);
- }
-
- /**
- * Delete the file associated with the resource.
- *
- * @param resource
- *
- * @since 1.0.0
- */
- public void deleteFile(Resource resource) {
- throw new UnsupportedOperationException(EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextBase_ERROR_0")); //$NON-NLS-1$
- }
-
- /**
- * Get resource (with the given URI) from the project resource set. Load it if not already loaded.
- *
- * @param uri
- * @return resource for the uri, or <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public Resource getResource(URI uri) {
- return this.resourceSet.getResource(uri, true);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/IEMFContextContributor.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/IEMFContextContributor.java
deleted file mode 100644
index 7d92876..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/IEMFContextContributor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: IEMFContextContributor.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-
-package org.eclipse.jem.util.emf.workbench;
-
-/**
- * EMF Context Contributor interface. Implimenters are called to contribute to the context.
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase#createEMFContext(IProject, IEMFContextContributor)
- * @since 1.0.0
- */
-public interface IEMFContextContributor {
-
- /**
- * This is your opportunity to add a primary EMFNature. Typically you would add to the WorkbenchContext held by <code>aNature</code> in order to
- * change the container for the WorkbenchURIConverter or add adapter factories to the ResourceSet or anything else that is needed.
- *
- * @param aNature
- *
- * @since 1.0.0
- */
- void primaryContributeToContext(EMFWorkbenchContextBase aNature);
-
- /**
- * This is your opportunity to add a secondary EMFNature. Typically you would add to the WorkbenchContext held by <code>aNature</code> in order
- * to change the container for the WorkbenchURIConverter or add adapter factories to the ResourceSet or anything else that is needed.
- *
- * @param aNature
- *
- * @since 1.0.0
- */
- void secondaryContributeToContext(EMFWorkbenchContextBase aNature);
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ISynchronizerExtender.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ISynchronizerExtender.java
deleted file mode 100644
index 6a56aae..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ISynchronizerExtender.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ISynchronizerExtender.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import org.eclipse.core.resources.IResourceDelta;
-
-/**
- * Implimenters allows clients, eg {@link org.eclipse.jem.util.emf.workbench.EMFNatureContributor}, to extend the behavior of the
- * ResourceSetWorkbenchSynchronizer.
- *
- * @see org.eclipse.jem.util.emf.workbench.ResourceSetWorkbenchSynchronizer#addExtender(ISynchronizerExtender)
- * @since 1.0.0
- */
-public interface ISynchronizerExtender {
-
- /**
- * Notification that project has changed.
- *
- * @param delta
- *
- * @since 1.0.0
- */
- void projectChanged(IResourceDelta delta);
-
- /**
- * Notification that project has been closed.
- *
- *
- * @since 1.0.0
- */
- void projectClosed();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/JavaProjectUtilities.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/JavaProjectUtilities.java
deleted file mode 100644
index cf7d222..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/JavaProjectUtilities.java
+++ /dev/null
@@ -1,688 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: JavaProjectUtilities.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/12 17:40:55 $
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import java.net.URL;
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.internal.core.JavaModel;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * Project utilities that are Java (JDT) specific. This class should be
- * referenced only if the JDT is installed, otherwise you will get
- * class definition not found errors. This is because JDT is optional
- * for thie org.eclipse.jem.util bundle.
- * @since 1.1.0
- */
-public class JavaProjectUtilities extends ProjectUtilities {
-
- public JavaProjectUtilities() {
- super();
- }
-
- /**
- * Get the java project nature for the given project.
- *
- * @param p
- * project
- * @return the java project nature for the project or <code>null</code> if not a java project.
- *
- * @since 1.0.0
- */
- public static IJavaProject getJavaProject(IProject p) {
- try {
- return (IJavaProject) p.getNature(JavaCore.NATURE_ID);
- } catch (CoreException ignore) {
- return null;
- }
- }
-
- /**
- * Touch classpath. It simply takes the classpath and sets it back in.
- *
- * @param javaProject
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void updateClasspath(IJavaProject javaProject) throws JavaModelException {
- if (javaProject != null)
- javaProject.setRawClasspath(javaProject.getRawClasspath(), new NullProgressMonitor());
- }
-
- /**
- * Return the location of the binary output files for the JavaProject.
- *
- * @param p
- * project
- * @return path to binary output folder or <code>null</code> if not java project or other problem.
- *
- * @since 1.0.0
- */
- public static IPath getJavaProjectOutputLocation(IProject p) {
- try {
- IJavaProject javaProj = getJavaProject(p);
- if (javaProj == null)
- return null;
- if (!javaProj.isOpen())
- javaProj.open(null);
- return javaProj.getOutputLocation();
- } catch (JavaModelException e) {
- return null;
- }
- }
-
- /**
- * Get the project's binary output container.
- *
- * @param p
- * project
- * @return project's output container or <code>null</code> if not java project or some other error.
- *
- * @since 1.0.0
- */
- public static IContainer getJavaProjectOutputContainer(IProject p) {
- IPath path = getJavaProjectOutputLocation(p);
- if (path == null)
- return null;
- if (path.segmentCount() == 1)
- return p;
- return p.getFolder(path.removeFirstSegments(1));
- }
-
- /**
- * Get the binary output absolute (local file system) path.
- *
- * @param p
- * project
- * @return project's output path or <code>null</code> if not java project or some other error.
- *
- * @since 1.0.0
- */
- public static IPath getJavaProjectOutputAbsoluteLocation(IProject p) {
- IContainer container = getJavaProjectOutputContainer(p);
- if (container != null)
- return container.getLocation();
- return null;
- }
-
- /**
- * Get the JDT JavaModel.
- *
- * @return JDT's JavaModel
- *
- * @since 1.0.0
- */
- public static JavaModel getJavaModel() {
- return JavaModelManager.getJavaModelManager().getJavaModel();
- }
-
- /**
- * Get all source package fragment roots.
- *
- * @param javaProj
- * @return source package fragment roots
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static List getSourcePackageFragmentRoots(IJavaProject javaProj) throws JavaModelException {
- List result = new ArrayList();
- IPackageFragmentRoot[] roots = javaProj.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IPackageFragmentRoot root = roots[i];
- if (root.getKind() == IPackageFragmentRoot.K_SOURCE)
- result.add(result);
- }
- return result;
- }
-
- /**
- * Remove the resource from the classpath
- *
- * @param p
- * project
- * @param res
- * resource
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void removeFromJavaClassPath(IProject p, IResource res) throws JavaModelException {
- IClasspathEntry entry = JavaCore.newLibraryEntry(res.getFullPath(), null, null);
- removeFromJavaClassPath(p, entry);
- }
-
- /**
- * Remove the path from the classpath
- *
- * @param p
- * project
- * @param path
- * path to remove
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void removeFromJavaClassPath(IProject p, IPath path) throws JavaModelException {
- org.eclipse.core.resources.IFile f = p.getFile(path);
- removeFromJavaClassPath(p, f);
- }
-
- /**
- * Remove the classpath entry from the project's classpath.
- *
- * @param p
- * @param entry
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void removeFromJavaClassPath(IProject p, IClasspathEntry entry) throws JavaModelException {
- IJavaProject javaProject = null;
- try {
- javaProject = (IJavaProject) p.getNature(JavaCore.NATURE_ID);
- } catch (CoreException ignore) {
- }
- if (javaProject != null) {
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- javaProject.setRawClasspath(primRemoveFromJavaClassPath(classpath, entry), new NullProgressMonitor());
- }
- }
-
- /**
- * Remove the list of entries from the classpath of the project.
- *
- * @param p
- * project
- * @param entries
- * list of IClassPathEntry's
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void removeFromJavaClassPath(IProject p, List entries) throws JavaModelException {
- IJavaProject javaProject = null;
- try {
- javaProject = (IJavaProject) p.getNature(JavaCore.NATURE_ID);
- } catch (CoreException ignore) {
- }
- if (javaProject != null) {
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- javaProject.setRawClasspath(primRemoveFromJavaClassPath(classpath, entries), new NullProgressMonitor());
- }
- }
-
- protected static IClasspathEntry[] primRemoveFromJavaClassPath(IClasspathEntry[] classpath, IClasspathEntry entry) throws JavaModelException {
- List result = new ArrayList();
- boolean didRemove = false;
- for (int i = 0; i < classpath.length; i++) {
- IClasspathEntry cpEntry = classpath[i];
- if (!entry.getPath().equals(classpath[i].getPath()))
- result.add(cpEntry);
- else
- didRemove = true;
- }
- if (!didRemove)
- return classpath;
- return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
- }
-
- protected static IClasspathEntry[] primRemoveFromJavaClassPath(IClasspathEntry[] classpath, List entries) throws JavaModelException {
- List arrayList = Arrays.asList(classpath);
- List removeable = new ArrayList(arrayList);
- IClasspathEntry entry;
- boolean didRemove = false;
- int size = entries.size();
- for (int i = 0; i < size; i++) {
- entry = (IClasspathEntry) entries.get(i);
- for (int j = 0; j < classpath.length; j++) {
- IClasspathEntry cpEntry = classpath[j];
- if (entry.getPath().equals(classpath[j].getPath())) {
- if (removeable.remove(cpEntry))
- didRemove = true;
- }
- }
- }
- if (!didRemove)
- return classpath;
- return (IClasspathEntry[]) removeable.toArray(new IClasspathEntry[removeable.size()]);
- }
-
- /**
- * Get the classpath as an array or URL's.
- *
- * @param javaProject
- * @return array of URL's or <code>null</code> if javaProject was <code>null</code>.
- *
- * @since 1.0.0
- */
- public static URL[] getClasspathAsURLArray(IJavaProject javaProject) {
- if (javaProject == null)
- return null;
- Set visited = new HashSet();
- List urls = new ArrayList(20);
- collectClasspathURLs(javaProject, urls, visited, true);
- URL[] result = new URL[urls.size()];
- urls.toArray(result);
- return result;
- }
-
- private static void collectClasspathURLs(IJavaProject javaProject, List urls, Set visited, boolean isFirstProject) {
- if (visited.contains(javaProject))
- return;
- visited.add(javaProject);
- IPath outPath = getJavaProjectOutputAbsoluteLocation(javaProject.getProject());
- outPath = outPath.addTrailingSeparator();
- URL out = ProjectUtilities.createFileURL(outPath);
- urls.add(out);
- IClasspathEntry[] entries = null;
- try {
- entries = javaProject.getResolvedClasspath(true);
- } catch (JavaModelException e) {
- return;
- }
- IClasspathEntry entry;
- for (int i = 0; i < entries.length; i++) {
- entry = entries[i];
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_LIBRARY:
- case IClasspathEntry.CPE_CONTAINER:
- case IClasspathEntry.CPE_VARIABLE:
- collectClasspathEntryURL(entry, urls);
- break;
- case IClasspathEntry.CPE_PROJECT: {
- if (isFirstProject || entry.isExported())
- collectClasspathURLs(getJavaProject(entry), urls, visited, false);
- break;
- }
- }
- }
- }
-
- private static void collectClasspathEntryURL(IClasspathEntry entry, List urls) {
- URL url = ProjectUtilities.createFileURL(entry.getPath());
- if (url != null)
- urls.add(url);
- }
-
- private static IJavaProject getJavaProject(IClasspathEntry entry) {
- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(entry.getPath().segment(0));
- if (proj != null)
- return getJavaProject(proj);
- return null;
- }
-
- /**
- * Is this project a binary project.
- * <p>
- * Typically a Java project is considered binary if it does not have a source entry in the classpath.
- *
- * @param project
- * Project to test
- * @return <code>true</code> if project is a binary project.
- */
- public static boolean isBinaryProject(IProject aProject) {
-
- IJavaProject javaProj = getJavaProject(aProject);
- if (javaProj == null)
- return false;
- IClasspathEntry[] entries = null;
- try {
- entries = javaProj.getRawClasspath();
- } catch (JavaModelException jme) {
- return false;
- }
- for (int i = 0; i < entries.length; i++) {
- IClasspathEntry entry = entries[i];
- if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE)
- return false;
- }
- return true;
- }
-
- /**
- * Append to java class path.
- * <p>
- * Append a list of IClasspathEntry's to the build path of the passed project. Updated to remove existing occurrences of the passed entries before
- * appending.
- * </p>
- *
- * @param p
- * project
- * @param appendClasspathEntries
- * list of entries
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void appendJavaClassPath(IProject p, List appendClasspathEntries) throws JavaModelException {
- IJavaProject javaProject = null;
- try {
- javaProject = (IJavaProject) p.getNature(JavaCore.NATURE_ID);
- } catch (CoreException ignore) {
- }
- if (javaProject != null) {
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- List newPathList = new ArrayList(classpath.length);
- for (int i = 0; i < classpath.length; i++) {
- IClasspathEntry entry = classpath[i];
- // Skip entries which are in the append list
- if (appendClasspathEntries.indexOf(entry) < 0)
- newPathList.add(entry);
- }
- newPathList.addAll(appendClasspathEntries);
- IClasspathEntry[] newClasspath = (IClasspathEntry[]) newPathList.toArray(new IClasspathEntry[newPathList.size()]);
- javaProject.setRawClasspath(newClasspath, new NullProgressMonitor());
- }
- }
-
- /**
- * Append classpath entry.
- * <p>
- * Append one IClasspathEntry to the build path of the passed project. If a classpath entry having the same path as the parameter already exists,
- * then does nothing.
- * </p>
- *
- * @param p
- * Project
- * @param newEntry
- * Entry
- * @throws JavaModelException
- *
- * @since 1.0.0
- */
- public static void appendJavaClassPath(IProject p, IClasspathEntry newEntry) throws JavaModelException {
- IJavaProject javaProject = getJavaProject(p);
- if (javaProject == null)
- return;
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- List newPathList = new ArrayList(classpath.length);
- for (int i = 0; i < classpath.length; i++) {
- IClasspathEntry entry = classpath[i];
- // fix dup class path entry for .JETEmitter project
- // Skip the entry to be added if it already exists
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- if (!entry.getPath().toString().equalsIgnoreCase(newEntry.getPath().toString()))
- newPathList.add(entry);
- else
- return;
- } else {
- if (!entry.getPath().equals(newEntry.getPath()))
- newPathList.add(entry);
- else
- return;
- }
- }
- newPathList.add(newEntry);
- IClasspathEntry[] newClasspath = (IClasspathEntry[]) newPathList.toArray(new IClasspathEntry[newPathList.size()]);
- javaProject.setRawClasspath(newClasspath, new NullProgressMonitor());
- }
-
- /**
- * Return the source path matching the parameter; if the parameter is null, or if the source folder is not on the classpath, return the first
- * source path on the classpath
- *
- * @param p
- * project
- * @param defaultSourceName
- * source folder to find if on classpath, or if <code>null</code> the first folder
- * @return path searched for or <code>null</code> if not java project or some other problem.
- *
- * @since 1.0.0
- */
- public static IPath getSourcePathOrFirst(IProject p, String defaultSourceName) {
- IJavaProject javaProj = getJavaProject(p);
- if (javaProj == null)
- return null;
- IClasspathEntry[] cp = null;
- try {
- cp = javaProj.getRawClasspath();
- } catch (JavaModelException ex) {
- JEMUtilPlugin.getLogger().logError(ex);
- return null;
- }
- IClasspathEntry firstSource = null;
- IPath defaultSourcePath = null;
- if (defaultSourceName != null)
- defaultSourcePath = ProjectUtilities.createPath(p, defaultSourceName);
- for (int i = 0; i < cp.length; i++) {
- if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- if (firstSource == null) {
- firstSource = cp[i];
- if (defaultSourcePath == null)
- break;
- }
- if (cp[i].getPath().equals(defaultSourcePath))
- return defaultSourcePath.removeFirstSegments(1);
- }
- }
- if (firstSource == null)
- return null;
- if (firstSource.getPath().segment(0).equals(p.getName()))
- return firstSource.getPath().removeFirstSegments(1);
- return null;
- }
-
- protected static List getSourcePaths(IProject p) {
- IJavaProject javaProj = getJavaProject(p);
- if (javaProj == null)
- return null;
- IClasspathEntry[] cp = null;
- try {
- cp = javaProj.getRawClasspath();
- } catch (JavaModelException ex) {
- JEMUtilPlugin.getLogger().logError(ex);
- return null;
- }
- List sourcePaths = new ArrayList();
- for (int i = 0; i < cp.length; i++) {
- if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- sourcePaths.add(cp[i].getPath().removeFirstSegments(1));
- }
- }
- return sourcePaths;
- }
-
- /**
- * Hack to force a reload of the .classpath file
- *
- * @param project
- * project to reload
- * @since 1.0.0
- */
- public static void forceClasspathReload(IProject project) throws JavaModelException {
- IJavaProject javaProj = getJavaProject(project);
- if (javaProj != null) {
- IClasspathEntry[] entries = javaProj.readRawClasspath();
- if (entries != null) {
- IPath output = javaProj.readOutputLocation();
- if (output != null)
- javaProj.setRawClasspath(entries, output, null);
- }
- }
- }
-
- /**
- * Get the paths of all of the local jars in the classpath for the project. It does not recurse into referenced projects.
- *
- * @param proj
- * project to search (should be a java project).
- * @return A list of IPath, where each entry is a project relative path to a JAR contained in the project.
- */
- public static List getLocalJARPathsFromClasspath(IProject proj) {
- IJavaProject javaProj = getJavaProject(proj);
- if (javaProj == null)
- return null;
- IPath projectPath = proj.getFullPath();
- List result = new ArrayList();
- try {
- IClasspathEntry[] entries = javaProj.getRawClasspath();
- for (int i = 0; i < entries.length; i++) {
- IClasspathEntry entry = entries[i];
- if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IPath path = entry.getPath();
- int segments = path.matchingFirstSegments(projectPath);
- if (segments > 0)
- result.add(path.removeFirstSegments(segments));
- }
- }
- } catch (JavaModelException e) {
- JEMUtilPlugin.getLogger().logError(e);
- }
- return result;
- }
-
- /*
- * return list of path that may contain classes
- */
- protected static List getlibraryPaths(IProject p) {
- IJavaProject javaProj = getJavaProject(p);
- if (javaProj == null)
- return null;
- IClasspathEntry[] cp = null;
- try {
- cp = javaProj.getRawClasspath();
- } catch (JavaModelException ex) {
- JEMUtilPlugin.getLogger().logError(ex);
- return null;
- }
- List libraryPaths = new ArrayList();
- for (int i = 0; i < cp.length; i++) {
- if (cp[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- libraryPaths.add(cp[i].getPath().removeFirstSegments(1));
- }
- }
- return libraryPaths;
- }
-
- /**
- * Return the source folder matching the parameter; if the parameter is null, or if the source folder is not on the classpath, return the first
- * source folder on the classpath
- *
- * @param p
- * project
- * @param defaultSourceName
- * source folder to find if on classpath, or if <code>null</code> the first folder
- * @return container searched for or <code>null</code> if not java project or some other problem.
- *
- * @since 1.0.0
- */
- public static IContainer getSourceFolderOrFirst(IProject p, String defaultSourceName) {
- try {
- IPath sourcePath = getSourcePathOrFirst(p, defaultSourceName);
- if (sourcePath == null)
- return null;
- else if (sourcePath.isEmpty())
- return p;
- else
- return p.getFolder(sourcePath);
- } catch (IllegalArgumentException ex) {
- return null;
- }
- }
-
- /**
- * Returns a list of IFolder that represents each source folder in a java project
- *
- * @deprecated Use {@link #getSourceContainers(IProject)}because the project itself might be a source container
- *
- * @param p
- * project
- * @return
- *
- * @since 1.0.0
- */
- public static List getSourceFolders(IProject p) {
- try {
- List sourceFolders = new ArrayList();
- List sourcePaths = getSourcePaths(p);
- if (sourcePaths != null && !sourcePaths.isEmpty()) {
- for (int i = 0; i < sourcePaths.size(); i++) {
- IPath path = (IPath) sourcePaths.get(i);
- if (!path.isEmpty())
- sourceFolders.add(p.getFolder(path));
- }
- }
- return sourceFolders;
- } catch (IllegalArgumentException ex) {
- return Collections.EMPTY_LIST;
- }
- }
-
- /**
- * Get source containers for the project.
- *
- * @param p
- * project
- * @return list of source containers.
- *
- * @since 1.0.0
- */
- public static List getSourceContainers(IProject p) {
- try {
- List sourceContainers = new ArrayList();
- List sourcePaths = getSourcePaths(p);
- if (sourcePaths != null && !sourcePaths.isEmpty()) {
- for (int i = 0; i < sourcePaths.size(); i++) {
- IPath path = (IPath) sourcePaths.get(i);
- if (path.isEmpty())
- sourceContainers.add(p);
- else
- sourceContainers.add(p.getFolder(path));
- }
- }
- return sourceContainers;
- } catch (IllegalArgumentException ex) {
- return Collections.EMPTY_LIST;
- }
- }
-
- /**
- * Return list of IContainers that are Libraries in the classpath.
- *
- * @param p
- * project
- * @return list of library IContainers.
- *
- * @since 1.0.0
- */
- public static List getLibraryContainers(IProject p) {
- try {
- List libraryContainers = new ArrayList();
- List libraryPaths = getlibraryPaths(p);
- if (libraryPaths != null && !libraryPaths.isEmpty()) {
- for (int i = 0; i < libraryPaths.size(); i++) {
- IPath path = (IPath) libraryPaths.get(i);
- if (path.isEmpty())
- libraryContainers.add(p);
- else
- libraryContainers.add(p.getFolder(path));
- }
- }
- return libraryContainers;
- } catch (IllegalArgumentException ex) {
- return Collections.EMPTY_LIST;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectResourceSet.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectResourceSet.java
deleted file mode 100644
index db076db..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectResourceSet.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ProjectResourceSet.java,v $$
- * $$Revision: 1.2 $$ $$Date: 2005/02/04 23:12:01 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-/**
- * A ResourceSet for an entire project. It allows sharing of resources from multiple editors/viewers for a project.
- * <p>
- * An additional Notification type is sent out by ProjectResourceSet's of project resource set about to be released. A release is
- * called when projects are about to be closed. They release all of the resources and unload them. This notification can be used
- * to know that this is about to happen and to do something before the resources become invalid. It will be sent out just before the
- * resource set will be released.
- *
- * @see ProjectResourceSet#SPECIAL_NOTIFICATION_TYPE
- * @see ProjectResourceSet#PROJECTRESOURCESET_ABOUT_TO_RELEASE_ID
- * @since 1.0.0
- */
-
-public interface ProjectResourceSet extends ResourceSet {
-
- IProject getProject();
-
- /**
- * Notification type in notifications from the ProjectResourceSet for
- * special notifications, and not the standard ones from ResourceSet.
- *
- * @see org.eclipse.emf.common.notify.Notification#getEventType()
- * @since 1.1.0
- */
- static int SPECIAL_NOTIFICATION_TYPE = Notification.EVENT_TYPE_COUNT+4;
-
- /**
- * Notification Feature ID for resource set about to be released.
- * Use {@link org.eclipse.emf.common.notify.Notification#getFeatureID(java.lang.Class)} to
- * get this id. The getFeature() on notification will return null.
- *
- * @since 1.1.0
- */
- static int PROJECTRESOURCESET_ABOUT_TO_RELEASE_ID = 1000;
-
- /**
- * Call when the ResourceSet is no longer to be used.
- *
- *
- * @since 1.0.0
- */
- void release();
-
- /**
- * Add the <code>resourceHandler</code> to the end of the list of resourceHandlers.
- *
- * @param resourceHandler
- * IResourceHandler
- * @return boolean Return <code>true</code> if it was added.
- * @since 1.0.0
- */
- boolean add(ResourceHandler resourceHandler);
-
- /**
- * Add the <code>resourceHandler</code> to the front of the list of resourceHandlers.
- *
- * @param resourceHandler
- * IResourceHandler
- * @since 1.0.0
- */
- void addFirst(ResourceHandler resourceHandler);
-
- /**
- * Remove the <code>resourceHandler</code> from the list of resourceHandlers.
- *
- * @param resourceHandler
- * IResourceHandler
- * @return boolean Return true if it was removed.
- * @since 1.0.0
- */
- boolean remove(ResourceHandler resourceHandler);
-
- /**
- * Return the ResourceSet synchronizer that will synchronize the ResourceSet with changes from the Workbench.
- *
- * @return ResourceSetWorkbenchSynchronizer
- * @since 1.0.0
- */
- ResourceSetWorkbenchSynchronizer getSynchronizer();
-
- /**
- * Set the ResourceSet synchronizer that will synchronize the ResourceSet with changes from the Workbench.
- *
- * @param aSynchronizer
- * @return ResourceSetWorkbenchSynchronizer
- * @since 1.0.0
- */
- void setSynchronizer(ResourceSetWorkbenchSynchronizer aSynchronizer);
-
- /**
- * This should be called by clients whenever the structure of the project changes such that any cached URIs will be invalid. For example, if the
- * source folders within the URIConverter change.
- *
- * @since 1.0.0
- */
- void resetNormalizedURICache();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectUtilities.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectUtilities.java
deleted file mode 100644
index 7e80f23..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ProjectUtilities.java
+++ /dev/null
@@ -1,749 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ProjectUtilities.java,v $$
- * $$Revision: 1.2 $$ $$Date: 2005/01/12 17:40:55 $$
- */
-
-package org.eclipse.jem.util.emf.workbench;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.*;
-import java.util.logging.Level;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.*;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * EMF Workbench Project Utilities.
- *
- * @since 1.0.0
- */
-
-public class ProjectUtilities {
-
- /**
- * Project control file name in project.
- *
- * @since 1.0.0
- */
- public final static String DOT_PROJECT = ".project"; //$NON-NLS-1$
-
- /**
- * Classpath control file name in project.
- *
- * @since 1.0.0
- */
- public final static String DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$
-
- public ProjectUtilities() {
- }
-
- /**
- * Add the nature id to the project ahead of all other nature ids.
- *
- * @param proj
- * @param natureId
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static void addNatureToProject(IProject proj, String natureId) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 1, prevNatures.length);
- newNatures[0] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, null);
- }
-
- /**
- * Add the nature id after all of the other nature ids for the project.
- *
- * @param proj
- * @param natureId
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static void addNatureToProjectLast(IProject proj, String natureId) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, null);
- }
-
- /**
- * Remove the nature id from the project.
- *
- * @param project
- * @param natureId
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static void removeNatureFromProject(IProject project, String natureId) throws CoreException {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- int size = prevNatures.length;
- int newsize = 0;
- String[] newNatures = new String[size];
- boolean matchfound = false;
- for (int i = 0; i < size; i++) {
- if (prevNatures[i].equals(natureId)) {
- matchfound = true;
- continue;
- } else
- newNatures[newsize++] = prevNatures[i];
- }
- if (!matchfound)
- throw new CoreException(new Status(IStatus.ERROR, JEMUtilPlugin.ID, 0,
- "The nature id " + natureId + " does not exist on the project " + project.getName(), null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else {
- String[] temp = newNatures;
- newNatures = new String[newsize];
- System.arraycopy(temp, 0, newNatures, 0, newsize);
- description.setNatureIds(newNatures);
- project.setDescription(description, null);
- }
- }
-
- /**
- * Add the list of projects to end of the "referenced projects" list from the project's description.
- *
- * @param project
- * @param toBeAddedProjectsList
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static void addReferenceProjects(IProject project, List toBeAddedProjectsList) throws CoreException {
-
- IProjectDescription description = project.getDescription();
- IProject[] projects = description.getReferencedProjects();
-
- ArrayList projectsList = new ArrayList();
-
- for (int i = 0; i < projects.length; i++) {
- projectsList.add(projects[i]);
- }
-
- for (int i = 0; i < toBeAddedProjectsList.size(); i++) {
- projectsList.add(toBeAddedProjectsList.get(i));
- }
-
- IProject[] refProjects = new IProject[projectsList.size()];
-
- for (int i = 0; i < refProjects.length; i++) {
- refProjects[i] = (IProject) (projectsList.get(i));
- }
-
- description.setReferencedProjects(refProjects);
- project.setDescription(description, null);
- }
-
- /**
- * Add the single project to the end of the "referenced projects" list from the project's description.
- *
- * @param project
- * @param projectToBeAdded
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static void addReferenceProjects(IProject project, IProject projectToBeAdded) throws CoreException {
- IProjectDescription description = project.getDescription();
- IProject[] projects = description.getReferencedProjects();
-
- ArrayList projectsList = new ArrayList();
-
- for (int i = 0; i < projects.length; i++) {
- projectsList.add(projects[i]);
- }
-
- projectsList.add(projectToBeAdded);
-
- IProject[] refProjects = new IProject[projectsList.size()];
-
- for (int i = 0; i < refProjects.length; i++) {
- refProjects[i] = (IProject) (projectsList.get(i));
- }
-
- description.setReferencedProjects(refProjects);
- project.setDescription(description, null);
- }
-
- /**
- * Force a an immediate build of the project.
- *
- * @param project
- * @param progressMonitor
- *
- * @since 1.0.0
- */
- public static void forceAutoBuild(IProject project, IProgressMonitor progressMonitor) {
- try {
- project.build(IncrementalProjectBuilder.FULL_BUILD, progressMonitor);
- } catch (CoreException ce) {
- //Revisit: Need to use a Logger
- //Logger.getLogger().logError(ce);
- }
- }
-
- /**
- * Return if auto build is turned on.
- *
- * @return <code>true</code> if auto build is turned on.
- *
- * @since 1.0.0
- */
- public static boolean getCurrentAutoBuildSetting() {
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wd = workspace.getDescription();
- return wd.isAutoBuilding();
- }
-
- /**
- * Get the project associated with the given object.
- *
- * @param object
- * may be an <code>IProject, IResource, IAdaptable (to an IProject), EObject (gets IProject if object is in a ProjectResourceSet</code>.
- * @param natureId
- * if <code>null</code> then returns project. If not <code>null</code> then returns project only if project has this nature id.
- * @return project associated with the object or <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public static IProject getProject(Object object, String natureId) {
- IProject result = getProject(object);
- if (natureId == null)
- return result;
- if (result != null && result.isAccessible() && natureId != null)
- try {
- if (result.hasNature(natureId))
- return result;
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- return null;
- }
-
- /**
- * Get the project associated with the given object.
- *
- * @param object
- * may be an <code>IProject, IResource, IAdaptable (to an IProject), EObject (gets IProject if object is in a ProjectResourceSet</code>.
- * @return project associated with the object or <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public static IProject getProject(Object object) {
- IProject result = null;
-
- if (object instanceof IProject)
- result = (IProject) object;
- else if (object instanceof IResource)
- result = ((IResource) object).getProject();
- else if (object instanceof IAdaptable)
- result = (IProject) ((IAdaptable) object).getAdapter(IProject.class);
- else if (object instanceof EObject)
- result = getProject((EObject) object);
-
- return result;
- }
-
- /**
- * Get the project associated with the given EObject. (If in a ProjectResourceSet, then the project from that resource set).
- *
- * @param aRefObject
- * @return project if associated or <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public static IProject getProject(EObject aRefObject) {
- if (aRefObject != null) {
- Resource resource = aRefObject.eResource();
- return getProject(resource);
- }
- return null;
- }
-
- /**
- * Get the project associated with the given Resource. (If in a ProjectResourceSet, then the project from that resource set).
- *
- * @param resource
- * @return project if associated or <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public static IProject getProject(Resource resource) {
- ResourceSet set = resource == null ? null : resource.getResourceSet();
- if (set instanceof ProjectResourceSet)
- return ((ProjectResourceSet) set).getProject();
- URIConverter converter = set == null ? null : set.getURIConverter();
- if (converter != null && converter instanceof WorkbenchURIConverter && ((WorkbenchURIConverter) converter).getOutputContainer() != null)
- return ((WorkbenchURIConverter) converter).getOutputContainer().getProject();
- else
- return null;
- }
-
- /**
- * Remove the list of projects from the list of "referenced projects" in the project's description.
- *
- * @param project
- * @param toBeRemovedProjectList
- * @throws org.eclipse.core.runtime.CoreException
- *
- * @since 1.0.0
- */
- public static void removeReferenceProjects(IProject project, List toBeRemovedProjectList) throws org.eclipse.core.runtime.CoreException {
- IProjectDescription description = project.getDescription();
- IProject[] projects = description.getReferencedProjects();
-
- ArrayList projectsList = new ArrayList();
-
- for (int i = 0; i < projects.length; i++) {
- projectsList.add(projects[i]);
- }
-
- for (int i = 0; i < toBeRemovedProjectList.size(); i++) {
- projectsList.remove(toBeRemovedProjectList.get(i));
- }
-
- IProject[] refProjects = new IProject[projectsList.size()];
-
- for (int i = 0; i < refProjects.length; i++) {
- refProjects[i] = (IProject) (projectsList.get(i));
- }
-
- description.setReferencedProjects(refProjects);
- project.setDescription(description, null);
- }
-
- /**
- * Remove the project from the list of "referenced projects" in the description for the given project.
- *
- * @param project
- * @param toBeRemovedProject
- * @throws org.eclipse.core.runtime.CoreException
- *
- * @since 1.0.0
- */
- public static void removeReferenceProjects(IProject project, IProject toBeRemovedProject) throws org.eclipse.core.runtime.CoreException {
- IProjectDescription description = project.getDescription();
- IProject[] projects = description.getReferencedProjects();
-
- ArrayList projectsList = new ArrayList();
-
- for (int i = 0; i < projects.length; i++) {
- projectsList.add((projects[i]));
- }
-
- projectsList.remove(toBeRemovedProject);
-
- IProject[] refProjects = new IProject[projectsList.size()];
-
- for (int i = 0; i < refProjects.length; i++) {
- refProjects[i] = (IProject) (projectsList.get(i));
- }
-
- description.setReferencedProjects(refProjects);
- project.setDescription(description, null);
- }
-
- /**
- * Turn auto-building off.
- *
- *
- * @since 1.0.0
- */
- public static void turnAutoBuildOff() {
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wd = workspace.getDescription();
- wd.setAutoBuilding(false);
- workspace.setDescription(wd);
- } catch (CoreException ce) {
- //Logger.getLogger().logError(ce);
- }
- }
-
- /**
- * Turn auto-building on.
- *
- *
- * @since 1.0.0
- */
- public static void turnAutoBuildOn() {
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wd = workspace.getDescription();
- wd.setAutoBuilding(true);
- workspace.setDescription(wd);
- } catch (CoreException ce) {
- //Logger.getLogger().logError(ce);
- }
- }
-
- /**
- * Set the auto-building state.
- *
- * @param aBoolean
- * <code>true</code> to turn auto-building on.
- *
- * @since 1.0.0
- */
- public static void turnAutoBuildOn(boolean aBoolean) {
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wd = workspace.getDescription();
- wd.setAutoBuilding(aBoolean);
- workspace.setDescription(wd);
- } catch (CoreException ce) {
- //Logger.getLogger().logError(ce);
-
- }
- }
-
- /**
- * Adds a builder to the build spec for the given project.
- *
- * @param builderID
- * The id of the builder.
- * @param project
- * Project to add to.
- * @return whether the builder id was actually added (it may have already existed)
- * @throws CoreException
- * @since 1.0.0
- */
- public static boolean addToBuildSpec(String builderID, IProject project) throws CoreException {
- return addToBuildSpecBefore(builderID, null, project);
- }
-
- /**
- * Adds a builder to the build spec for the given project, immediately before the specified successor builder.
- *
- * @param builderID
- * The id of the builder.
- * @param successorID
- * The id to put the builder before.
- * @return whether the builder id was actually added (it may have already existed)
- * @throws CoreException
- * @since 1.0.0
- */
- public static boolean addToBuildSpecBefore(String builderID, String successorID, IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- ICommand[] commands = description.getBuildSpec();
- boolean found = false;
- for (int i = 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(builderID)) {
- found = true;
- break;
- }
- }
- if (!found) {
- boolean successorFound = false;
- ICommand command = description.newCommand();
- command.setBuilderName(builderID);
- ICommand[] newCommands = new ICommand[commands.length + 1];
- for (int j = 0, index = 0; j < commands.length; j++, index++) {
- if (successorID != null && commands[j].getBuilderName().equals(successorID)) {
- successorFound = true;
- newCommands[index++] = command;
- }
- newCommands[index] = commands[j];
- }
- if (!successorFound)
- newCommands[newCommands.length - 1] = command;
- description.setBuildSpec(newCommands);
- project.setDescription(description, null);
- }
- return !found;
- }
-
- /**
- * Remove the builder from the build spec.
- *
- * @param builderID
- * The id of the builder.
- * @param project
- * Project to remove from.
- * @return boolean if the builder id was found and removed
- * @throws CoreException
- * @since 1.0.0
- */
- public static boolean removeFromBuildSpec(String builderID, IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- ICommand[] commands = description.getBuildSpec();
- boolean found = false;
- for (int i = 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(builderID)) {
- found = true;
- break;
- }
- }
- if (found) {
- ICommand[] newCommands = new ICommand[commands.length - 1];
- int newCount = 0;
- for (int i = 0; i < commands.length; ++i) {
- if (!(commands[i].getBuilderName().equals(builderID))) {
- //Add the existng to the new array
- newCommands[newCount] = commands[i];
- newCount++;
- }
- }
-
- description.setBuildSpec(newCommands);
- project.setDescription(description, null);
-
- }
- return found;
-
- }
-
- /**
- * Ensure the container is not read-only.
- * <p>
- * For Linux, a Resource cannot be created in a ReadOnly folder. This is only necessary for new files.
- *
- * @param resource
- * workspace resource to make read/write
- * @since 1.0.0
- */
- public static void ensureContainerNotReadOnly(IResource resource) {
- if (resource != null && !resource.exists()) { //it must be new
- IContainer container = resource.getParent();
- while (container != null && !container.isReadOnly())
- container = container.getParent();
- if (container != null)
- container.setReadOnly(false);
- }
- }
-
- /**
- * Get projects from primary nature.
- *
- * @param natureID
- * @return All projects that have the given nature id as the first nature id.
- *
- * @since 1.0.0
- */
- public static IProject[] getProjectsForPrimaryNature(String natureID) {
- IProject[] projectsWithNature = new IProject[] {};
- List result = new ArrayList();
- IProject[] projects = getAllProjects();
- for (int i = 0; i < projects.length; i++) {
- if (isProjectPrimaryNature(projects[i], natureID))
- result.add(projects[i]);
- }
- return (IProject[]) result.toArray(projectsWithNature);
- }
-
- /**
- * Get all projects in the workspace
- *
- * @return all workspace projects
- *
- * @since 1.0.0
- */
- public static IProject[] getAllProjects() {
- return ResourcesPlugin.getWorkspace().getRoot().getProjects();
- }
-
- /**
- * Is this nature id the primary nature id for the project
- *
- * @param project
- * @param natureID
- * @return <code>true</code> if first nature id for the project.
- *
- * @since 1.0.0
- */
- public static boolean isProjectPrimaryNature(IProject project, String natureID) {
- String[] natures = null;
- try {
- natures = project.getDescription().getNatureIds();
- } catch (Exception e1) {
- }
- return (natures != null && natures.length > 0 && natures[0].equals(natureID));
- }
-
- protected static IPath createPath(IProject p, String defaultSourceName) {
- IPath path = new Path(p.getName());
- path = path.append(defaultSourceName);
- path = path.makeAbsolute();
- return path;
- }
-
- /**
- * Returns a list of existing files which will be modified if the classpath changes for the given proeject.
- *
- * @param p
- * project
- * @return list of affected files.
- *
- * @since 1.0.0
- */
- public static List getFilesAffectedByClasspathChange(IProject p) {
- List result = new ArrayList(2);
- addFileIfExists(p, result, DOT_CLASSPATH);
- addFileIfExists(p, result, DOT_PROJECT);
- return result;
- }
-
- protected static void addFileIfExists(IProject p, List aList, String filename) {
- IFile aFile = p.getFile(filename);
- if (aFile != null && aFile.exists())
- aList.add(aFile);
- }
-
- /**
- * Strip off a leading "/" from each project name in the array, if it has one.
- *
- * @param projecNames
- * @return array of project names with all leading '/' removed.
- *
- * @since 1.0.0
- */
- public static String[] getProjectNamesWithoutForwardSlash(String[] projecNames) {
- String[] projNames = new String[projecNames.length];
- List temp = java.util.Arrays.asList(projecNames);
- for (int i = 0; i < temp.size(); i++) {
- String name = (String) (temp.get(i));
- if (name.startsWith("/")) { //$NON-NLS-1$
- projNames[i] = name.substring(1, name.length());
- } else {
- projNames[i] = name;
- }
- }
- return projNames;
- }
-
- protected static URL createFileURL(IPath path) {
- try {
- return path.toFile().toURL();
- } catch (MalformedURLException e) {
- Logger.getLogger().log(e, Level.WARNING);
- return null;
- }
- }
-
- /**
- * Find first newObject that is not in the oldObjects array (using "==").
- *
- * @param oldObjects
- * @param newObjects
- * @return first newObject not found in oldObjects, or <code>null</code> if all found.
- *
- * @since 1.0.0
- */
- public static Object getNewObject(Object[] oldObjects, Object[] newObjects) {
- if (oldObjects != null && newObjects != null && oldObjects.length < newObjects.length) {
- for (int i = 0; i < newObjects.length; i++) {
- boolean found = false;
- Object object = newObjects[i];
- for (int j = 0; j < oldObjects.length; j++) {
- if (oldObjects[j] == object) {
- found = true;
- break;
- }
- }
- if (!found)
- return object;
- }
- }
- if (oldObjects == null && newObjects != null && newObjects.length == 1)
- return newObjects[0];
- return null;
- }
-
- /**
- * List of all files in the project.
- * <p>
- * Note: A more efficient way to do this is to use {@link IResource#accept(org.eclipse.core.resources.IResourceProxyVisitor, int)}
- *
- * @param 1.0.0
- * @return list of files in the project
- *
- * @see IResource#accept(org.eclipse.core.resources.IResourceProxyVisitor, int)
- * @since 1.0.0
- */
- public static List getAllProjectFiles(IProject project) {
- List result = new ArrayList();
- if (project == null)
- return result;
- try {
- result = collectFiles(project.members(), result);
- } catch (CoreException e) {
- }
- return result;
- }
-
- private static List collectFiles(IResource[] members, List result) throws CoreException {
- // recursively collect files for the given members
- for (int i = 0; i < members.length; i++) {
- IResource res = members[i];
- if (res instanceof IFolder) {
- collectFiles(((IFolder) res).members(), result);
- } else if (res instanceof IFile) {
- result.add(res);
- }
- }
- return result;
- }
-
- /**
- * Get the project.
- *
- * @param projectName
- * @return a IProject given the projectName
- * @since 1.0.0
- */
- public static IProject getProject(String projectName) {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- }
-
- /**
- * Return whether the given builder name is attached to the project.
- *
- * @param project
- * @param builderName
- * @return <code>true</code> if builder name is attached to the project.
- *
- * @since 1.0.0
- */
- public static boolean hasBuilder(IProject project, String builderName) {
- try {
- ICommand[] builders = project.getDescription().getBuildSpec();
- for (int i = 0; i < builders.length; i++) {
- ICommand builder = builders[i];
- if (builder != null) {
- if (builder.getBuilderName().equals(builderName))
- return true;
- }
- }
- } catch (Exception e) {
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceHandler.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceHandler.java
deleted file mode 100644
index 865a6c9..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ResourceHandler.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-/**
- * Implementers of this interface are provide extension capabilities on resource set. Such as looking or creating in other resource sets for a
- * resource or an EObject.
- *
- * @see org.eclipse.jem.util.emf.workbench.ProjectResourceSet#add(ResourceHandler)
- * @since 1.0.0
- */
-public interface ResourceHandler {
-
- /**
- * Each ResourceHandler for a WorkbenchContext (which holds a ProjectResourceSet) will get an oportunity to get the Resource given the uriString
- * prior to the originatingResourceSet getting it in the normal manner.
- *
- * If this handler loaded a Resource in its create(ResourceSet, uriString) then this method should be able to return it as well.
- *
- * @param originatingResourceSet
- * @param uri
- * @return resource if found or <code>nulll/code> if this handler didn't find it.
- *
- * @since 1.0.0
- */
- Resource getResource(ResourceSet originatingResourceSet, URI uri);
-
- /**
- * Get the EObject for the given URI, if it can. Load the resource if loadOnDemand is <code>true</code>.
- *
- * @param originatingResourceSet
- * @param uri
- * uri of EObject being requested
- * @param loadOnDemand
- * <code>true</code> if resource should be loaded
- * @return eobject if found or <code>null</code> if not.
- */
- EObject getEObjectFailed(ResourceSet originatingResourceSet, URI uri, boolean loadOnDemand);
-
- /**
- * Create the resource pointed to be the URI if this handler will handle it.
- *
- * @param originatingResourceSet
- * @param uri
- * @return resource if created, or <code>null</code> if handler doesn't handle this type.
- */
- Resource createResource(ResourceSet originatingResourceSet, URI uri);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceSetWorkbenchSynchronizer.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceSetWorkbenchSynchronizer.java
deleted file mode 100644
index 5f9398e..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/ResourceSetWorkbenchSynchronizer.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: ResourceSetWorkbenchSynchronizer.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-
-package org.eclipse.jem.util.emf.workbench;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import org.eclipse.jem.internal.util.emf.workbench.EMFWorkbenchContextFactory;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * Synchronizer on the workbench. It listens for the project to see if it is closed or deleted. If it does it notifies this out.
- *
- * @since 1.0.0
- */
-public class ResourceSetWorkbenchSynchronizer implements IResourceChangeListener {
-
- protected IProject project;
-
- protected ResourceSet resourceSet;
-
- /** Extenders that will be notified after a pre build resource change */
- protected List extenders;
-
- /** The delta for this project that will be broadcast to the extenders */
- protected IResourceDelta currentProjectDelta;
-
- private int currentEventType = -1;
-
- /**
- * Constructor taking a resource set and project.
- *
- * @param aResourceSet
- * @param aProject
- *
- * @since 1.0.0
- */
- public ResourceSetWorkbenchSynchronizer(ResourceSet aResourceSet, IProject aProject) {
- resourceSet = aResourceSet;
- project = aProject;
- if (aResourceSet != null && aResourceSet instanceof ProjectResourceSet)
- ((ProjectResourceSet) aResourceSet).setSynchronizer(this);
- initialize();
- }
-
- /**
- * Get the project for this synchronizer
- *
- * @return project
- *
- * @since 1.0.0
- */
- public IProject getProject() {
- return project;
- }
-
- /*
- * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- currentEventType = event.getType();
- currentProjectDelta = null;
- if ((currentEventType == IResourceChangeEvent.PRE_CLOSE || currentEventType == IResourceChangeEvent.PRE_DELETE)
- && event.getResource().equals(getProject())) {
- release();
- notifyExtendersOfClose();
- }
- }
-
- protected void notifyExtendersIfNecessary() {
- if (currentEventType != IResourceChangeEvent.POST_CHANGE || extenders == null || currentProjectDelta == null)
- return;
- for (int i = 0; i < extenders.size(); i++) {
- ISynchronizerExtender extender = (ISynchronizerExtender) extenders.get(i);
- extender.projectChanged(currentProjectDelta);
- }
- }
-
- protected void notifyExtendersOfClose() {
- if (extenders != null && !extenders.isEmpty()) {
- for (int i = 0; i < extenders.size(); i++) {
- ISynchronizerExtender extender = (ISynchronizerExtender) extenders.get(i);
- extender.projectClosed();
- }
- }
- }
-
- protected IWorkspace getWorkspace() {
- if (getProject() == null)
- return ResourcesPlugin.getWorkspace();
- return getProject().getWorkspace();
- }
-
- protected void initialize() {
- getWorkspace().addResourceChangeListener(this,
- IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD);
- }
-
- /**
- * Dispose of the synchronizer. Called when no longer needed.
- *
- *
- * @since 1.0.0
- */
- public void dispose() {
- getWorkspace().removeResourceChangeListener(this);
- }
-
- /**
- * The project is going away so we need to cleanup ourself and the ResourceSet.
- */
- protected void release() {
- if (JEMUtilPlugin.isActivated()) {
- try {
- if (resourceSet instanceof ProjectResourceSet)
- ((ProjectResourceSet) resourceSet).release();
- } finally {
- EMFWorkbenchContextFactory.INSTANCE.removeCachedProject(getProject());
- dispose();
- }
- }
- }
-
- /**
- * Add an extender to be notified of events.
- *
- * @param extender
- *
- * @since 1.0.0
- */
- public void addExtender(ISynchronizerExtender extender) {
- if (extenders == null)
- extenders = new ArrayList(3);
- extenders.add(extender);
- }
-
- /**
- * Remove extender from notification of events.
- *
- * @param extender
- *
- * @since 1.0.0
- */
- public void removeExtender(ISynchronizerExtender extender) {
- if (extenders == null)
- return;
- extenders.remove(extender);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return getClass().getName() + '(' + ((getProject() != null) ? getProject().getName() : "null") + ')'; //$NON-NLS-1$
- }
-
- /**
- * Tell Synchronizer that a file is about to be saved. This method should be called prior to writing to an IFile from an EMF resource.
- * <p>
- * Default does nothing, but subclasses can do something.
- * </p>
- *
- * @param aFile
- * file about to be saved.
- *
- * @since 1.0.0
- */
- public void preSave(IFile aFile) {
- //Default is do nothing
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchByteArrayOutputStream.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchByteArrayOutputStream.java
deleted file mode 100644
index 0fc25aa..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchByteArrayOutputStream.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkbenchByteArrayOutputStream.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-
-/**
- * ByteArray OutputStream for the Workbench. It works with the synchronizer {@link org.eclipse.jem.util.emf.workbench.ResourceSetWorkbenchSynchronizer}to
- * notify of a save. It also changes all of the line separators to the current system line separator, i.e. if there are some '\r' and we are on
- * Windows(R) then they will be converted to '\n\r'), if the setting for the stream is to do eol conversion.
- *
- * @since 1.0.0
- */
-public class WorkbenchByteArrayOutputStream extends URIConverterImpl.PlatformResourceOutputStream {
-
- private boolean fConvertEOL = false;
-
- protected ResourceSetWorkbenchSynchronizer synchronizer;
-
- /**
- * Construct with an IFile
- *
- * @param aFile
- *
- * @since 1.0.0
- */
- public WorkbenchByteArrayOutputStream(IFile aFile) {
- this(aFile, null);
- }
-
- /**
- * Construct with a IFile and a synchronizer. This way synchronizer will know when file is about to be saved.
- *
- * @param aFile
- * @param aSynchronizer
- *
- * @since 1.0.0
- */
- public WorkbenchByteArrayOutputStream(IFile aFile, ResourceSetWorkbenchSynchronizer aSynchronizer) {
- super(aFile, false, true, null);
- synchronizer = aSynchronizer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.OutputStream#close()
- */
- public void close() throws IOException {
- if (synchronizer != null)
- synchronizer.preSave(file);
- super.close();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.ecore.resource.impl.URIConverterImpl.PlatformResourceOutputStream#flush()
- */
- public void flush() throws IOException {
- if (synchronizer != null)
- synchronizer.preSave(file);
- super.flush();
- }
-
- /*
- * Convert the end of line characters.
- */
- private int convertEOL(byte[] data) {
- // Algorithm:
- // Remove all '\r' chars
- // Replace all '\n' chars with line seperator chars
-
- String EOL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$
- byte[] EOLBytes = EOL.getBytes();
-
- int out = 0;
-
- for (int in = 0; in < data.length; in++) {
- if (data[in] == '\r') {
- // don't output (ie, throw the char away)
- } else if (data[in] == '\n') {
- // The code does not currently handle expanding the array
- if ((in - out + 1) < EOLBytes.length)
- throw new UnsupportedOperationException("WorkbenchByteArrayOutputStream: Expanding EOL chars not implemented"); //$NON-NLS-1$
-
- for (int i = 0; i < EOLBytes.length; i++) {
- data[out++] = EOLBytes[i];
- }
- } else {
- // Just copy the data
- data[out++] = data[in];
- }
- }
-
- return out;
- }
-
- /**
- * Is EOL conversion turned on.
- *
- * @return <code>true</code> if EOL conversion is turned on.
- *
- * @since 1.0.0
- */
- public boolean isConvertEOLChars() {
- return fConvertEOL;
- }
-
- /**
- * Set the EOL conversion flag.
- *
- * @param set
- * <code>true</code> if EOL should be converted to current line separator.
- *
- * @since 1.0.0
- */
- public void setConvertEOLChars(boolean set) {
- fConvertEOL = set;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.ByteArrayOutputStream#toByteArray()
- */
- public synchronized byte[] toByteArray() {
- byte[] contents = super.toByteArray();
- if (isConvertEOLChars())
- convertEOL(contents);
- return contents;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchResourceHelperBase.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchResourceHelperBase.java
deleted file mode 100644
index c976061..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchResourceHelperBase.java
+++ /dev/null
@@ -1,648 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkbenchResourceHelperBase.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import java.util.*;
-
-import org.eclipse.core.internal.resources.ResourceException;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.*;
-import org.eclipse.emf.ecore.resource.*;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jem.internal.util.emf.workbench.EMFWorkbenchContextFactory;
-import org.eclipse.jem.internal.util.emf.workbench.WorkspaceResourceHandler;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * Workbench resource helper
- *
- * @since 1.0.0
- */
-public class WorkbenchResourceHelperBase {
-
- /**
- * Everything is static, don't know why there is an instance here.
- */
- public static final WorkbenchResourceHelperBase INSTANCE = new WorkbenchResourceHelperBase();
-
- protected static WorkspaceResourceHandler workspaceURILoader = new WorkspaceResourceHandler();
-
- protected static void resolveContainedProxies(EObject refObject) {
- List contained = refObject.eContents();
- EObject mofObject;
- for (int i = 0; i < contained.size(); i++) {
- mofObject = (EObject) contained.get(i);
- resolveProxies(mofObject);
- }
- }
-
- protected static void resolveNonContainedProxies(EObject refObject) {
- List references = refObject.eClass().getEAllReferences();
- EReference reference;
- for (int i = 0; i < references.size(); i++) {
- reference = (EReference) references.get(i);
- if (!reference.isContainment()) {
- if (reference.isMany()) {
- List value = (List) refObject.eGet(reference);
- for (int j = 0; j < value.size(); j++)
- value.get(j);
- } else {
- refObject.eGet(reference);
- }
- }
- }
- }
-
- /**
- * Force all of the proxies with <code>resource</code> to be resolved.
- *
- * @param resource
- *
- * @since 1.0.0
- */
- public static void resolveProxies(Resource resource) {
- if (resource != null) {
- List topLevels = resource.getContents();
- EObject mofObject;
- for (int i = 0; i < topLevels.size(); i++) {
- mofObject = (EObject) topLevels.get(i);
- resolveProxies(mofObject);
- }
- }
- }
-
- /**
- * Return a List of proxies that are contained by the <code>resource</code>.
- *
- * @param resource
- * @return list of proxies.
- *
- * @since 1.0.0
- */
- public static List gatherProxies(Resource resource) {
- if (resource == null)
- return Collections.EMPTY_LIST;
- List list = new ArrayList();
- List topLevels = resource.getContents();
- int size = topLevels.size();
- EObject mofObject;
- for (int i = 0; i < size; i++) {
- mofObject = (EObject) topLevels.get(i);
- gatherProxies((InternalEObject) mofObject, list);
- }
- return list;
- }
-
- protected static void gatherProxies(InternalEObject refObject, List proxies) {
- if (refObject == null)
- return;
- List contains = refObject.eClass().getEAllContainments();
- if (contains != null) {
- int size = contains.size();
- EStructuralFeature sf = null;
- for (int i = 0; i < size; i++) {
- sf = (EStructuralFeature) contains.get(i);
- gatherProxies(refObject, sf, proxies);
- }
- }
- }
-
- protected static void gatherProxies(InternalEObject refObject, EStructuralFeature sf, List proxies) {
- Object value = null;
- InternalEObject proxy = null;
- if (sf.isMany() || refObject.eIsSet(sf)) {
- value = refObject.eGet(sf, false);
- if (value != null) {
- if (sf.isMany()) {
- Iterator j = ((InternalEList) value).basicIterator();
- while (j.hasNext()) {
- proxy = (InternalEObject) j.next();
- if (proxy.eIsProxy())
- proxies.add(proxy);
- }
- } else if (((InternalEObject) value).eIsProxy())
- proxies.add(value);
- }
- }
- }
-
- protected static void resolveProxies(EObject refObject) {
- if (refObject != null) {
- resolveNonContainedProxies(refObject);
- resolveContainedProxies(refObject);
- }
- }
-
- /**
- * Return an existing context base on <code>aProject</code>.
- *
- * @param aProject
- * @return the context base for the project or <code>null</code> if none.
- *
- * @since 1.0.0
- */
- public static EMFWorkbenchContextBase getEMFContext(IProject aProject) {
- return EMFWorkbenchContextFactory.INSTANCE.getEMFContext(aProject);
- }
-
- /**
- * Create a resource from the URI. The URI must contain the project name, either as the first segment, or if in platform resource url protocol.
- * {@link #getResourceSet(URI)}
- *
- * @param uri
- * @return a new resource for the uri or <code>null</code> if not a project uri
- *
- * @since 1.0.0
- */
- public static Resource createResource(URI uri) {
- ResourceSet set = getResourceSet(uri);
- if (set != null)
- return set.createResource(uri);
- return null;
- }
-
- /**
- * Check for a cached Resource for the given URI, if none is found, create a new Resource for with the URI against the proper ResourceSet.
- *
- * @param uri
- * @return resource or <code>null</code> if not a project uri.
- *
- * @since 1.0.0
- */
- public static Resource getExistingOrCreateResource(URI uri) {
- return getExistingOrCreateResource(uri, getResourceSet(uri));
- }
-
- /**
- * Check for a cached Resource for the given URI, if none is found, create a new Resource for with the URI against the given ResourceSet.
- *
- * @param uri
- * @param set
- * @return resource or <code>null</code> if set was <code>null</code>.
- *
- * @since 1.0.0
- */
- public static Resource getExistingOrCreateResource(URI uri, ResourceSet set) {
- Resource res = null;
- if (set != null) {
- res = set.getResource(uri, false);
- if (res == null)
- res = set.createResource(uri);
- }
- return res;
- }
-
- /**
- * Return a new or existing context base on <code>aProject</code>. Allow the <code>contributor</code> to contribute to the new or existing
- * nature prior to returning.
- *
- * @param aProject
- * @param contributor
- * @return the context base for the project.
- *
- * @since 1.0.0
- */
- public static EMFWorkbenchContextBase createEMFContext(IProject aProject, IEMFContextContributor contributor) {
- return EMFWorkbenchContextFactory.INSTANCE.createEMFContext(aProject, contributor);
- }
-
- /**
- * Does the passed URI have the form platform:/resource/... ?
- *
- * @param uri
- * @return <code>true</code> if it is a platform resource protocol.
- *
- * @since 1.0.0
- */
- public static boolean isPlatformResourceURI(URI uri) {
- return JEMUtilPlugin.PLATFORM_PROTOCOL.equals(uri.scheme()) && JEMUtilPlugin.PLATFORM_RESOURCE.equals(uri.segment(0));
- }
-
- /**
- * This api may be used to cache a Resource if it has a URI that is Workspace relative. Return true if it is cached.
- *
- * @param aResource
- * @return <code>true</code> if it was successful to cache.
- *
- * @since 1.0.0
- */
- public static boolean cacheResource(Resource aResource) {
- if (aResource != null) {
- ResourceSet set = getResourceSet(aResource.getURI());
- if (set != null)
- return set.getResources().add(aResource);
- }
- return false;
- }
-
- /**
- * This api is used if you create a new MOF resource and you want to add it to the correct ResourceSet. In order to do that, we need the IProject
- * that you want aResource to be cached within as well as the IPath which is the full path of the location of the new Resource.
- *
- * @param aProject
- * @param aResource
- * @param fullPath
- * @return <code>true</code> if resource was cached.
- *
- * @since 1.0.0
- */
- public static boolean cacheResource(IProject aProject, Resource aResource, IPath fullPath) {
- if (aProject == null || aResource == null || !aProject.isAccessible())
- return false;
- ResourceSet set = getResourceSet(aProject);
- if (set != null) {
- URI converted = set.getURIConverter().normalize(aResource.getURI());
- if (converted != aResource.getURI())
- aResource.setURI(converted);
- return set.getResources().add(aResource);
- }
- return false;
- }
-
- /**
- * Get the path of the project resource relative to the workspace or relative to the list of containers in this project.
- *
- * @param aResource
- * @return path
- *
- * @since 1.0.0
- */
- public static String getActualProjectRelativeURI(IResource aResource) {
- if (aResource == null || !aResource.isAccessible())
- return null;
- IProject project = aResource.getProject();
- IPath path = getPathInProject(project, aResource.getFullPath());
- return path.makeRelative().toString();
- }
-
- /**
- * Return an IPath that can be used to load a Resource using the <code>fullPath</code>. This will be a project relative path.
- *
- * @param project
- * @param fullPath
- * @return path
- *
- * @since 1.0.0
- */
- public static IPath getPathInProject(IProject project, IPath fullPath) {
- List containers = getProjectURIConverterContainers(project);
- if (!containers.isEmpty())
- return getPathFromContainers(containers, fullPath);
- return fullPath;
- }
-
- protected static List getProjectURIConverterContainers(IProject project) {
- EMFWorkbenchContextBase nature = createEMFContext(project, null);
- if (nature != null) {
- WorkbenchURIConverter conv = (WorkbenchURIConverter) nature.getResourceSet().getURIConverter();
- if (conv != null)
- return conv.getInputContainers();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * If this path is contained within one of the listed containers, then return the path relative to the container.
- *
- * @param containers
- * @param fullPath
- * @return path relative to a container, or unchanged path if not in a container.
- *
- * @since 1.0.0
- */
- public static IPath getPathFromContainers(List containers, IPath fullPath) {
- IContainer container = null;
- IPath result;
- int size = containers.size();
- int matching = -1;
- IPath containerPath;
- for (int i = 0; i < size; i++) {
- container = (IContainer) containers.get(i);
- containerPath = container.getFullPath();
- matching = fullPath.matchingFirstSegments(containerPath);
- if (matching > 0 && matching == containerPath.segmentCount()) {
- result = fullPath.removeFirstSegments(matching);
- result = result.makeRelative();
- return result;
- }
- }
- return fullPath;
- }
-
- /**
- * Return true if the <code>uri</code> has its container segments visible from the input containers for the <code>project</code>.
- *
- * @param project
- * @param uri
- * @return <code>true</code> if the uri is visible from the input containers.
- *
- * @since 1.0.0
- */
- public static boolean hasContainerStructure(IProject project, URI uri) {
- if (project != null && uri != null) {
- IPath path = new Path(uri.toString());
- List containers = getProjectURIConverterContainers(project);
- int segmentCount = path.segmentCount();
- IPath containerPath = segmentCount > 1 ? path.removeLastSegments(1) : null;
- IContainer container = null;
- for (int i = 0; i < containers.size(); i++) {
- container = (IContainer) containers.get(i);
- if (!container.isAccessible())
- continue;
- if (segmentCount == 1) {
- if (container == project)
- return true;
- } else if (containerPath != null) {
- IFolder folder = container.getFolder(containerPath);
- if (folder != null && folder.isAccessible())
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Get the resource for the uri.
- *
- * @param uri
- * @return
- *
- * @since 1.0.0
- */
- public static Resource getResource(URI uri) {
- return workspaceURILoader.getResource(null, uri);
- }
-
- /**
- * Return the Resource for the passed IFile without forcing a load.
- *
- * @param aFile
- * @return
- *
- * @since 1.0.0
- */
- public static Resource getResource(IFile aFile) {
- return getResource(aFile, false);
- }
-
- /**
- * Return the Resource for the passed IFile, forcing a load if <code>loadOnDemand</code> says so.
- *
- * @param aFile
- * @param loadOnDemand
- * <code>true</code> will force a load of resource if not loaded.
- * @return
- *
- * @since 1.0.0
- */
- public static Resource getResource(IFile aFile, boolean loadOnDemand) {
- if (aFile != null)
- return getResource(URI.createPlatformResourceURI(aFile.getFullPath().toString()), loadOnDemand);
- return null;
- }
-
- /**
- * Return the Resource for the passed IFile without a load if not loaded.
- *
- * @param aFile
- * @return
- *
- * @since 1.0.0
- */
- public static Resource load(IFile aFile) {
- return getResource(aFile, true);
- }
-
- /**
- * This method will direct the getResource(URI, boolean) call to the correct ProjectResourceSet based on the project name in the URI.
- *
- * @param uri
- * This must be an absolute URI of the form platform:/resource/...
- * @param loadOnDemand
- * <code>true</code> will force the resource to be loaded if not already loaded.
- * @return Resource
- */
- public static Resource getResource(URI uri, boolean loadOnDemand) {
- ResourceSet set = getResourceSet(uri);
- if (set != null)
- return set.getResource(uri, loadOnDemand);
- return null;
- }
-
- /**
- * Return a ResourceSet for the passed URI. The URI should be in the format platform:/resource/{project name}/... or {project name}/... for this
- * api to work.
- *
- * @param uri
- * @return the resource set or <code>null</code> if not of correct form or project doesn't have a resource set.
- *
- * @since 1.0.0
- */
- public static ResourceSet getResourceSet(URI uri) {
- String projectName = null;
- if (isPlatformResourceURI(uri))
- projectName = uri.segment(1);
- else {
- projectName = new org.eclipse.core.runtime.Path(uri.path()).segment(0);
- } //assume project name is first in the URI
- IProject project = getWorkspace().getRoot().getProject(projectName);
- if (project != null && project.isAccessible())
- return getResourceSet(project);
- return null;
- }
-
- /**
- * Return the ResourceSet for the passed IProject.
- *
- * @param project
- * @return resource set
- */
- public static ResourceSet getResourceSet(IProject project) {
- EMFWorkbenchContextBase nat = createEMFContext(project, null);
- if (nat != null)
- return nat.getResourceSet();
- return null;
- }
-
- /**
- * Get the workspace. (just use {@link ResourcesPlugin#getWorkspace()}).
- *
- * @return
- *
- * @since 1.0.0
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Get the project associated with the resource set.
- *
- * @param set
- * @return project or <code>null</code> if resource set not associated with a project.
- *
- * @since 1.0.0
- */
- public static IProject getProject(ResourceSet set) {
- if (set != null) {
- if (set instanceof ProjectResourceSet) {
- ProjectResourceSet pset = (ProjectResourceSet) set;
- return pset.getProject();
- }
- }
- return null;
- }
-
- protected static boolean isRegisteredURIMapping(String href) {
- if (href != null) {
- String file = href;
- int index = href.indexOf('#');
- if (index > -1)
- file = href.substring(0, index);
- return URIConverter.URI_MAP.get(file) != null;
- }
- return false;
- }
-
- /**
- * Remove all of the resources from the resource set and then unload them. Unload forces all of the objects to become proxies so next resolve will
- * reload the resource.
- *
- * @param resources
- * @param aSet
- *
- * @since 1.0.0
- */
- public static void removeAndUnloadAll(List resources, ResourceSet aSet) {
- if (aSet == null || resources == null || resources.isEmpty())
- return;
- aSet.getResources().removeAll(resources);
- Resource res;
- for (int i = 0; i < resources.size(); i++) {
- res = (Resource) resources.get(i);
- res.unload();
- }
- }
-
- /**
- * Turn object into a proxy.
- *
- * @param anObject
- * @return <code>true</code> if object was able to become a proxy.
- *
- * @since 1.0.0
- */
- public static boolean becomeProxy(EObject anObject) {
- if (anObject != null) {
- Resource res = anObject.eResource();
- if (res != null) {
- URI uri = res.getURI();
- ((InternalEObject) anObject).eSetProxyURI(uri.appendFragment(res.getURIFragment(anObject)));
- //anObject.eAdapters().clear();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return true if the WrappedException is actually a Resource Not Found.
- *
- * @param wrappedEx
- * @return <code>true</code> is exception wrappers a resource not found.
- * @since 1.0.0
- */
- public static boolean isResourceNotFound(WrappedException wrappedEx) {
- Exception excep = wrappedEx.exception();
- while (excep instanceof WrappedException) {
- excep = ((WrappedException) excep).exception();
- }
- return primIsResourceNotFound(excep);
- }
-
- private static boolean primIsResourceNotFound(Exception excep) {
- if (excep instanceof ResourceException) {
- IStatus status = ((ResourceException) excep).getStatus();
- return status.getCode() == IResourceStatus.RESOURCE_NOT_FOUND;
- }
- return false;
- }
-
- /**
- * Return true if the WrappedException is actually a Resource Not Found.
- *
- * @param wrappedEx
- * @return <code>true</code> is exception wrappers a resource not found.
- * @since 1.0.0
- */
- public static boolean isResourceNotFound(Resource.IOWrappedException wrappedEx) {
- return primIsResourceNotFound(wrappedEx.getWrappedException());
- }
-
- /**
- * Return a URI represenation of the platformURI without the leading "platform:/resource/" if present.
- *
- * @param platformURI
- * @return uri
- * @since 1.0.0
- */
- public static URI getNonPlatformURI(URI platformURI) {
- if (isPlatformResourceURI(platformURI)) {
- String uriString = primGetNonPlatformURIString(platformURI);
- return URI.createURI(uriString);
- }
- return platformURI;
- }
-
- /**
- * Return a String represenation of the platformURI without the leading "platform:/resource/" if present.
- *
- * @param platformURI
- * @return
- * @since 1.0.0
- */
- public static String getNonPlatformURIString(URI platformURI) {
- if (isPlatformResourceURI(platformURI)) { return primGetNonPlatformURIString(platformURI); }
- return platformURI.toString();
- }
-
- /*
- * Remove "platform:/resource/" from the front of the platformURI and return the remaining String.
- */
- private static String primGetNonPlatformURIString(URI platformURI) {
- String uriString = platformURI.toString();
- //"platform:/resource/" is 19 characters.
- return uriString.substring(19, uriString.length());
- }
-
- /**
- * Does the passed URI have the form platform:/plugin/... ?
- *
- * @param uri
- * @return <code>true</code> if uri is platform plugin protocol.
- *
- * @since 1.0.0
- */
- public static boolean isPlatformPluginResourceURI(URI uri) {
- return JEMUtilPlugin.PLATFORM_PROTOCOL.equals(uri.scheme()) && JEMUtilPlugin.PLATFORM_PLUGIN.equals(uri.segment(0));
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverter.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverter.java
deleted file mode 100644
index e082d33..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverter.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkbenchURIConverter.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.ecore.resource.URIConverter;
-
-/**
- * Implementers of this interface are WorkbenchURI converters. Workbench URI converters handle references to files in the project's containers.
- * This converter is only necessary to resolve old ambiguous workbench URIs.
- * @since 1.0.0
- */
-public interface WorkbenchURIConverter extends URIConverter {
-
- /**
- * Add input container to to the converter.
- *
- * @param aContainer
- *
- * @since 1.0.0
- */
- void addInputContainer(IContainer aContainer);
-
- /**
- * Add list of containers to the converter.
- *
- * @param containers
- * list of <code>IContainer</code>
- *
- * @since 1.0.0
- */
- void addInputContainers(List containers);
-
- /**
- * Get the file relative to a container.
- *
- * @param uri
- * @return file relative to a container or <code>null</code> if not.
- *
- * @since 1.0.0
- */
- IFile getFile(String uri);
-
- /**
- * Get first input container
- *
- * @return first input container or <code>null</code> if none set.
- *
- * @since 1.0.0
- */
- IContainer getInputContainer();
-
- /**
- * Get all input containers.
- *
- * @return all input containers.
- *
- * @since 1.0.0
- */
- List getInputContainers();
-
- /**
- * Get the output container if set.
- *
- * @return output container or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- IContainer getOutputContainer();
-
- /**
- * Set the output container.
- *
- * @param container
- *
- * @since 1.0.0
- */
- void setOutputContainer(IContainer container);
-
- /**
- * Return an IFile for
- *
- * @aPath. If we have a parent and we do not contain the first segment of the aPath, forward to the parent to retrieve the file.
- * @param aPath
- * @return
- *
- * @since 1.0.0
- */
- IFile getOutputFile(IPath aPath);
-
- /**
- * Get output file with mapping applied.
- *
- * @param uri
- * @return
- *
- * @since 1.0.0
- */
- IFile getOutputFileWithMappingApplied(String uri);
-
- /**
- * Remove input container from list.
- *
- * @param aContainer
- * @return <code>true</code> if removed.
- *
- * @since 1.0.0
- */
- boolean removeInputContainer(IContainer aContainer);
-
- /**
- * Return true if we can retrieve the resource used to open an input stream on.
- *
- * @param aFileName
- * @return <code>true</code> if filename is valid for file stream access.
- * @since 1.0.0
- *
- */
- boolean canGetUnderlyingResource(String aFileName);
-
- /**
- * Is force save relative flag turned on.
- *
- * @return <code>true</code> if force save relative is turned on.
- *
- * @since 1.0.0
- */
- boolean isForceSaveRelative();
-
- /**
- * Set to true if you do not want any path manipulation when creating the output stream..
- *
- * @param forceSaveRelative
- * <code>true</code> to force saves as relative.
- */
- void setForceSaveRelative(boolean forceSaveRelative);
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverterImpl.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverterImpl.java
deleted file mode 100644
index 6a9f7f8..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/WorkbenchURIConverterImpl.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: WorkbenchURIConverterImpl.java,v $$
- * $$Revision: 1.2 $$ $$Date: 2005/01/26 16:40:52 $$
- */
-package org.eclipse.jem.util.emf.workbench;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * A default implementation of the WorkbenchURIConverter interface.
- *
- * @since 1.0.0
- */
-public class WorkbenchURIConverterImpl extends URIConverterImpl implements WorkbenchURIConverter {
-
- private final static IWorkspaceRoot WORKSPACE_ROOT = URIConverterImpl.workspaceRoot;
- private final static String WORKSPACE_ROOT_LOCATION = WORKSPACE_ROOT.getLocation().toString();
-
- private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$
-
- private static final IPath INVALID_PATH = new Path("!!!!~!!!!"); //$NON-NLS-1$
-
- private static final IFile INVALID_FILE = WORKSPACE_ROOT.getFile(INVALID_PATH.append(INVALID_PATH));
-
- //Used to avoid trying to fixup the URI when getting the
- //OutputStream
- protected boolean forceSaveRelative = false;
-
- protected List inputContainers;
-
- protected IContainer outputContainer;
-
- protected ResourceSetWorkbenchSynchronizer resourceSetSynchronizer;
-
- /*
- * KLUDGE: We need to know the meta data area. This is so that any uri that starts with the metadata directory
- * is considered a file uri and NOT a workspace uri. The metadata is where plugin's store their working data.
- * It is not part of the workspace root.
- *
- * There is no request for simply the metadata area. The log file is in the metadata directory. So we will
- * get the log file location and just remove the log file name. That should leave us with the metadata directory
- * only. If Eclipse ever decides to move it from here, this will no longer work. But it hasn't moved in three
- * versions.
- *
- * @since 1.1.0
- */
- static protected final String METADATA_LOCATION = Platform.getLogFileLocation().removeLastSegments(1).toString();
-
- /**
- * Default converter constructor, no containers.
- *
- *
- * @since 1.0.0
- */
- public WorkbenchURIConverterImpl() {
- super();
- }
-
- /**
- * Construct with an input container.
- *
- * @param anInputContainer
- *
- * @since 1.0.0
- */
- public WorkbenchURIConverterImpl(IContainer anInputContainer) {
- this(anInputContainer, (ResourceSetWorkbenchSynchronizer) null);
- }
-
- /**
- * Construct with an input container and a synchronzier.
- *
- * @param aContainer
- * @param aSynchronizer
- *
- * @since 1.0.0
- */
- public WorkbenchURIConverterImpl(IContainer aContainer, ResourceSetWorkbenchSynchronizer aSynchronizer) {
- this(aContainer, null, aSynchronizer);
- }
-
- /**
- * Construct with an input container and an output container.
- *
- * @param anInputContainer
- * @param anOutputContainer
- *
- * @since 1.0.0
- */
- public WorkbenchURIConverterImpl(IContainer anInputContainer, IContainer anOutputContainer) {
- this(anInputContainer, anOutputContainer, null);
- }
-
- /**
- * Construct with an input container, output container, and a synchronizer.
- *
- * @param anInputContainer
- * @param anOutputContainer
- * @param aSynchronizer
- *
- * @since 1.0.0
- */
- public WorkbenchURIConverterImpl(IContainer anInputContainer, IContainer anOutputContainer, ResourceSetWorkbenchSynchronizer aSynchronizer) {
- addInputContainer(anInputContainer);
- setOutputContainer(anOutputContainer);
- resourceSetSynchronizer = aSynchronizer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#addInputContainer(org.eclipse.core.resources.IContainer)
- */
- public void addInputContainer(IContainer aContainer) {
- if (aContainer != null && !getInputContainers().contains(aContainer))
- getInputContainers().add(aContainer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#addInputContainers(java.util.List)
- */
- public void addInputContainers(List containers) {
- for (int i = 0; i < containers.size(); i++) {
- addInputContainer((IContainer) containers.get(i));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#removeInputContainer(org.eclipse.core.resources.IContainer)
- */
- public boolean removeInputContainer(IContainer aContainer) {
- return getInputContainers().remove(aContainer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getInputContainers()
- */
- public List getInputContainers() {
- if (inputContainers == null)
- inputContainers = new ArrayList();
- return inputContainers;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getInputContainer()
- */
- public IContainer getInputContainer() {
- if (!getInputContainers().isEmpty())
- return (IContainer) getInputContainers().get(0);
- else
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getOutputContainer()
- */
- public IContainer getOutputContainer() {
- if (outputContainer == null)
- outputContainer = getInputContainer();
- return outputContainer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#setOutputContainer(org.eclipse.core.resources.IContainer)
- */
- public void setOutputContainer(IContainer newOutputContainer) {
- outputContainer = newOutputContainer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getOutputFile(org.eclipse.core.runtime.IPath)
- */
- public IFile getOutputFile(IPath aPath) {
- IFile file = null;
- if (getOutputContainer() != null) {
- if (forceSaveRelative)
- return primGetOutputFile(aPath);
- file = getOutputFileForPathWithContainerSegments(aPath);
- if (file != null)
- return file;
- else
- return primGetOutputFile(aPath);
- }
- return file;
- }
-
- protected IFile primGetOutputFile(IPath aPath) {
- return primGetFile(getOutputContainer(), aPath);
- }
-
- protected IFile getOutputFileForPathWithContainerSegments(IPath aPath) {
- IContainer out = getOutputContainer();
- return getFileForPathWithContainerSegments(aPath, out, false);
- }
-
- protected IFile getFileForPathWithContainerSegments(IPath aPath, IContainer container, boolean testExists) {
- IPath containerPath = null;
- IFile file = null;
- if (testExists) {
- containerPath = container.getProjectRelativePath();
- if (!containerPath.isEmpty()) {
- file = getFileForMatchingPath(aPath, containerPath, container);
- if (file != null && file.exists())
- return file;
- }
- }
- containerPath = container.getFullPath();
- file = getFileForMatchingPath(aPath, containerPath, container);
- return file;
- }
-
- protected IFile getFileForMatchingPath(IPath containerPath, IPath sourcePath, IContainer container) {
- int matches = 0;
- matches = containerPath.matchingFirstSegments(sourcePath);
- if (matches > 0 && matches == sourcePath.segmentCount()) {
- IPath loadPath = containerPath.removeFirstSegments(matches);
- return primGetFile(container, loadPath);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getFile(java.lang.String)
- */
- public IFile getFile(String uri) {
- return getFile(new Path(uri));
- }
-
- /**
- * Get the file from the path.
- *
- * @param path
- * @return
- * @see WorkbenchURIConverter#getFile(String)
- * @since 1.0.0
- */
- public IFile getFile(IPath path) {
- IFile file = null;
- if (getInputContainer() != null) {
- path = path.makeRelative();
- java.util.Iterator it = getInputContainers().iterator();
- while (it.hasNext()) {
- IContainer con = (IContainer) it.next();
- file = getInputFile(con, path);
- if (file != null && file.exists())
- return file;
- }
- }
- if (file == null)
- return INVALID_FILE;
- return file;
- }
-
- /**
- * Get output file from string path.
- *
- * @param uri
- * @return
- *
- * @see WorkbenchURIConverter#getOutputFile(IPath)
- * @since 1.0.0
- */
- public IFile getOutputFile(String uri) {
- return getOutputFile(new Path(uri));
- }
-
- /**
- * Get the input file from the container and path.
- *
- * @param con
- * @param path
- * @return
- *
- * @since 1.0.0
- */
- public IFile getInputFile(IContainer con, IPath path) {
- IFile file = null;
- if (WORKSPACE_ROOT.equals(con) && path.segmentCount() < 2)
- path = INVALID_PATH.append(path);
- file = primGetFile(con, path);
- if (file == null || !file.exists())
- file = getFileForPathWithContainerSegments(path, con, true);
- return file;
- }
-
- protected IFile primGetFile(IContainer container, IPath path) {
- try {
- return container.getFile(path);
- } catch (IllegalArgumentException ex) {
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#canGetUnderlyingResource(java.lang.String)
- */
- public boolean canGetUnderlyingResource(String aFileName) {
- IFile file = getFile(aFileName);
- return file != null && file.exists();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#isForceSaveRelative()
- */
- public boolean isForceSaveRelative() {
- return forceSaveRelative;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#setForceSaveRelative(boolean)
- */
- public void setForceSaveRelative(boolean forceSaveRelative) {
- this.forceSaveRelative = forceSaveRelative;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.ecore.resource.URIConverter#normalize(org.eclipse.emf.common.util.URI)
- */public URI normalize(URI uri) {
- URI result = uri;
- String fragment = null;
- if (uri.hasFragment()) {
- fragment = uri.fragment();
- result = uri.trimFragment();
- }
- result = getInternalURIMap().getURI(result);
- if (WorkbenchResourceHelperBase.isPlatformResourceURI(result))
- return appendFragment(result, fragment);
- if (WorkbenchResourceHelperBase.isPlatformPluginResourceURI(result)) {
- URI normalized = normalizePluginURI(result, fragment);
- return (normalized != null) ? normalized : uri;
- }
- String protocol = result.scheme();
- URI fileSearchURI = null;
- if (protocol == null) {
- fileSearchURI = normalizeEmptyProtocol(result, fragment);
- if (fileSearchURI != null)
- return fileSearchURI;
- } else if (FILE_PROTOCOL.equals(protocol)) {
- fileSearchURI = normalizeFileProtocol(result, fragment);
- if (fileSearchURI != null)
- return fileSearchURI;
- } else if (JEMUtilPlugin.WORKSPACE_PROTOCOL.equals(protocol))
- return normalizeWorkspaceProtocol(result, fragment);
- return super.normalize(uri);
- }
-
- /*
- * Resolves a plugin format into the actual.
- */
- protected URI normalizePluginURI(URI uri, String fragment) {
- if (uri.segmentCount() < 2)
- return uri; // Invalid, just let it go on.
- // See if already normalized.
- int u_scoreNdx = uri.segment(1).lastIndexOf('_');
- if (u_scoreNdx != -1) {
- // Not normalized. Remove the version to make it normalized.
- String[] segments = uri.segments();
- segments[1] = segments[1].substring(0, u_scoreNdx);
- return URI.createHierarchicalURI(uri.scheme(), uri.authority(), uri.device(), segments, uri.query(), fragment);
- } else
- return uri;
- }
-
- protected URI normalizeWorkspaceProtocol(URI aWorkspaceURI, String fragment) {
- URI result;
- String uriString = aWorkspaceURI.toString();
- uriString = uriString.substring(JEMUtilPlugin.WORKSPACE_PROTOCOL.length() + 1);
- result = URI.createPlatformResourceURI(uriString);
- if (fragment != null)
- result = appendFragment(aWorkspaceURI, fragment);
- return result;
- }
-
- protected URI normalizeEmptyProtocol(URI aFileUri, String fragment) {
- //Make the relative path absolute and return a platform URI.
- IPath path = new Path(aFileUri.toString());
- return normalizeToWorkspaceURI(path, fragment);
- }
-
- private URI normalizeToWorkspaceURI(IPath path, String fragment) {
- URI result = null;
- IFile file = getFile(path);
- if (file == null || !file.exists())
- file = getOutputFile(path);
- if (file != null) {
- result = URI.createPlatformResourceURI(file.getFullPath().toString());
- result = appendFragment(result, fragment);
- }
- return result;
- }
-
- protected URI normalizeFileProtocol(URI aFileUri, String fragment) {
- URI result = null;
- //Make the relative path absolute and return a platform URI.
- String devicePath = aFileUri.devicePath();
- //Test for workspace location.
- if (!devicePath.startsWith(METADATA_LOCATION) &&
- devicePath.startsWith(WORKSPACE_ROOT_LOCATION) && devicePath.length() > WORKSPACE_ROOT_LOCATION.length()) {
- //test for workspace location
- result = normalizeToWorkspaceURI(new Path(devicePath.substring(WORKSPACE_ROOT_LOCATION.length())), fragment);
- } else if (aFileUri.isRelative()) {
- result = normalizeToWorkspaceURI(new Path(aFileUri.toString()), fragment);
- } else {
- result = aFileUri;
- }
- return result;
- }
-
- protected URI appendFragment(URI result, String fragment) {
- if (fragment != null)
- return result.appendFragment(fragment);
- else
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter#getOutputFileWithMappingApplied(java.lang.String)
- */
- public IFile getOutputFileWithMappingApplied(String uri) {
- URI converted = getInternalURIMap().getURI(URI.createURI(uri));
- return getOutputFile(new Path(converted.toString()));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.ecore.resource.impl.URIConverterImpl#createPlatformResourceOutputStream(java.lang.String)
- */
- public OutputStream createPlatformResourceOutputStream(String platformResourcePath) throws IOException {
- IFile file = WORKSPACE_ROOT.getFile(new Path(platformResourcePath));
- ProjectUtilities.ensureContainerNotReadOnly(file);
- return new WorkbenchByteArrayOutputStream(file, resourceSetSynchronizer);
- }
-
- protected URI getContainerRelativeURI(IFile aFile) {
- IPath path = WorkbenchResourceHelperBase.getPathFromContainers(inputContainers, aFile.getFullPath());
- if (path != null)
- return URI.createURI(path.toString());
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.ecore.resource.impl.URIConverterImpl#createPlatformResourceInputStream(java.lang.String)
- */
- public InputStream createPlatformResourceInputStream(String platformResourcePath) throws IOException {
- IFile file = WORKSPACE_ROOT.getFile(new Path(platformResourcePath));
- try {
- if (!file.isLocal(IResource.DEPTH_ONE) || !file.isSynchronized(IResource.DEPTH_ONE)) {
- try {
- File iofile = file.getFullPath().toFile();
- if (iofile.exists() || file.exists())
- file.refreshLocal(IResource.DEPTH_ONE, null);
- } catch (CoreException ce) {
- if (ce.getStatus().getCode() != IResourceStatus.WORKSPACE_LOCKED)
- throw ce;
- }
- }
- return file.getContents();
- } catch (CoreException exception) {
- throw new Resource.IOWrappedException(exception);
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/nature/EMFNature.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/nature/EMFNature.java
deleted file mode 100644
index a34a2a4..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/emf/workbench/nature/EMFNature.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: EMFNature.java,v $$
- * $$Revision: 1.3 $$ $$Date: 2005/01/26 18:45:51 $$
- */
-package org.eclipse.jem.util.emf.workbench.nature;
-
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.common.util.*;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.xmi.XMLParserPool;
-import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
-
-import org.eclipse.jem.internal.util.emf.workbench.nature.EMFNatureRegistry;
-import org.eclipse.jem.util.emf.workbench.*;
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * The base EMFNature.
- * <p>
- * This is expected to be subclassed by clients, but there are default subclasses available.
- * </p>
- *
- * @since 1.0.0
- */
-public abstract class EMFNature implements IProjectNature, IEMFContextContributor {
-
- protected IProject project;
-
- protected EMFWorkbenchContextBase emfContext;
-
- protected boolean hasConfigured = false;
-
- public static XMLParserPool SHARED_PARSER_POOL = new XMLParserPoolImpl();
-
- public EMFNature() {
- super();
- }
-
- /**
- * Add the nature id to the project.
- *
- * @param proj
- * @param natureId
- * @throws CoreException
- *
- * @since 1.0.0
- */
- protected static void addNatureToProject(IProject proj, String natureId) throws CoreException {
- ProjectUtilities.addNatureToProject(proj, natureId);
- }
-
- /**
- * Configures the project with this nature. This is called by <code>IProject.addNature</code> and should not be called directly by clients. The
- * nature extension id is added to the list of natures on the project by <code>IProject.addNature</code>, and need not be added here.
- *
- * <p>
- * All subtypes must call super. The better way for subtypes is to override primConfigure instead.
- * </p>
- *
- * @throws CoreException
- * @since 1.0.0
- */
- public void configure() throws org.eclipse.core.runtime.CoreException {
- if (!hasConfigured) {
- hasConfigured = true;
- primConfigure();
- }
- }
-
- /**
- * Called from configure the first time configure is called on the nature. Default is do nothing. Subclasses should override and add in their own
- * configuration.
- *
- * @throws org.eclipse.core.runtime.CoreException
- *
- * @since 1.0.0
- */
- protected void primConfigure() throws org.eclipse.core.runtime.CoreException {
-
- }
-
- /**
- * Create an EMF context for the project.
- *
- * @throws CoreException
- *
- * @since 1.0.0
- */
- protected void createEmfContext() throws CoreException {
- WorkbenchResourceHelperBase.createEMFContext(getProject(), this);
- }
-
- /**
- * Create a folder relative to the project based on aProjectRelativePathString.
- *
- * @param aProjectRelativePathString
- * @return
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public IFolder createFolder(String aProjectRelativePathString) throws CoreException {
- if (aProjectRelativePathString != null && aProjectRelativePathString.length() > 0)
- return createFolder(new Path(aProjectRelativePathString));
- return null;
- }
-
- /**
- * Create a folder relative to the project based on aProjectRelativePathString.
- *
- * @param aProjectRelativePath
- * @return
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public IFolder createFolder(IPath aProjectRelativePath) throws CoreException {
- if (aProjectRelativePath != null && !aProjectRelativePath.isEmpty()) {
- IFolder folder = getWorkspace().getRoot().getFolder(getProjectPath().append(aProjectRelativePath));
- if (!folder.exists()) {
- ProjectUtilities.ensureContainerNotReadOnly(folder);
- folder.create(true, true, null);
- }
- return folder;
- }
- return null;
- }
-
- /**
- * Removes this nature from the project, performing any required deconfiguration. This is called by <code>IProject.removeNature</code> and
- * should not be called directly by clients. The nature id is removed from the list of natures on the project by
- * <code>IProject.removeNature</code>, and need not be removed here.
- *
- * @throws CoreException
- * @since 1.0.0
- */
- public void deconfigure() throws org.eclipse.core.runtime.CoreException {
- emfContext = null;
- }
-
- /**
- * Return true if the IFile with the given name exists in this project.
- *
- * @param aFileName
- * filename can be relative to one of the input file paths for the WorkbenchURIConverter.
- * @return <code>true</code> if filename exists in this project
- *
- * @since 1.0.0
- */
- public boolean fileExists(String aFileName) {
- if (aFileName == null)
- return false;
-
- IPath path = new Path(aFileName);
- if (path.isAbsolute())
- return ResourcesPlugin.getWorkspace().getRoot().getFile(path).exists();
- else
- return getWorkbenchURIConverter().canGetUnderlyingResource(aFileName);
- }
-
- /**
- * Get the resource set for the project
- *
- * @return
- *
- * @since 1.0.0
- */
- public ResourceSet getResourceSet() {
- return getEmfContextBase().getResourceSet();
- }
-
- /**
- * Returns the EMF root folder for the project. Defaults to the project. Subclasses can override.
- *
- * @return EMF root folder for the project.
- *
- * @since 1.0.0
- */
- public IContainer getEMFRoot() {
- return getProject();
- }
-
- /**
- * Used for optimizations; answers whether a mof context for this nature has exists yet
- *
- * @deprecated use hasResourceSet();
- * @since 1.0.0
- */
- public boolean hasContext() {
- return hasResourceSet();
- }
-
- /**
- * Is there a resource set yet for the project.
- *
- * @return <code>true</code> if there is a resource set for the project.
- *
- * @since 1.0.0
- */
- public boolean hasResourceSet() {
- return emfContext != null && emfContext.hasResourceSet();
- }
-
- /**
- * Lazy initializer; for migration of existing workspaces where configure will never get called.
- *
- * @return context base for the project.
- *
- * @since 1.0.0
- */
- protected EMFWorkbenchContextBase getEmfContextBase() {
- if (emfContext == null) {
- try {
- createEmfContext();
- } catch (CoreException ex) {
- Logger.getLogger().logError(ex);
- }
- }
- return emfContext;
- }
-
- /**
- * Get the IFile with the given name if it is in this project.
- *
- * @param aFileName
- * filename can be relative to one of the input file paths for the WorkbenchURIConverter.
- * @return file it it is in this project, or <code>null</code> if it doesn't.
- *
- * @since 1.0.0
- */
- public IFile getFile(String aFileName) {
- return getWorkbenchURIConverter().getFile(aFileName);
- }
-
- /**
- * Return the nature's ID.
- *
- * @return nature id
- *
- * @since 1.0.0
- */
- public abstract String getNatureID();
-
- /**
- * Return the ID of the plugin that this nature is contained within.
- *
- * @return
- *
- * @since 1.0.0
- */
- protected abstract String getPluginID();
-
- /**
- * Returns the project to which this project nature applies.
- *
- * @return the project handle
- * @since 1.0.0
- */
- public org.eclipse.core.resources.IProject getProject() {
- return project;
- }
-
- /**
- * Return the full path of the project.
- *
- * @return full project path (relative to workspace)
- * @since 1.0.0
- */
- public IPath getProjectPath() {
- return getProject().getFullPath();
- }
-
- /**
- * Get the server property of the project from the supplied key
- *
- * @param key
- * java.lang.String
- * @deprecated we cannont use persistent properties because they are not stored in the repository
- * @since 1.0.0
- */
- protected String getProjectServerValue(String key) {
- if (key == null)
- return null;
- try {
- QualifiedName wholeName = qualifiedKey(key);
- return getProject().getPersistentProperty(wholeName);
- } catch (CoreException exception) {
- //If we can't find it assume it is null
- exception.printStackTrace();
- return null;
- }
- }
-
- /**
- * Get WorkbenchURIConverter for this project.
- * <p>
- * This method assumes the URIConverter on the ResourceSet is the one that was created for the ResourceSet on behalf of this nature runtime.
- * </p>
- *
- * @return
- *
- * @since 1.0.0
- */
- protected WorkbenchURIConverter getWorkbenchURIConverter() {
- return (WorkbenchURIConverter) getResourceSet().getURIConverter();
- }
-
- public IWorkspace getWorkspace() {
- return getProject().getWorkspace();
- }
-
- /**
- * @deprecated use getResource(URI)
- */
- public Resource getXmiResource(String uri) {
- return getResource(URI.createURI(uri));
- }
-
- /**
- * Get the resource for this uri. It will use the resource set of the project to find it. It will load if not already loaded.
- *
- * @param uri
- * @return resource or <code>null</code> if resource is not found.
- *
- * @since 1.0.0
- */
- public Resource getResource(URI uri) {
- try {
- return getResourceSet().getResource(uri, true);
- } catch (WrappedException ex) {
- if (!WorkbenchResourceHelperBase.isResourceNotFound(ex))
- throw ex;
- }
- return null;
- }
-
- /**
- * @deprecated use getResourceSet()
- */
- public ResourceSet getXmiResourceSet() {
- return getResourceSet();
- }
-
- /**
- * Make sure that all dependent components are initialized before creating the ResourceSet.
- */
- protected void initializeDependentComponents() {
- //com.ibm.etools.java.init.JavaInit.init();
- }
-
- /**
- * @deprecated use createResource(URI)
- */
- public Resource makeXmiResource(String uri) {
- return createResource(URI.createURI(uri));
- }
-
- /**
- * @deprecated use createResource(URI)
- */
- public Resource makeXmiResource(String uri, EList anExtent) {
- Resource res = makeXmiResource(uri);
- if (res != null)
- res.getContents().addAll(anExtent);
- return res;
- }
-
- /**
- * Create the resource for this uri. It will use the resource set of the project to create it.
- *
- * @param uri
- * @return resource
- *
- * @since 1.0.0
- */
- public Resource createResource(URI uri) {
- return getResourceSet().createResource(uri);
- }
-
- /*
- * Return the QualifedValue for key for storage in the repository. The key is qualifed with the package name to avoid collision. @return
- * QualifedName @param key java.lang.String
- */
- private QualifiedName qualifiedKey(String key) {
- return new QualifiedName(getPluginID(), key);
- }
-
- /**
- * Register the given nature id as an EMFNature.
- *
- * @param natureID
- *
- * @since 1.0.0
- */
- public static void registerNatureID(String natureID) {
- EMFNatureRegistry.singleton().REGISTERED_NATURE_IDS.add(natureID);
- }
-
- /**
- * Sets the project to which this nature applies. Used when instantiating this project nature runtime. This is called by
- * <code>IProject.addNature</code> and should not be called directly by clients.
- *
- * @param project
- * the project to which this nature applies
- *
- * @since 1.0.0
- */
- public void setProject(org.eclipse.core.resources.IProject newProject) {
- project = newProject;
- }
-
- /**
- * Set the server property of the project from the supplied value
- *
- * @param key
- * java.lang.String
- * @param value
- * String
- * @deprecated we cannont use persistent properties because they are not stored in the repository
- */
- protected void setProjectServerValue(String key, String value) {
- if (key != null) {
- try {
- QualifiedName wholeName = qualifiedKey(key);
- getProject().setPersistentProperty(wholeName, value);
- } catch (CoreException exception) {
- //If we can't find it assume it is null
- exception.printStackTrace();
- return;
- }
- }
- }
-
- /**
- * Shutdown the EMF nature
- *
- *
- * @since 1.0.0
- */
- public void shutdown() {
- if (getResourceSet() != null)
- ((ProjectResourceSet) getResourceSet()).release();
- }
-
- /**
- * Return a list of EMFNatures based on the natures that have been configured for this project.
- *
- * @return List of EMFNatures
- * @param project
- * @return list of natures configured for the project.
- * @since 1.0.0
- */
- public static List getRegisteredRuntimes(IProject project) {
- List result = null;
- EMFNature nature = null;
- if (project != null && project.isAccessible()) {
- String natureID;
- Iterator it = EMFNatureRegistry.singleton().REGISTERED_NATURE_IDS.iterator();
- while (it.hasNext()) {
- natureID = (String) it.next();
- try {
- nature = (EMFNature) project.getNature(natureID);
- } catch (CoreException e) {
- }
- if (nature != null) {
- if (result == null)
- result = new ArrayList(2);
- result.add(nature);
- }
- }
- }
- return result == null ? Collections.EMPTY_LIST : result;
- }
-
- /**
- * Return a list of nature ids based on the natures that have been configured for this project.
- *
- * @return list of configured nature ids.
- * @param project
- */
- public static List getRegisteredRuntimeIDs(IProject project) {
- List result = null;
- String natureID = null;
- if (project != null && project.isAccessible()) {
- Iterator it = EMFNatureRegistry.singleton().REGISTERED_NATURE_IDS.iterator();
- while (it.hasNext()) {
- natureID = (String) it.next();
- try {
- if (project.hasNature(natureID)) {
- if (result == null)
- result = new ArrayList(2);
- result.add(natureID);
- }
- } catch (CoreException e) {
- }
- }
- }
- return result == null ? Collections.EMPTY_LIST : result;
- }
-
- /**
- * Return if the project has the given nature.
- *
- * @param project
- * @param natureId
- * @return <code>true</code> if project has given nature
- *
- * @since 1.0.0
- */
- public static boolean hasRuntime(IProject project, String natureId) {
- if (project == null || !project.isAccessible())
- return false;
- try {
- return project.hasNature(natureId);
- } catch (CoreException e) {
- return false;
- }
- }
-
- /**
- * Return if the project has any one of the possible given nature ids.
- *
- * @param project
- * @param possibleNatureIds
- * @return <code>true</code> if at least one of the possible natures id is configured for the project.
- *
- * @since 1.0.0
- */
- public static boolean hasRuntime(IProject project, String[] possibleNatureIds) {
- if (project != null) {
- for (int i = 0; i < possibleNatureIds.length; i++) {
- if (hasRuntime(project, possibleNatureIds[i]))
- return true;
- }
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/AbstractWorkBenchRenderer.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/AbstractWorkBenchRenderer.java
deleted file mode 100644
index 7d4d752..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/AbstractWorkBenchRenderer.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: AbstractWorkBenchRenderer.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxyrender;
-
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.util.logger.proxy.*;
-
-
-/**
- * Base log renderer that logs to the workbench.
- *
- * @since 1.1.0
- */
-public abstract class AbstractWorkBenchRenderer implements ILogRenderer2 {
-
- private boolean fTraceMode = false; // will we actually punch trace messaged or not
-
- private boolean fSettingTrace = false;
-
- protected Bundle fMyBundle = null;
-
- protected Logger fMyLogger = null;
-
- protected ILog fWorkBenchLogger = null;
-
- /**
- * Constructer taking a logger.
- *
- * @param logger
- *
- * @since 1.1.0
- */
- public AbstractWorkBenchRenderer(Logger logger) {
- super();
- fMyLogger = logger;
- fTraceMode = fMyLogger.getTraceMode();
-
- String pluginID = fMyLogger.getPluginID();
- fMyBundle = Platform.getBundle(pluginID);
- if (fMyBundle == null)
- throw new RuntimeException("Invalid Plugin ID"); //$NON-NLS-1$
-
- fWorkBenchLogger = Platform.getLog(fMyBundle);
- setTraceMode(fMyLogger.getTraceMode() || isDebugging(fMyBundle));
- fMyLogger.setRenderer(this);
- }
-
- /*
- * This used to come from the Plugin instance. But in new OSGi, there is not necessarily a Plugin instance. So use the same logic they use.
- */
- private boolean isDebugging(Bundle bundle) {
- String symbolicName = bundle.getSymbolicName();
- if (symbolicName != null) {
- String key = symbolicName + "/debug"; //$NON-NLS-1$
- String value = Platform.getDebugOption(key);
- return value == null ? false : value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- return false;
- }
-
- /**
- * Is the console log for eclipse turned on to sysout. If true, then we shouldn't log to console anything already logged because Eclipse would of
- * logged it for us. This comes from the -Declipse.consoleLog="true" which is the default when starting eclipse from PDE.
- */
- protected static final boolean consoleLogOn = "true".equals(System.getProperty(EclipseStarter.PROP_CONSOLE_LOG));
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer#setTraceMode(boolean)
- */
- public void setTraceMode(boolean flag) {
- if (fSettingTrace)
- return; // Do not allow cycles
-
- fSettingTrace = true;
- fTraceMode = flag;
- fMyLogger.setTraceMode(flag);
- fSettingTrace = false;
- }
-
- // The following methods are for historical renderers in case this has been subclassed outside
- // of util.
-
- /**
- * Log a string to the trace.
- *
- * @param param
- * @return
- *
- * @since 1.0.0
- */
- public abstract String log(String param);
-
- /**
- * Default one that log a string to the trace given a level. Default simply passes it to log(String) so that we don't break old subclasses.
- * <p>
- * If loggedToWorkbench is true, then it shouldn't be logged to console if consoleLogOn is true because workbench already logged to console.
- *
- * @param msg
- * @param l
- *
- * @since 1.0.0
- */
- protected void log(String msg, Level l, boolean loggedToWorkbench) {
- log(msg);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer#log(java.lang.String, int)
- */
- public String log(String msg, int type) {
-
- String target = logWorkBench(msg, type);
- if (fTraceMode || target.equals(NOLOG_DESCRIPTION))
- return log(msg);
- else
- return target;
- }
-
- /**
- * Log to workbench, a string of the given level <code>ILogRenderer.LOG_</code>. levels.
- *
- * @param msg
- * @param type
- * @return description of the log's destination e.g., <code>CONSOLE_DESCRIPTION</code>
- *
- * @see ILogRenderer#LOG_ERROR and all of the other log types.
- * @see ILogRenderer#CONSOLE_DESCRIPTION
- * @since 1.0.0
- */
- public String logWorkBench(String msg, int type) {
-
- try {
- int ErrCode;
- if (fWorkBenchLogger != null) {
- switch (type) {
- case (ILogRenderer.LOG_ERROR):
- ErrCode = IStatus.ERROR;
- break;
- case (ILogRenderer.LOG_WARNING):
- ErrCode = IStatus.WARNING;
- break;
- case (ILogRenderer.LOG_INFO):
- ErrCode = IStatus.INFO;
- break;
- case (ILogRenderer.LOG_TRACE):
- ErrCode = IStatus.OK;
- break;
- default:
- throw new RuntimeException("Invalid Log Type"); //$NON-NLS-1$
- }
- Status status = new Status(ErrCode, fMyBundle.getSymbolicName(), IStatus.OK, msg, null);
- fWorkBenchLogger.log(status);
- return WORKBENCH_DESCRIPTION;
- } else
- return NOLOG_DESCRIPTION;
- } catch (Throwable t) {
- return NOLOG_DESCRIPTION;
- }
- }
-
- // Default implentation of the ILogRenderer2 interface.
- protected boolean isLogging(Level level) {
- return fTraceMode || fMyLogger.isLoggingLevel(level);
- }
-
- private static final int[] STATUS_LEVEL;
-
- private static final Level[] STATUS_LEVEL_LOOKUP;
-
- private static final Level[] LEVEL_STATUS;
-
- static {
- // Status levels that correspond to the log levels, from finest to none, same indexes as from STATUS_LEVEL_LOOKUP.
- STATUS_LEVEL_LOOKUP = new Level[] { Level.INFO, Level.WARNING, Level.SEVERE};
- STATUS_LEVEL = new int[] { IStatus.INFO, IStatus.WARNING, IStatus.ERROR};
-
- // Levels that correspond to the IStatus levels.
- int maxID = Math.max(IStatus.OK, Math.max(IStatus.INFO, Math.max(IStatus.WARNING, IStatus.ERROR)));
- LEVEL_STATUS = new Level[maxID + 1];
- LEVEL_STATUS[IStatus.OK] = Level.FINE;
- LEVEL_STATUS[IStatus.INFO] = Level.INFO;
- LEVEL_STATUS[IStatus.WARNING] = Level.WARNING;
- LEVEL_STATUS[IStatus.ERROR] = Level.SEVERE;
- }
-
- /**
- * Return the Java Level for the status code from the given IStatus.
- *
- * @param status
- * @return the Java Level
- *
- * @since 1.0.0
- */
- protected Level getLogLevel(IStatus status) {
- return LEVEL_STATUS[status.getSeverity()];
- }
-
- /**
- * Return the IStatus status code for the given Java Level.
- *
- * @param logLevel
- * @return the IStatus status code.
- *
- * @since 1.0.0
- */
- protected int getStatusSeverity(Level logLevel) {
- for (int i = 0; i < STATUS_LEVEL_LOOKUP.length; i++) {
- if (STATUS_LEVEL_LOOKUP[i] == logLevel)
- return STATUS_LEVEL[i];
- }
- return IStatus.OK; // Default to ok.
- }
-
- /**
- * Log the string to the workbench for the given level
- *
- * @param msg
- * @param level
- * @return description of the log's destination e.g., <code>CONSOLE_DESCRIPTION</code>
- *
- * @since 1.1.0
- */
- protected String logWorkbench(String msg, Level level) {
- String result = NOLOG_DESCRIPTION;
- // Test again because we could be here simply due to trace mode, in which case we
- // don't want to workbench log it.
- if (fMyLogger.isLoggingLevel(level)) {
- Platform.getLog(fMyBundle).log(new Status(getStatusSeverity(level), fMyBundle.getSymbolicName(), 0, msg, null));
- result = WORKBENCH_DESCRIPTION;
- if (fTraceMode)
- log(msg, level, true);
- } else if (fTraceMode)
- log(msg, level, false);
- return result;
- }
-
- private String getStatusMsg(IStatus s, Level l) {
- if (s.getException() != null)
- return fMyLogger.getGenericMsg(s.toString() + fMyLogger.fLineSeperator + fMyLogger.exceptionToString(s.getException()), l);
- else
- return fMyLogger.getGenericMsg(s.toString(), l);
- }
-
- /**
- * Log the IStatus to the workbench at the given level.
- *
- * @param s
- * @param level
- * @return description of the log's destination e.g., <code>CONSOLE_DESCRIPTION</code>
- *
- * @since 1.0.0
- */
- protected String logWorkbench(IStatus s, Level level) {
- if (level == DEFAULT)
- level = getLogLevel(s);
- String result = NOLOG_DESCRIPTION;
- // Test again because we could be here simply due to trace mode, in which case we
- // don't want to workbench log it.
- if (fMyLogger.isLoggingLevel(level)) {
- Platform.getLog(fMyBundle).log(s);
- result = WORKBENCH_DESCRIPTION;
- if (fTraceMode)
- log(getStatusMsg(s, level), level, true);
- } else if (fTraceMode)
- log(getStatusMsg(s, level), level, false);
- return result;
- }
-
- /**
- * Log to the workbench the Throwable at the given level.
- *
- * @param t
- * @param level
- * @return description of the log's destination e.g., <code>CONSOLE_DESCRIPTION</code>
- *
- * @since 1.0.0
- */
- protected String logWorkbench(Throwable t, Level level) {
- String result = NOLOG_DESCRIPTION;
- // Test again because we could be here simply due to trace mode, in which case we
- // don't want to workbench log it.
- if (fMyLogger.isLoggingLevel(level)) {
- Platform.getLog(fMyBundle).log(new Status(getStatusSeverity(level), fMyBundle.getSymbolicName(), 0, "Exception thrown.", t));
- result = WORKBENCH_DESCRIPTION;
- if (fTraceMode)
- log(fMyLogger.getGenericMsg(fMyLogger.exceptionToString(t), level), level, true);
- } else if (fTraceMode)
- log(fMyLogger.getGenericMsg(fMyLogger.exceptionToString(t), level), level, false);
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(byte, java.util.logging.Level)
- */
- public String log(boolean b, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(b), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(byte, java.util.logging.Level)
- */
- public String log(byte b, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(b), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(char, java.util.logging.Level)
- */
- public String log(char c, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(c), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(double, java.util.logging.Level)
- */
- public String log(double d, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(d), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(float, java.util.logging.Level)
- */
- public String log(float f, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(f), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(int, java.util.logging.Level)
- */
- public String log(int i, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(i), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(long, java.util.logging.Level)
- */
- public String log(long l, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(l), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(java.lang.Object, java.util.logging.Level)
- */
- public String log(Object o, Level level) {
- if (o instanceof IStatus)
- return logWorkbench((IStatus) o, level);
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(o), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(short, java.util.logging.Level)
- */
- public String log(short s, Level level) {
- if (level == DEFAULT)
- level = Level.FINEST;
- if (isLogging(level))
- return logWorkbench(fMyLogger.getGenericMsg(String.valueOf(s), level), level);
- else
- return NOLOG_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxy.ILogRenderer2#log(java.lang.Throwable, java.util.logging.Level)
- */
- public String log(Throwable t, Level level) {
- if (t instanceof CoreException)
- return logWorkbench(((CoreException) t).getStatus(), level);
- if (level == DEFAULT)
- level = Level.SEVERE;
- if (isLogging(level)) {
- return logWorkbench(t, level);
- } else
- return NOLOG_DESCRIPTION;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/ConsoleLogRenderer.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/ConsoleLogRenderer.java
deleted file mode 100644
index 9c0b0d9..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/ConsoleLogRenderer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: ConsoleLogRenderer.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxyrender;
-
-import java.util.logging.Level;
-
-import org.eclipse.jem.util.logger.proxy.ILogRenderer;
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * Log renderer to the console.
- *
- * @since 1.0.0
- */
-public class ConsoleLogRenderer extends AbstractWorkBenchRenderer {
-
- /**
- * Constructor taking a logger.
- *
- * @param logger
- *
- * @since 1.0.0
- */
- public ConsoleLogRenderer(Logger logger) {
- super(logger);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxyrender.AbstractWorkBenchRenderer#log(java.lang.String)
- */
- public String log(String msg) {
-
- System.out.println(msg);
- return ILogRenderer.CONSOLE_DESCRIPTION;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxyrender.AbstractWorkBenchRenderer#log(java.lang.String, java.util.logging.Level, boolean)
- */
- protected void log(String msg, Level l, boolean loggedToWorkbench) {
- if (!loggedToWorkbench || !consoleLogOn) {
- if (l == Level.SEVERE)
- System.err.println(msg);
- else
- System.out.println(msg);
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/DefaultPluginTraceRenderer.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/DefaultPluginTraceRenderer.java
deleted file mode 100644
index 9fc927b..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/DefaultPluginTraceRenderer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: DefaultPluginTraceRenderer.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxyrender;
-
-import java.io.*;
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * Logger that also logs to a trace file in the plugin's metadata area.
- *
- * @since 1.0.0
- */
-public class DefaultPluginTraceRenderer extends AbstractWorkBenchRenderer {
-
- /**
- * Name of the trace file in the metadata area.
- *
- * @since 1.0.0
- */
- public static final String PluginTraceFileName = "/.log"; //$NON-NLS-1$
-
- private String fTraceFile = null;
-
- private PrintWriter traceFile = null;
-
- /**
- * DefaultUILogRenderer constructor.
- *
- * @param logger
- */
- public DefaultPluginTraceRenderer(Logger logger) {
- super(logger);
-
- fTraceFile = Platform.getStateLocation(fMyBundle).toString() + PluginTraceFileName;
- (new File(fTraceFile)).delete(); // Start from fresh ... do not want to leak on disk space
-
- }
-
- private void closeTraceFile() {
- if (traceFile == null)
- return;
- try {
- traceFile.flush();
- traceFile.close();
- } finally {
- traceFile = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxyrender.AbstractWorkBenchRenderer#log(java.lang.String)
- */
- public String log(String msg) {
-
- System.out.println(msg);
-
- openTraceFile();
- if (traceFile != null) {
- traceFile.println(msg);
- closeTraceFile();
- }
- return fTraceFile;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.logger.proxyrender.AbstractWorkBenchRenderer#log(java.lang.String, java.util.logging.Level, boolean)
- */
- protected void log(String msg, Level l, boolean loggedToWorkbench) {
- if (!loggedToWorkbench || !consoleLogOn) {
- if (l == Level.SEVERE)
- System.err.println(msg);
- else
- System.out.println(msg);
- }
-
- openTraceFile();
- if (traceFile != null) {
- traceFile.println(msg);
- closeTraceFile();
- }
- }
-
- private void openTraceFile() {
- try {
- traceFile = new PrintWriter(new FileOutputStream(fTraceFile, true));
- } catch (IOException e) {
- // there was a problem opening the log file so log to the console
- traceFile = null;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/EclipseLogger.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/EclipseLogger.java
deleted file mode 100644
index 8161a29..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/EclipseLogger.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: EclipseLogger.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxyrender;
-
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-
-/**
- * Get an Eclipse logger. This gets a logger that knows it is for a plugin.
- *
- * For each plugin, the following can be specified in the .option file:
- * {plugin-id}/debug/logTrace
- * The values valid for this are "true", "false", or "default". If true then loggers will be set into
- * trace mode. This means everything logged (even those that are filtered out due to not meeting log level)
- * will be traced out. If the value is "true" they will be traced to the system console.
- * If it is "default" or not set at all, then it will be the value in the "org.eclipse.jem.util/debug/logTrace" .options setting.
- * If not set there, then default value will be false.
- *
- * {plugin-id}/debug/logTraceFile
- * The values valid for this are "true", "false", or "default". If true then loggers will trace to
- * the system console AND to the ".log" file in the plugins work area in the metadata section of the workspace.
- * If "false" then not traced to a trace file.
- * If it is "default" or not set at all, then it will be the value in the "org.eclipse.jem.util/debug/logTraceFile" .options setting.
- * If not set there, then default value will be false.
- *
- * {plugin-id}.debug/logLevel
- * The values valid for this are the names from <code>java.util.logging.Level</code>, and "default". These
- * are the trace cutoff levels to use. For instance, if the level was SEVERE, then only level SEVERE msgs
- * are logged. The rest are skipped. Or if the level was WARNING, then only level SEVERE and WARNING are
- * logged.
- * If it is "default" or not set at all, then it will be the value in the "org.eclipse.jem.util/debug/logLevel" .options setting.
- * If not set there, then default value will be WARNING.
- *
- *
- * @since 1.0.0
- */
-public class EclipseLogger extends Logger {
-
- public static final String DEBUG_TRACE_OPTION = "/debug/logtrace"; //$NON-NLS-1$
- public static final String DEBUG_TRACE_FILE_OPTION = "/debug/logtracefile";
- public static final String DEBUG_LOG_LEVEL_OPTION = "/debug/loglevel"; // The logging level to use when no Hyaedes. (which we don't support at this time).
- public static final String DEFAULT_OPTION = "default"; // If option value is this, then the value from WTP Common plugin options will be used for both logTrace and logLevel.
-
- /**
- * Return a logger based upon the Plugin.
- * @param plugin
- * @return
- *
- * @since 1.0.0
- */
- public static Logger getEclipseLogger(Plugin plugin) {
- return getEclipseLogger(plugin.getBundle());
- }
-
- /**
- * Return a logger based upon the bundle.
- *
- * @param bundle
- * @return
- *
- * @since 1.0.0
- */
- public static Logger getEclipseLogger(Bundle bundle) {
- String id = bundle.getSymbolicName();
- Logger logger = getLoggerIfExists(id);
- if (logger != null)
- return logger;
-
- logger = getLogger(id); // Create one, we will now customize it.
-
- String pluginOption = Platform.getDebugOption(id + DEBUG_TRACE_OPTION);
- if (pluginOption == null || "default".equalsIgnoreCase(pluginOption))
- pluginOption = Platform.getDebugOption(JEMUtilPlugin.getDefault().getBundle().getSymbolicName() + DEBUG_TRACE_OPTION);
- boolean logTrace = "true".equalsIgnoreCase(pluginOption);
-
- pluginOption = Platform.getDebugOption(id + DEBUG_TRACE_FILE_OPTION);
- if (pluginOption == null || "default".equalsIgnoreCase(pluginOption))
- pluginOption = Platform.getDebugOption(JEMUtilPlugin.getDefault().getBundle().getSymbolicName() + DEBUG_TRACE_FILE_OPTION);
- boolean logTraceFile = "true".equalsIgnoreCase(pluginOption);
-
- pluginOption = Platform.getDebugOption(id + DEBUG_LOG_LEVEL_OPTION);
- if (pluginOption == null || "default".equalsIgnoreCase(pluginOption))
- pluginOption = Platform.getDebugOption(JEMUtilPlugin.getDefault().getBundle().getSymbolicName() + DEBUG_LOG_LEVEL_OPTION);
-
- Level logLevel = Level.WARNING;
- if (pluginOption != null) {
- try {
- logLevel = Level.parse(pluginOption);
- } catch (IllegalArgumentException e) {
- }
- }
-
- if (logTrace)
- logger.setTraceMode(true);
- logger.setLevel(logLevel);
- if (!logTraceFile)
- logger.setRenderer(new ConsoleLogRenderer(logger));
- else
- logger.setRenderer(new DefaultPluginTraceRenderer(logger));
-
- return logger;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/IMsgLogger.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/IMsgLogger.java
deleted file mode 100644
index 5f57eba..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/logger/proxyrender/IMsgLogger.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: IMsgLogger.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.jem.util.logger.proxyrender;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-/**
- * Interface for a message logger.
- *
- * @since 1.0.0
- */
-public interface IMsgLogger {
- public Logger getMsgLogger();
-}
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/plugin/JEMUtilPlugin.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/plugin/JEMUtilPlugin.java
deleted file mode 100644
index 55168d8..0000000
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/plugin/JEMUtilPlugin.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $$RCSfile: JEMUtilPlugin.java,v $$
- * $$Revision: 1.1 $$ $$Date: 2005/01/07 20:19:23 $$
- */
-package org.eclipse.jem.util.plugin;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl;
-import org.eclipse.jem.internal.util.emf.workbench.WorkspaceResourceNotifier;
-import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
-import org.eclipse.jem.util.emf.workbench.ResourceHandler;
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * Plugin for EMFWorkbench utils.
- *
- * @since 1.0.0
- */
-public class JEMUtilPlugin extends Plugin {
-
- public static final String ID = "org.eclipse.jem.util"; //$NON-NLS-1$
-
- /**
- * Plugin id of this plugin.
- *
- * @since 1.0.0
- */
- public static final String PLUGIN_ID = ID;
-
- /**
- * UI Context extension point.
- *
- * @since 1.0.0
- */
- public static final String UI_CONTEXT_EXTENSION_POINT = "uiContextSensitiveClass"; //$NON-NLS-1$
-
- /**
- * UITester element name.
- *
- * @since 1.0.0
- */
- public static final String UI_TESTER_EXTENSION_POINT = "uiTester"; //$NON-NLS-1$
-
- /**
- * Protocol for workspace
- *
- * @since 1.0.0
- */
- public static final String WORKSPACE_PROTOCOL = "workspace"; //$NON-NLS-1$
-
- /**
- * Protocol for platform uri's. i.e. "platform:/..."
- *
- * @since 1.0.0
- *
- */
- public static final String PLATFORM_PROTOCOL = "platform"; //$NON-NLS-1$
-
- /**
- * Resource indication in platform protocol. Indicates url is for a resource in the workspace. i.e. "platform:/resource/projectname/..."
- *
- * @since 1.0.0
- */
- public static final String PLATFORM_RESOURCE = "resource"; //$NON-NLS-1$
-
- /**
- * Plugin indication in platform protocol. Indicates url is for a file/directory in the plugins area. i.e. "platform:/plugin/pluginid/..."
- *
- * @since 1.0.0
- */
- public static final String PLATFORM_PLUGIN = "plugin"; //$NON-NLS-1$
-
- private static WorkspaceResourceNotifier sharedCache;
-
- private static ResourceSet pluginResourceSet;
-
- private static String[] GLOBAL_LOADING_PLUGIN_NAMES;
-
- private static JEMUtilPlugin DEFAULT;
-
- public JEMUtilPlugin() {
- super();
- DEFAULT = this;
- }
-
- /**
- * Get the workspace. Just use ResourcePlugin.getWorkspace() instead.
- *
- * @return
- *
- * @since 1.0.0
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Get the plugin instance.
- *
- * @return plugin instance.
- *
- * @since 1.0.0
- */
- public static JEMUtilPlugin getDefault() {
- return DEFAULT;
- }
-
- /**
- * Gets the sharedCache.
- * <p>
- * This is not meant to be called by clients.
- * </p>
- *
- * @return a WorkspaceResourceNotifier
- * @since 1.0.0
- */
- public static WorkspaceResourceNotifier getSharedCache() {
- if (sharedCache == null)
- sharedCache = new WorkspaceResourceNotifier();
- return sharedCache;
- }
-
- /**
- * Sets the sharedCache.
- * <p>
- * This is not meant to be called by clients.
- * </p>
- *
- * @param sharedCache
- * The sharedCache to set
- * @since 1.0.0
- */
- public static void setSharedCache(WorkspaceResourceNotifier aSharedCache) {
- sharedCache = aSharedCache;
- }
-
- /**
- * @deprecated use createIsolatedResourceSet(IProject)
- */
- public static ResourceSet createIsolatedResourceSet() {
- return null;
- }
-
- /**
- * Add an Adapter. You can use this api to listen for any shared resource being loaded or removed from any ProjectResourceSet in the Workbench
- * instead of trying to listen to each individual ProjectResourceSet.
- *
- * @param adapter
- *
- * @since 1.0.0
- */
- public static void addWorkspaceEMFResourceListener(Adapter adapter) {
- if (adapter != null && !getSharedCache().eAdapters().contains(adapter))
- getSharedCache().eAdapters().add(adapter);
- }
-
- /**
- * Removes the adapter.
- *
- * @param adapter
- *
- * @see #addWorkspaceEMFResourceListener(Adapter)
- * @since 1.0.0
- */
- public static void removeWorkspaceEMFResourceListener(Adapter adapter) {
- if (adapter != null)
- getSharedCache().eAdapters().remove(adapter);
- }
-
- /**
- * Is this plugin active.
- *
- * @return <code>true</code> if active
- *
- * @since 1.0.0
- */
- public static boolean isActivated() {
- Bundle bundle = Platform.getBundle(ID);
- if (bundle != null)
- return bundle.getState() == Bundle.ACTIVE;
- return false;
- }
-
- /**
- * This method will be called when a WorkbenchContext is instantiated on an EMFNature.
- * <p>
- * This not meant to be called by clients.
- * </p>
- *
- * @param aResourceSet
- *
- * @see plugin.xml#ResourceHandlerExtension extension point.
- * @since 1.0.0
- */
- public void addExtendedResourceHandlers(ProjectResourceSet aResourceSet) {
- if (aResourceSet == null)
- return;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint pct = registry.getExtensionPoint(getBundle().getSymbolicName(), "ResourceHandlerExtension"); //$NON-NLS-1$
- IExtension[] extension = pct.getExtensions();
- IExtension config;
- for (int l = 0; l < extension.length; ++l) {
- config = extension[l];
- IConfigurationElement[] cElems = config.getConfigurationElements();
- ResourceHandler handler = null;
- for (int i = 0; i < cElems.length; i++) {
- try {
- handler = (ResourceHandler) cElems[i].createExecutableExtension("run"); //$NON-NLS-1$
-
- } catch (Exception ex) {
- handler = null;
- }
- if (handler != null)
- aResourceSet.add(handler);
- }
- }
- }
-
- /**
- * Get the project resource set for the plugin (there is one for the whole system).
- *
- * @return system-wide resource set.
- * @since 1.0.0
- */
- public static ResourceSet getPluginResourceSet() {
- if (pluginResourceSet == null)
- pluginResourceSet = new ProjectResourceSetImpl(null);
- return pluginResourceSet;
- }
-
- /**
- * Set the system-wide resource set.
- *
- * @param set
- * @since 1.0.0
- */
- public static void setPluginResourceSet(ResourceSet set) {
- pluginResourceSet = set;
- }
-
- /**
- * Get the global loading plugin names.
- * <p>
- * This is not meant to be called by clients.
- * </p>
- *
- * @return
- *
- * @since 1.0.0
- */
- public static String[] getGlobalLoadingPluginNames() {
- if (GLOBAL_LOADING_PLUGIN_NAMES == null)
- GLOBAL_LOADING_PLUGIN_NAMES = readGlobalLoadingPluginNames();
- return GLOBAL_LOADING_PLUGIN_NAMES;
- }
-
- /**
- * Get the Logger for this plugin.
- *
- * @return logger for this plugin.
- *
- * @since 1.0.0
- */
- public static Logger getLogger() {
- return Logger.getLogger(ID);
- }
-
- private static String[] readGlobalLoadingPluginNames() {
- IExtensionRegistry reg = Platform.getExtensionRegistry();
- IExtensionPoint exPoint = reg.getExtensionPoint(ID, "globalPluginResourceLoad"); //$NON-NLS-1$
- IExtension[] extensions = exPoint.getExtensions();
- String[] names = new String[extensions.length];
- if (extensions.length > 0) {
- for (int i = 0; i < extensions.length; i++)
- names[i] = extensions[i].getNamespace();
- }
- return names;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.classpath b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.cvsignore b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.project b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.project
deleted file mode 100644
index 5e29c82..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.perfmsr.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/about.html b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/about.html
deleted file mode 100644
index 4abaeab..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/about.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>30th March, 2004</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, "Program" will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or
-other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-<p><b>Version:</b> v20040624a
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/build.properties b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/build.properties
deleted file mode 100644
index c06d260..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- *.jar
-source.perfmsr.jar = src/
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.properties b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.properties
deleted file mode 100644
index 5ad8edc..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-Plugin.name=Performance Monitor
-
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.xml b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.xml
deleted file mode 100644
index 596926d..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/plugin.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.perfmsr.core"
- name="%Plugin.name"
- version="3.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.perfmsr.core.PerfMsrCorePlugin">
-
- <runtime>
- <library name="perfmsr.jar"><export name="*"/></library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-</plugin>
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/IPerformanceMonitor.java b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/IPerformanceMonitor.java
deleted file mode 100644
index dab5357..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/IPerformanceMonitor.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.perfmsr.core;
-
-/**
- * Take snapshots of the various performance counters.
- * ************* This is just a stub of the real interface to get org.eclipse.jem.util
- * to compile. It is not usable by itself. ****************************
- */
-public interface IPerformanceMonitor
-{
- /**
- * These constants control how much information is gathered for a particular snapshot.
- * They are or'ed together and passed into the snapshot method.
- */
- interface Types
- {
- /**
- * 1 - Write out the performance counters from the operating system. These
- * include working set, peak working set, elapsed time, user time, and
- * kernel time.
- */
- int OperatingSystemCounters = 1;
-
- /**
- * 2 - Write out the global performance info. This includes things like the total
- * committed memory for the entire system.
- *
- * This function depends on the GetPerformanceInfo() function being available in
- * the Windows psapi.dll. This is available in XP but is usually not available
- * in Win/2000. If it is not available then this function throws an UnsupportedOperationException.
- */
- int GlobalSystemCounters = 2;
-
- /**
- * 4 - Write out the size of the Java Heap.
- */
- int JavaHeapSize = 4;
-
- /**
- * 8 - Write out how much of the Java heap is being used. This calls the
- * garbage collector so it may skew timing results.
- */
- int JavaHeapUsed = 8;
-
- /**
- * 16 - The plugin startup and size information.
- */
- int PluginInfo = 16;
-
- /** 0xffff - Everything. */
- int All = 0xffff;
- }
-
- /**
- * Add some more "extra" variations.
- *
- * The variations that are in effect are made up of these extra variations plus any variations
- * that may have been set with the setVar() method.
- *
- * @param varList a comma separated list of variations
- */
- public void addVarAppend(String varList);
-
- /**
- * Set the driver name.
- *
- * @param driver a label that identifies the driver that is being tested. If it is a WSAD
- * driver, this will usually be set by the extension.
- */
- public void setDriver(String driver);
-
- /**
- * Set the location of the performance measurement file, that is the place where
- * the measurements are stored.
- *
- * @param logFile the file name of where the log should be written. Usually this is fully qualified
- * path name. For example "x:\logs\timer.xml".
- */
- public void setLogFile(String logFile);
-
- /**
- * Set the performance monitor to be on or off. If it is off then most of the other
- * operations will no-op.
- *
- * The default is for the performance monitor to be off unless it's special environment variable is set.
- * When called from the UI, the UI should call this to make sure that it is on.
- */
- public void setIsOn(boolean isOn);
-
- /**
- * Sets the test case number for this measurement run.
- *
- * @param testd test case identifier
- */
- public void setTestd(int testd);
-
- /**
- * Sets the test case name. If will cause a new test case to be created if it does not already exist.
- *
- * @param testName a simple (short) test case name. In the case of JUnit test cases, it would usually
- * be the JUnit name.
- */
- public void setTestName(String testName);
-
- /**
- * Set the variations that are in effect.
- *
- * @param var a comma delimited string of variation numbers
- */
- public void setVar(String var);
-
- /**
- * Set the upload host
- *
- * @param host DNS name of the upload host
- */
- public void setUploadHost(String host);
-
- /**
- * Set the upload port
- *
- * @param port upload port
- */
- public void setUploadPort(int port);
-
- /**
- * Set the upload userid
- *
- * @param userid
- */
- public void setUploadUserid(String userid);
-
- /**
- * Take a snapshot of some default performance measurements.
- *
- * @param step this identifies the step that the snapshot is for
- */
- void snapshot(int step);
-
- /**
- * Take a snapshot of the selected performance measurements.
- *
- * @param step this identifies the step that the snapshot is for
- *
- * @param types This controls which measurements are selected. It is an or'd together
- * list of the IPerformanceMonitor.Types constants.
- *
- * @see IPerformanceMonitor.Types
- */
- void snapshot(int step, int types);
-
- /**
- * Write the comment to the performance measurement file.
- *
- * @param comment
- */
- void writeComment(String comment);
-
- /**
- * Upload the results to the server. This causes the file to be
- * closed, and the monitor to be placed into the finished state.
- *
- * This method can only be called if the uploadhost, uploadport and uploaduserid
- * have been configured before hand.
- *
- * @param description an optional description (it can be null)
- *
- * @return some status information
- */
- public Upload.Status upload(String description);
-//
-// /**
-// * Upload the results to the server. This causes the file to be
-// * closed, and the monitor to be placed into the finished state.
-// *
-// * @param host the host name that the file is being sent to
-// * @param port the port on the host
-// * @param userid the userid that is doing the upload
-// * @param description an optional description (it can be null)
-// *
-// * @return some status information
-// */
-// Upload.Status upload(String host, int port, String userid, String description);
-
-
-}
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/PerfMsrCorePlugin.java b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/PerfMsrCorePlugin.java
deleted file mode 100644
index e234a33..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/PerfMsrCorePlugin.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: PerfMsrCorePlugin.java,v $
- * $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
- */
-package org.eclipse.perfmsr.core;
-
-import org.eclipse.core.runtime.Plugin;
-
-
-/**
- * ************* This is just a stub of the real class to get org.eclipse.jem.util
- * to compile. It is not usable by itself. ****************************
- * @since 1.0.0
- */
-public class PerfMsrCorePlugin extends Plugin {
-
- public static IPerformanceMonitor getPerformanceMonitor(boolean bool) {
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/Upload.java b/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/Upload.java
deleted file mode 100644
index 730743c..0000000
--- a/plugins/org.eclipse.jem.util/org.eclipse.perfmsr.core.stub/src/org/eclipse/perfmsr/core/Upload.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * $RCSfile: Upload.java,v $
- * $Revision: 1.1 $ $Date: 2005/02/04 00:49:08 $
- */
-package org.eclipse.perfmsr.core;
-
-
-/**
- * Upload.
- * ************* This is just a stub of the real interface to get org.eclipse.jem.util
- * to compile. It is not usable by itself. ****************************
- */
-public interface Upload {
- public static class Status {
- public boolean success;
- }
-}
diff --git a/plugins/org.eclipse.jem.util/plugin.properties b/plugins/org.eclipse.jem.util/plugin.properties
deleted file mode 100644
index 3d68bc7..0000000
--- a/plugins/org.eclipse.jem.util/plugin.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#
-# $Source: /cvsroot/webtools/common.move/webtools.common.git/plugins/org.eclipse.jem.util/plugin.properties,v $
-# $Revision: 1.1 $ $Date: 2005/01/07 20:19:23 $
-#
-
-
-pluginName=Java EMF Model Utilities
-providerName = Eclipse.org
diff --git a/plugins/org.eclipse.jem.util/plugin.xml b/plugins/org.eclipse.jem.util/plugin.xml
deleted file mode 100644
index 0eef4ea..0000000
--- a/plugins/org.eclipse.jem.util/plugin.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jem.util"
- name="%pluginName"
- version="1.1.0"
- provider-name="%providerName"
- class="org.eclipse.jem.util.plugin.JEMUtilPlugin">
-
- <runtime>
- <library name="util.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.emf.ecore.xmi"/>
- <import plugin="org.eclipse.jdt.core" optional="true"/>
- <import plugin="org.eclipse.perfmsr.core" optional="true"/>
- </requires>
-
-<!-- Extension point to register ResourceHandlers that will always be added to
- new WorkbenchContexts -->
- <extension-point id="ResourceHandlerExtension" name="ResourceHandlerExtension"/>
- <extension-point id="globalPluginResourceLoad" name="Global Plugin Resource Load"/>
- <extension-point id="nature_registration" name="EMF Nature registration"/>
- <extension-point id="internalWorkbenchContextFactory" name="Internal Workbench Context Factory"/>
- <extension-point id="uiContextSensitiveClass" name="UI Context Sensitive Class" schema="schema/uiContextSensitiveClass.exsd"/>
- <extension-point id="uiTester" name="UI Tester" schema="schema/uiTester.exsd"/>
-
-</plugin>
diff --git a/plugins/org.eclipse.jem.util/property_files/emfworkbench.properties b/plugins/org.eclipse.jem.util/property_files/emfworkbench.properties
deleted file mode 100644
index eb62f66..0000000
--- a/plugins/org.eclipse.jem.util/property_files/emfworkbench.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-Cannot_Create_Resource_ERROR_=IWAE0001E Cannot create a resource for \" {0} \"
-Unable_to_save_read-only_f_ERROR_=IWAE0004E Unable to save read-only file: {0}
-The_following_resources_ne_UI_=The following resources need to be saved but are currently shared, do you want to save now?
-An_error_occurred_while_sa_ERROR_=IWAE0002E An error occurred while saving.
-EMFWorkbenchContextBase_ERROR_0=IWAE0003E Method not yet implemented.
-EMFWorkbenchContextBase_ERROR_1=IWAE0005E Project can not be null.
-EMFWorkbenchContextBase_ERROR_2=IWAE0006E Attempt to create resource set with null project
-EMFNatureRegistry_ERROR_0=IWAE0007E Duplicate EMF nature registration for id: {0}
-EMFWorkbenchContextFactory_UI_0=The project should not be null.
-EMFWorkbenchContextFactory_UI_1=The project \"{0}\" is not accessible.
-PleaseMigrateYourCodeError_ERROR_0=IWAE0008E Your source code uses obsolete methods. Please consult \n the design documents for guidelines on how to migrating \n your current source code.
-EMF2DOMAdapterImpl_ERROR_0=IWAE0009E Multiple elements exist where only 1 is expected. Node name: {0};
diff --git a/plugins/org.eclipse.jem.util/schema/uiContextSensitiveClass.exsd b/plugins/org.eclipse.jem.util/schema/uiContextSensitiveClass.exsd
deleted file mode 100644
index 7bcbfeb..0000000
--- a/plugins/org.eclipse.jem.util/schema/uiContextSensitiveClass.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jem.util">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jem.util" id="uiContextSensitiveClass" name="UI Context Sensitive Class"/>
- </appInfo>
- <documentation>
- Edit models provide a framework for managing a set of EMF resources within a unit of work. For example, a workspace operation may affect a change to multiple EMF resources. Edit models provide basic services such as loads, saves (when necessary), and validate edit for the managed resources. Edit models are reference counted, therefore a single instance of an edit model can be shared by more than one operation or editor. By declaring an edit model, a plugin provider enables other components to contribute resources to be managed by that edit model.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="uiContextSensitiveClass" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="uiContextSensitiveClass">
- <annotation>
- <documentation>
- An extension point that defines an instance of a class and its appropriate context (UI or Headless)
- </documentation>
- </annotation>
- <complexType>
- <attribute name="key" type="string" use="required">
- <annotation>
- <documentation>
- The key that should be used to create an instance of the Context Sensitive super class/interface.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- A concrete implementation for either a UI or Headless context.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="context" use="required">
- <annotation>
- <documentation>
- One of "UI" or "Headless"
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="UI">
- </enumeration>
- <enumeration value="Headless">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- <br>
-&nbsp;&nbsp;&nbsp;&lt;extension<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id="context.Sensitive.Class.workingCopyManager"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name="Working&nbsp;Copy&nbsp;Manager&nbsp;-&nbsp;UI&nbsp;Context&nbsp;Class"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point="com.ibm.wtp.common.ui.ContextSensitiveClass"&gt;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;uiContextSensitiveClass<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context="UI"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key="workingCopyManager"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;className="com.ibm.wtp.common.ui.WTPUIWorkingCopyManager"&gt;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/uiContextSensitiveClass&gt;<br>
-&nbsp;&nbsp;&nbsp;&lt;/extension&gt;<br>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- See <code>org.eclipse.jem.util.UIContextDetermination</code>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) IBM 2003.
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jem.util/schema/uiTester.exsd b/plugins/org.eclipse.jem.util/schema/uiTester.exsd
deleted file mode 100644
index 48d74fc..0000000
--- a/plugins/org.eclipse.jem.util/schema/uiTester.exsd
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jem.util">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jem.util" id="uiTester" name="UI Tester"/>
- </appInfo>
- <documentation>
- Edit models provide a framework for managing a set of EMF resources within a unit of work. For example, a workspace operation may affect a change to multiple EMF resources. Edit models provide basic services such as loads, saves (when necessary), and validate edit for the managed resources. Edit models are reference counted, therefore a single instance of an edit model can be shared by more than one operation or editor. By declaring an edit model, a plugin provider enables other components to contribute resources to be managed by that edit model.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="uiTester"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="uiTester">
- <annotation>
- <documentation>
- The declaration for an edit model to be used in the workspace.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- A unique identifier for the edit model.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/.classpath b/plugins/org.eclipse.wst.common.frameworks.ui/.classpath
deleted file mode 100644
index beda00a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="wtp_ui/"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/.cvsignore b/plugins/org.eclipse.wst.common.frameworks.ui/.cvsignore
deleted file mode 100644
index 800bb16..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-temp.folder
-build.xml
-wtp_ui.jar
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/.project b/plugins/org.eclipse.wst.common.frameworks.ui/.project
deleted file mode 100644
index 47885fd..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.frameworks.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/build.properties b/plugins/org.eclipse.wst.common.frameworks.ui/build.properties
deleted file mode 100644
index 72b3e59..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-output.wtp_ui.jar = bin/
-bin.includes = plugin.xml,\
- wtp_ui.jar
-source.wtp_ui.jar = wtp_ui/,\
- property_files/
-src.includes = schema/
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/plugin.properties b/plugins/org.eclipse.wst.common.frameworks.ui/plugin.properties
deleted file mode 100644
index 138194d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/plugin.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-Cut=Cut
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/plugin.xml b/plugins/org.eclipse.wst.common.frameworks.ui/plugin.xml
deleted file mode 100644
index c9c779e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/plugin.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.common.frameworks.ui"
- name="WTP UI Plug-in"
- version="1.0.0"
- provider-name=""
- description="This is a holding place for common frameworks UI used by components used in WTP currently it includes the following frameworks: Entendable Wizards, Extendable Actions"
- class="org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin">
-
- <runtime>
- <library name="wtp_ui.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.wst.common.frameworks"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- </requires>
-
-
- <extension-point id="wtpuiAction" name="WTP UI Action" schema="schema/wtpuiAction.exsd"/>
- <extension-point id="extendedViewer" name="Extended Viewers" schema="schema/extendedViewer.exsd"/>
- <extension-point id="extendableWizard" name="Extendable Wizard" schema="schema/extendableWizard.exsd"/>
- <extension-point id="wizardPageGroup" name="Extendable Wizard Page" schema="schema/extendableWizardPage.exsd"/>
-
- <extension
- id="UITester"
- point="com.ibm.wtp.common.util.uiTester">
- <uiTester
- className="org.eclipse.wst.common.frameworks.internal.ui.UITesterImpl">
- </uiTester>
- </extension>
- <extension
- id="context.Sensitive.Class.saveHandler"
- name="Save Handler - Headless Context Class"
- point="com.ibm.wtp.common.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- key="saveHandler"
- context="UI"
- className="org.eclipse.wst.common.frameworks.internal.ui.SaveHandlerUI">
- </uiContextSensitiveClass>
- </extension>
- <extension
- id="org.eclipse.wst.common.frameworks.internal.ui.EnablementDetermination"
- name="UI Enablement Determination"
- point="com.ibm.wtp.common.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- key="org.eclipse.wst.common.frameworks.internal.EnablementDetermination"
- context="UI"
- className="org.eclipse.wst.common.frameworks.internal.ui.UIEnablementManager">
- </uiContextSensitiveClass>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.WTPActivityBridgeHelper">
- <WTPActivityBridgeHelper
- class="org.eclipse.wst.common.frameworks.internal.ui.WTPActivityBridgeHelperImpl">
- </WTPActivityBridgeHelper>
- </extension>
- <!--
- <extension
- point="org.eclipse.wst.common.frameworks.internals.OperationExtension">
- <operationExtension
- postOperationClass="org.eclipse.wst.common.frameworks.internal.operation.extension.ui.PostPasteActionOperation"
- id="org.eclipse.wst.common.frameworks.internal.operation.extension.ui.PasteActionOperation"/>
- </extension>
- -->
- <extension
- id="PasteActionOperationExtendibleOperation"
- point="org.eclipse.wst.common.frameworks.ExtendableOperation">
- <extendableOperation
- class="org.eclipse.wst.common.frameworks.internal.operation.extension.ui.PasteActionOperation"
- id="org.eclipse.wst.common.frameworks.internal.operation.extension.ui.PasteActionOperation"/>
- </extension>
-
-
-</plugin>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/prepareforpii.xml b/plugins/org.eclipse.wst.common.frameworks.ui/prepareforpii.xml
deleted file mode 100644
index d2dca48..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/prepareforpii.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<project name="PrepareForPII" default="main" basedir=".">
-
- <!-- Setup temp variables -->
- <target name="init">
- <property name="nlsDir" value="d:/NLS/Corona/0526"/>
- <property name="plugin" value="com.ibm.wtp.common.ui"/>
- <property name="plugindir" value="d:/workspaceCorona/${plugin}"/>
- <property name="outputDir" value="${nlsDir}/${plugin}"/>
-
-
- </target>
-
- <!-- Create the destination dir -->
- <target name="nlsDir" depends="init">
- <mkdir dir="${nlsDir}"/>
- </target>
-
- <!-- Create the destination dir -->
- <target name="plugindir" depends="nlsDir">
- <delete dir="${outputDir}"/>
- <mkdir dir="${outputDir}"/>
- </target>
-
- <!-- Move the files to the correct locations in the workspace. -->
- <target name="main" depends="plugindir">
-
- <messageIdGen folderPath = "${plugindir}" componentId = "E" />
-
- <copy todir = "${outputDir}/property_files" >
- <fileset dir="${plugindir}/property_files">
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
- <copy file="${plugindir}/plugin.properties" todir="${outputDir}"/>
-
- </target>
-</project>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/property_files/wtpcommonui.properties b/plugins/org.eclipse.wst.common.frameworks.ui/property_files/wtpcommonui.properties
deleted file mode 100644
index 9e8a4b5..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/property_files/wtpcommonui.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-IActionWTPOperation_UI_0=No action available for execution.
-WTPActionDialog_UI_0=Select the optional dependent actions you would like to execute.
-WTPOptionalOperationDataModel_UI_0=Root tree can not be selected.
-WTPOptionalOperationDataModel_UI_1=No operations are selected.
-MasterDescriptor_ERROR_2=IWAE0005E WTPUIOperation elements require exactly one <selectionEnablement />.
-WTPOperationAction_UI_0=Operation Status
-WTPOperationAction_UI_1=Problem executing operation.
-TimerQueue_ERROR_0=IWAE0006E Can't start a TimerQueue that is already running
-ExtendedWizardPage_ERROR_0=IWAE0007E Cannot modify id after it has already been set.
-ExtendedWizardPage_ERROR_1=IWAE0008E The id cannot be null
-MasterDescriptor_UI_1=No \" {0} \" attribute defined
-Timer_UI_0=Invalid delay: {0}
-Timer_UI_1=Invalid initial delay: {0}
-WTPWizard_UI_0=Wizard Error: {0}
-WTPWizard_UI_1=An error has occurred when {0} finished.
-ExtendableWizard_UI_0=Wizard page failed to be created in {0} {1}
-WizardPageExtensionManager_UI_0=Element: {0} does not allow page insertion after.
-WizardPageExtensionManager_UI_1={0} will not be created
-WizardPageExtensionManager_UI_2=Circular dependancy, element: {0} check: {1}
-WizardPageExtensionManager_UI_3=Editor does not allow page insertions
-WizardPageExtensionManager_UI_4=Parent Class Not Found Error: {0} \r\n for attribute: {1} in plugin {2} \r\nPage not created
-Delete_UI_0=Delete
-Name_=Project Name:
-Browse_=Browse:
-Project_location_=Project Location:
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizard.exsd b/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizard.exsd
deleted file mode 100644
index ba2556d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizard.exsd
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.etools.emf.workbench.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.etools.emf.workbench.ui" id="editModelEditor" name="Edit Model Editor"/>
- </appInfo>
- <documentation>
- Edit model editors represent the multi page editors that can be used to edit a collection of EMF resources. By declaring an edit model editor, the plugin provider allows the framework to generically obtain the edit model used by the editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="extendableWizard" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="extendableWizard">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizardPage.exsd b/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizardPage.exsd
deleted file mode 100644
index 9dc6e0c..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendableWizardPage.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.etools.emf.workbench.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.etools.emf.workbench.ui" id="editModelEditor" name="Edit Model Editor"/>
- </appInfo>
- <documentation>
- Edit model editors represent the multi page editors that can be used to edit a collection of EMF resources. By declaring an edit model editor, the plugin provider allows the framework to generically obtain the edit model used by the editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <choice>
- <element ref="wizardPageGroup"/>
- </choice>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="wizardPageGroup">
- <complexType>
- <sequence>
- <choice>
- <element ref="factory"/>
- </choice>
- </sequence>
- <attribute name="wizardID" type="string" use="required">
- <annotation>
- <documentation>
- This must match the id defined in the extendableWizard element in the extendableWizard extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="allowsExtendedPagesAfter" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pageGroupInsertionID" type="string">
- <annotation>
- <documentation>
- If this page is to immediately after another page, this must match the pageID of the page to insert after.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pageGroupID" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="factory">
- <complexType>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- This class is an instancof com.ibm.wtp.common.ui.wizard.extensions.WizardExtensionFactory
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendedViewer.exsd b/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendedViewer.exsd
deleted file mode 100644
index 7066b3f..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/schema/extendedViewer.exsd
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.wtp.common.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.wtp.common.ui" id="extendedViewer" name="Extended Viewer"/>
- </appInfo>
- <documentation>
- The extendedViewer Extension point allows the contribution of new function
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="extendedViewer"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="extendedViewer">
- <complexType>
- <attribute name="viewerID" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="parentViewerID" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="functionGroupID" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/schema/wtpuiAction.exsd b/plugins/org.eclipse.wst.common.frameworks.ui/schema/wtpuiAction.exsd
deleted file mode 100644
index fcffea2..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/schema/wtpuiAction.exsd
+++ /dev/null
@@ -1,351 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.wtp.common.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.wtp.common.ui" id="WTPUIOperation" name="WTP UI Operation"/>
- </appInfo>
- <documentation>
- This extension point is for WTP Operations which need to be tied to a generic UI action, such as CUT, COPY, PASTE, DELETE, and RENAME.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <choice>
- <element ref="masterOperation"/>
- <element ref="slaveOperation"/>
- </choice>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="masterOperation">
- <annotation>
- <documentation>
- A masterOperation enables an existing WTP Operation to be used in a UI action. Generic Ids aggregate a set of masterOperations for the same Abstract action (like a "CUT" operation). WTP Operations are themselves extendible, so for any masterOperation defined, there may be any number of pre|post operations. These pre|post operation can have slaveOperation elements defined which indicate the pre|post operation may be run independently.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="selectionEnablement"/>
- </sequence>
- <attribute name="extendedGenericId" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the Generic Action you would like to contribute to. (e.g. The id for CUT, COPY, PASTE, DELETE, RENAME).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="operationClass" type="string">
- <annotation>
- <documentation>
- The fully qualified class of your operation. Your operation must extend com.ibm.wtp.common.operation.WTPOperation and must provide a no-arguments default constructor. If this attribute is not provided, the getDefaultOperation() returned by the dataModel will be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A name to display in the dialog for your action (if the operation is optional). You can use the standard "%key" for translatable text stored in plugin.properties.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- A description to display in the dialog for your action (if the operation is optional). You can use the standard "%key" for translatable text stored in plugin.properties.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="populatorClass" type="string" use="required">
- <annotation>
- <documentation>
- An implementation of com.ibm.wtp.common.operation.extension.ui.WTPOperationDataModelUICreator. The populatorClass knows how to provide a WTP Operation Data Model based on a given selection. The getDefaultOperation() method of the data model will be ignored if the operationClass is provided.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="alwaysExecute" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="overrideId" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="selectionEnablement">
- <annotation>
- <documentation>
- The selectionEnablement element allows you to filter which kinds of selection your object is applicable to using Standard Eclipse Action Expresions.
- </documentation>
- </annotation>
- <complexType>
- <choice>
- <element ref="objectClass"/>
- <element ref="or"/>
- </choice>
- </complexType>
- </element>
-
- <element name="slaveOperation">
- <annotation>
- <documentation>
- The slaveOperation element defines display information for operations which extend a declared master operation. If a pre|post operation of a master does not have a corresponding slaveOperation element, then the pre|post operation will be consider required, and not be displayed to the user.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="operationClass" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified class of your operation. Your operation must extend com.ibm.wtp.common.operation.WTPOperation and must provide a no-arguments default constructor. For slave operations, the data model of the master operation will be provided. Therefore, slaves cannot override the data model using a seperate populatorClass.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A name to display in the dialog for your action (if the operation is optional). You can use the standard "%key" for translatable text stored in plugin.properties.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- A description to display in the dialog for your action (if the operation is optional). You can use the standard "%key" for translatable text stored in plugin.properties.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="or">
- <complexType>
- <choice>
- <element ref="objectClass"/>
- <element ref="and"/>
- <element ref="objectState"/>
- </choice>
- </complexType>
- </element>
-
- <element name="objectClass">
- <complexType>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="adaptable" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="and">
- <complexType>
- <choice>
- <element ref="objectClass"/>
- <element ref="or"/>
- </choice>
- </complexType>
- </element>
-
- <element name="objectState">
- <complexType>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following example declares two Master Operations (<code>com.acme.ui.operation.MasterOperationA</code> and <code>com.acme.ui.operation.MasterOperationB</code>) which are attached to the Generic ID <code>com.acme.ui.WTPOptionalOperationTest</code>.
-The scenario has Master A which has as a pre-operation of Slave A and a post-operation of Slave C. Slave A is made optional by the <code>slaveOperation</code> element, while Slave C will always be run (no <code>slaveOperation</code> is given to run it seperately). Slave A further has an optional pre-operation (Slave B) that can be executed indepently of either Slave A or Master A.
-<pre>
- <extension
- point="com.ibm.wtp.common.ui.wtpuiAction">
- <masterOperation
- populatorClass="com.acme.ui.operation.AcmeOperationPopulator"
- name="%master_a_name"
- operationClass="com.acme.ui.operation.MasterOperationA"
- extendedGenericId="com.acme.ui.WTPOptionalOperationTest"
- description="%master_a_description">
- </masterOperation>
- <slaveOperation
- name="Slave A"
- operationClass="com.acme.ui.operation.SlaveOperationA">
- </slaveOperation>
- <slaveOperation
- name="Slave B"
- operationClass="com.acme.ui.operation.SlaveOperationB">
- </slaveOperation>
- <masterOperation
- populatorClass="com.acme.ui.operation.AcmeOperationPopulator"
- name="EAR Project Action"
- operationClass="com.acme.ui.operation.MasterOperationB"
- extendedGenericId="com.acme.ui.WTPOptionalOperationTest">
- <selectionEnablement>
- <objectState name="projectNature" value="org.eclipse.jst.j2ee.EARNature" />
- </selectionEnablement>
- </masterOperation>
- </extension>
-</pre>
-
-For each of the slaveOperations referenced above, you must have a corresponding WTP Operation Extension declared similar to the following:
-
-<pre>
- <extension
- id="wtpuiAciton.Acme.Extensions"
- point="com.ibm.wtp.common.ExtendableOperation">
- <extendableOperation
- class="com.acme.ui.operation.MasterOperationA"
- id="com.acme.ui.operation.MasterOperationA">
- </extendableOperation>
- <extendableOperation
- class="com.acme.ui.operation.SlaveOperationA"
- id="com.acme.ui.operation.SlaveOperationA">
- </extendableOperation>
- </extension>
- <extension
- point="com.ibm.wtp.common.OperationExtension">
- <!-- Made optional by the above declaration -->
- <operationExtension
- preOperationClass="com.acme.ui.operation.SlaveOperationA"
- id="com.acme.ui.operation.MasterOperationA">
- </operationExtension>
- <!-- Made optional by the above declaration -->
- <operationExtension
- postOperationClass="com.acme.ui.operation.SlaveOperationB"
- id="com.acme.ui.operation.SlaveOperationA">
- </operationExtension>
- <!-- Non-optional operation, will always run -->
- <operationExtension
- postOperationClass="com.acme.ui.operation.SlaveOperationC"
- id="com.acme.ui.operation.MasterOperationA">
- </operationExtension>
- </extension>
-</pre>
-
-In general, users extending existing actions only need to declare the following:
-<pre>
- <extension
- point="com.ibm.wtp.common.OperationExtension">
- <!-- The action referenced must be declared as extensible by the com.ibm.wtp.common.ExtendableOperation extension point -->
- <operationExtension
- preOperationClass="...YOUR CLASS..."
- id="...ID OF EXISTING OPERATION...">
- </operationExtension>
- </extension>
-</pre>
-
-And if your operation is optional declare the slaveOperation:
-
-<pre>
- <extension
- point="com.ibm.wtp.common.ui.wtpuiAction">
- <slaveOperation
- name="..NAME OF YOUR OPERATION..."
- description="...DESCRIPTION OF YOUR ACTION..."
- operationClass="...YOUR CLASS...">
- </slaveOperation>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/CommonUIPluginConstants.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/CommonUIPluginConstants.java
deleted file mode 100644
index 1aaaa36..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/CommonUIPluginConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 16, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-/**
- * @author blancett
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public interface CommonUIPluginConstants {
- public static final String PLUGIN_ID = "org.eclipse.wst.common.frameworks.internal.ui"; //$NON-NLS-1$
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendableWizard.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendableWizard.java
deleted file mode 100644
index 65d8c71..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendableWizard.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 16, 2004
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code Generation - Code and
- * Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.internal.operations.FailSafeComposedOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPWizard;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author blancett
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public abstract class ExtendableWizard extends WTPWizard {
-
- private IExtendedWizardPage[] extendedPages = null;
- private IExtendedPageHandler[] extendedPageHandlers = null;
-
- public ExtendableWizard(WTPOperationDataModel model) {
- super(model);
- }
-
- public ExtendableWizard() {
- super();
- }
-
- /**
- *
- * @return the wizard ID that clients should extend to add to this wizard
- */
- public abstract String getWizardID();
-
- /**
- * Add all wizard pages that come from this wizard
- */
- protected abstract void doAddPages();
-
- /**
- * Create the operation that should be used by this wizard
- *
- * @return
- */
- protected abstract WTPOperation createBaseOperation();
-
- private void addExtensionPages() {
- String wizardID = getWizardID();
- WizardPageElement wizElement = null;
- if (wizardID == null)
- return;
- WizardPageElement[] elements = WizardPageExtensionManager.getInstance().getPageElements(getWizardID());
- IExtendedWizardPage[] extendedPagesLocal = null;
- IExtendedPageHandler extendedPageHandler = null;
- List extendedPagesList = new ArrayList();
- List extendedPageHandlerList = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- wizElement = elements[i];
- try {
- extendedPagesLocal = wizElement.createPageGroup(model);
- if (null != extendedPagesLocal) {
- for (int j = 0; j < extendedPagesLocal.length; j++) {
- addPage(extendedPagesLocal[j]);
- extendedPagesList.add(extendedPagesLocal[j]);
- }
- }
- extendedPageHandler = wizElement.createPageHandler(model);
- if (null != extendedPageHandler && !extendedPageHandlerList.contains(extendedPageHandler)) {
- extendedPageHandlerList.add(extendedPageHandler);
- }
- } catch (RuntimeException runtime) {
- Logger.getLogger().logError(WTPCommonUIResourceHandler.getString("ExtendableWizard_UI_0", new Object[]{wizElement.getPluginID(), wizElement.pageGroupID})); //$NON-NLS-1$
- Logger.getLogger().logError(runtime);
- }
- }
- extendedPages = new IExtendedWizardPage[extendedPagesList.size()];
- for (int i = 0; i < extendedPages.length; i++) {
- extendedPages[i] = (IExtendedWizardPage) extendedPagesList.get(i);
- }
- extendedPageHandlers = new IExtendedPageHandler[extendedPageHandlerList.size()];
- for (int i = 0; i < extendedPageHandlers.length; i++) {
- extendedPageHandlers[i] = (IExtendedPageHandler) extendedPageHandlerList.get(i);
- }
-
- }
-
- public boolean canFinish() {
- if (!super.canFinish()) {
- return false;
- }
- for (int i = 0; null != extendedPages && i < extendedPages.length; i++) {
- if (!extendedPages[i].canPageFinish()) {
- return false;
- }
- }
- return true;
- }
-
- protected final WTPOperation createOperation() {
- WTPOperation baseOperation = createBaseOperation();
- FailSafeComposedOperation composedOperation = null;
- for (int i = 0; null != extendedPages && i < extendedPages.length; i++) {
- WTPOperation op = extendedPages[i].createOperation();
- if (op != null) {
- if (composedOperation == null) {
- composedOperation = new FailSafeComposedOperation();
- composedOperation.append(baseOperation);
- }
- composedOperation.append(op);
- }
- }
- return composedOperation != null ? composedOperation : baseOperation;
- }
-
- /**
- * The <code>Wizard</code> implementation of this <code>IWizard</code> method creates all
- * the pages controls using <code>IDialogPage.createControl</code>. Subclasses should
- * reimplement this method if they want to delay creating one or more of the pages lazily. The
- * framework ensures that the contents of a page will be created before attempting to show it.
- */
- public void createPageControls(Composite pageContainer) {
- IWizardPage[] pages = getPages();
- // the default behavior is to create all the pages controls
- for (int i = 0; i < pages.length; i++) {
- if (isExtendedPage(pages[i])) {
- try {
- pages[i].createControl(pageContainer);
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- continue;
- }
- } else {
- pages[i].createControl(pageContainer);
- }
- // page is responsible for ensuring the created control is
- // accessable
- // via getControl.
- Assert.isNotNull(pages[i].getControl());
- }
- }
-
- protected boolean isExtendedPage(IWizardPage page) {
- for (int i = 0; null != extendedPages && i < extendedPages.length; i++) {
- if (page == extendedPages[i]) {
- return true;
- }
- }
- return false;
- }
-
-
- public final void addPages() {
- doAddPages();
- addExtensionPages();
- }
-
- public IWizardPage getNextPage(IWizardPage page) {
- IWizardPage expectedPage = super.getNextPage(page);
- String expectedPageName = (null == expectedPage) ? null : expectedPage.getName();
- String nextPageName = null;
- for (int i = 0; null != extendedPageHandlers && i < extendedPageHandlers.length; i++) {
- nextPageName = extendedPageHandlers[i].getNextPage(page.getName(), expectedPageName);
- if (null != nextPageName) {
- if (nextPageName.equals(IExtendedPageHandler.SKIP_PAGE)) {
- return getNextPage(expectedPage);
- } else if (nextPageName.startsWith(IExtendedPageHandler.PAGE_AFTER)) {
- String tempNextPageName = nextPageName.substring(IExtendedPageHandler.PAGE_AFTER.length());
- IWizardPage tempNextPage = getPage(tempNextPageName);
- return null == tempNextPage ? null : super.getNextPage(tempNextPage);
- }
- return getPage(nextPageName);
- }
- }
- return expectedPage;
- }
-
- public IWizardPage getPreviousPage(IWizardPage page) {
- IWizardPage expectedPage = super.getPreviousPage(page);
- String expectedPageName = (null == expectedPage) ? null : expectedPage.getName();
- String previousPageName = null;
- for (int i = 0; null != extendedPageHandlers && i < extendedPageHandlers.length; i++) {
- previousPageName = extendedPageHandlers[i].getPreviousPage(page.getName(), expectedPageName);
- if (null != previousPageName) {
- if (previousPageName.equals(IExtendedPageHandler.SKIP_PAGE)) {
- return getPreviousPage(expectedPage);
- } else if (previousPageName.startsWith(IExtendedPageHandler.PAGE_AFTER)) {
- String tempPreviousPageName = previousPageName.substring(IExtendedPageHandler.PAGE_AFTER.length());
- IWizardPage tempPreviousPage = getPage(tempPreviousPageName);
- return null == tempPreviousPage ? null : super.getPreviousPage(tempPreviousPage);
- }
- return getPage(previousPageName);
- }
- }
- return expectedPage;
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendedWizardPage.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendedWizardPage.java
deleted file mode 100644
index 43afffb..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtendedWizardPage.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 19, 2004
- *
- * To change the template for this generated file go to Window - Preferences -
- * Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-
-import org.eclipse.core.internal.runtime.Assert;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPWizardPage;
-
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public abstract class ExtendedWizardPage extends WTPWizardPage implements IExtendedWizardPage {
-
- private String id;
-
- protected ExtendedWizardPage(WTPOperationDataModel model, String pageName) {
- super(model, pageName);
- }
-
- /**
- * @return Returns the id.
- */
- public final String getGroupID() {
- return id;
- }
-
- /**
- * Will only set the id once. Further invocations will be ignored.
- *
- * @param id
- * The id to set.
- */
- public final void setGroupID(String id) {
- Assert.isTrue(this.id == null, WTPCommonUIResourceHandler.getString("ExtendedWizardPage_ERROR_0")); //$NON-NLS-1$
- Assert.isNotNull(id, WTPCommonUIResourceHandler.getString("ExtendedWizardPage_ERROR_1")); //$NON-NLS-1$
- this.id = id;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtensibleViewRegistry.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtensibleViewRegistry.java
deleted file mode 100644
index efff496..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/ExtensibleViewRegistry.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * @author mdelder
- */
-public class ExtensibleViewRegistry extends RegistryReader {
-
- private static ExtensibleViewRegistry INSTANCE = null;
- private Map extendedViewerMap = null;
- private Map descriptorMap = null;
-
- protected interface Elements {
- public static final String EXTENDED_VIEWER = "extendedViewer"; //$NON-NLS-1$
- public static final String VIEWER_ID = "viewerID"; //$NON-NLS-1$
- public static final String PARENT_VIEWER_ID = "parentViewerID"; //$NON-NLS-1$
- public static final String FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$
- public static final String ICON = "icon"; //$NON-NLS-1$
- public static final String LABEL = "label"; //$NON-NLS-1$
- public static final String FUNCTION_GROUP_ID = "functionGroupID"; //$NON-NLS-1$
- }
-
- /**
- *
- */
- private ExtensibleViewRegistry() {
- super(WTPUIPlugin.PLUGIN_ID, WTPUIPlugin.EXTENDED_VIEWER_REGISTRY_EXTENSION_POINT);
- }
-
- public static ExtensibleViewRegistry getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new ExtensibleViewRegistry();
- INSTANCE.readRegistry();
- }
- return INSTANCE;
- }
-
- public Descriptor getDescriptor(String viewerID) {
- return (Descriptor) getDescriptorMap().get(viewerID);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.internal.registry.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- if (element.getName().equals(Elements.EXTENDED_VIEWER)) {
- Descriptor descriptor = new Descriptor(element);
- getDescriptorMap().put(descriptor.getViewerID(), descriptor);
- return true;
- }
- return false;
- }
-
- /**
- * @return Returns the extendedViewerMap.
- */
- protected Map getExtendedViewerMap() {
- if (extendedViewerMap == null)
- extendedViewerMap = new HashMap();
- return extendedViewerMap;
- }
-
- /**
- * @return Returns the descriptorMap.
- */
- protected Map getDescriptorMap() {
- if (descriptorMap == null)
- descriptorMap = new HashMap();
- return descriptorMap;
- }
-
- public class Descriptor {
-
- private String viewerID = null;
- private String parentViewerID = null;
- private String factoryClass = null;
- private String icon = null;
- private String label = null;
- private String functionGroupID = null;
-
- private String toStringCache = null;
- private IConfigurationElement element = null;
-
- /**
- *
- */
- public Descriptor(IConfigurationElement element) {
- this.element = element;
-
- this.viewerID = this.element.getAttribute(ExtensibleViewRegistry.Elements.VIEWER_ID);
- this.parentViewerID = this.element.getAttribute(ExtensibleViewRegistry.Elements.PARENT_VIEWER_ID);
- this.factoryClass = this.element.getAttribute(ExtensibleViewRegistry.Elements.FACTORY_CLASS);
- this.icon = this.element.getAttribute(ExtensibleViewRegistry.Elements.ICON);
- this.label = this.element.getAttribute(ExtensibleViewRegistry.Elements.LABEL);
- this.functionGroupID = this.element.getAttribute(ExtensibleViewRegistry.Elements.FUNCTION_GROUP_ID);
- }
-
- public IExtensibleViewFactory createFactoryInstance() {
- IExtensibleViewFactory factoryInstance = null;
- try {
- factoryInstance = (IExtensibleViewFactory) this.element.createExecutableExtension(getFactoryClass());
- } catch (CoreException e) {
- WTPUIPlugin.getLogger().logError(e);
- }
- return factoryInstance;
- }
-
- /**
- * @return Returns the factoryClass.
- */
- public String getFactoryClass() {
- return factoryClass;
- }
-
- /**
- * @return Returns the functionGroupID.
- */
- public String getFunctionGroupID() {
- return functionGroupID;
- }
-
- /**
- * @return Returns the icon.
- */
- public String getIcon() {
- return icon;
- }
-
- /**
- * @return Returns the label.
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * @return Returns the parentViewerID.
- */
- public String getParentViewerID() {
- return parentViewerID;
- }
-
- /**
- * @return Returns the viewerID.
- */
- public String getViewerID() {
- return viewerID;
- }
-
- public String toString() {
- if (toStringCache == null)
- toStringCache = "ExtensibleViewRegistry.Info [viewerID=\"" + getViewerID() + "\",parentViewerID=\"" + getParentViewerID() + "\",factoryClass=" + getFactoryClass() + "\",functionGroupID=\"" + getFunctionGroupID() + "\"]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return toStringCache;
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperation.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperation.java
deleted file mode 100644
index 8970381..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperation.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 10, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.wst.common.frameworks.internal.operations.NonConflictingRule;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin;
-
-
-/**
- * @author mdelder
- *
- */
-public class IActionWTPOperation extends WTPOperation {
-
- private static final ISchedulingRule nonconflictingRule = new NonConflictingRule();
-
- boolean done;
-
- /**
- *
- */
- public IActionWTPOperation() {
- super();
- }
-
- /**
- * @param operationDataModel
- */
- public IActionWTPOperation(WTPOperationDataModel operationDataModel) {
- super(operationDataModel);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
-
- final IAction action = (IAction) getOperationDataModel().getProperty(IActionWTPOperationDataModel.IACTION);
- if (action == null)
- throw new CoreException(new Status(IStatus.WARNING, WTPUIPlugin.PLUGIN_ID, 0, WTPCommonUIResourceHandler.getString("IActionWTPOperation_UI_0"), null)); //$NON-NLS-1$
-
- final ISelection selection = (IStructuredSelection) getOperationDataModel().getProperty(IActionWTPOperationDataModel.ISTRUCTURED_SELECTION);
- final ISelectionProvider selectionProvider = (ISelectionProvider) getOperationDataModel().getProperty(IActionWTPOperationDataModel.ISELECTION_PROVIDER);
-
- /*
- * if(selectionProvider != null) selection = (selection != null) ? selection :
- * selectionProvider.getSelection();
- */
- Shell shell = (Shell) getOperationDataModel().getProperty(IActionWTPOperationDataModel.SHELL);
- done = false;
-
- Runnable executeAction = new Runnable() {
-
- public void run() {
- try {
- if (action instanceof IActionDelegate) {
- ((IActionDelegate) action).selectionChanged(action, selection);
- ((IActionDelegate) action).run(action);
- } else if (action instanceof IViewActionDelegate) {
- ((IViewActionDelegate) action).selectionChanged(action, selection);
- ((IActionDelegate) action).run(action);
- } /*else if (action instanceof SelectionDispatchAction) {
- ((SelectionDispatchAction) action).update(selection);
- ((SelectionDispatchAction) action).run();
- } */
- else if (action instanceof ISelectionChangedListener) {
- ((ISelectionChangedListener)action).selectionChanged(new SelectionChangedEvent(selectionProvider, selection));
- action.run();
- }
-
-
- } catch (RuntimeException e) {
- e.printStackTrace();
- } finally {
- getOperationDataModel().dispose();
- done = true;
- }
- }
- };
-
- Display current = Display.getCurrent();
- if (current != null) {
- executeAction.run();
- } else {
- shell.getDisplay().asyncExec(executeAction);
- }
-
- while (!done) {
- Thread.sleep(100);
- }
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#getSchedulingRule()
- */
- protected ISchedulingRule getSchedulingRule() {
- return nonconflictingRule;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperationDataModel.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperationDataModel.java
deleted file mode 100644
index eded3bd..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IActionWTPOperationDataModel.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 10, 2004
- *
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-
-
-/**
- * @author mdelder
- *
- */
-public class IActionWTPOperationDataModel extends WTPOperationDataModel implements IPropertyChangeListener {
-
- public static final String IACTION = "IActionWTPOperationDataModel.IACTION"; //$NON-NLS-1$
- public static final String ISTRUCTURED_SELECTION = "IActionWTPOperationDataModel.ISTRUCTURED_SELECTION"; //$NON-NLS-1$
- public static final String ISELECTION_PROVIDER = "IActionWTPOperationDataModel.ISELECTION_PROVIDER"; //$NON-NLS-1$
- public static final String SHELL = "IActionWTPOperationDataModel.SHELL"; //$NON-NLS-1$
- public static final String ACTION_RAN_SUCCESSFULLY = "IActionWTPOperationDataModel.ACTION_RAN_SUCCESSFULLY"; //$NON-NLS-1$
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#initValidBaseProperties()
- */
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(IACTION);
- addValidBaseProperty(ISTRUCTURED_SELECTION);
- addValidBaseProperty(ISELECTION_PROVIDER);
- addValidBaseProperty(SHELL);
- addValidBaseProperty(ACTION_RAN_SUCCESSFULLY);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#getDefaultOperation()
- */
- public WTPOperation getDefaultOperation() {
- return new IActionWTPOperation(this);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#isResultProperty(java.lang.String)
- */
- protected boolean isResultProperty(String propertyName) {
- if (ACTION_RAN_SUCCESSFULLY.equals(propertyName))
- return true;
- return super.isResultProperty(propertyName);
- }
-
- /**
- * @param action
- * @param selection
- * @param provider
- * @return
- */
- public static WTPOperationDataModel createDataModel(IActionDelegate action, IStructuredSelection selection, ISelectionProvider provider, Shell shell) {
- WTPOperationDataModel dataModel = new IActionWTPOperationDataModel();
- dataModel.setProperty(IACTION, action);
- dataModel.setProperty(ISTRUCTURED_SELECTION, selection);
- dataModel.setProperty(ISELECTION_PROVIDER, provider);
- dataModel.setProperty(SHELL, shell);
- return dataModel;
- }
-
- /**
- * @param action
- * @param selection
- * @param provider
- * @return
- */
- public static WTPOperationDataModel createDataModel(Action action, IStructuredSelection selection, ISelectionProvider provider, Shell shell) {
- WTPOperationDataModel dataModel = new IActionWTPOperationDataModel();
- dataModel.setProperty(IACTION, action);
- dataModel.setProperty(ISTRUCTURED_SELECTION, selection);
- dataModel.setProperty(ISELECTION_PROVIDER, provider);
- dataModel.setProperty(SHELL, shell);
- return dataModel;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#doSetProperty(java.lang.String,
- * java.lang.Object)
- */
- protected boolean doSetProperty(String propertyName, Object propertyValue) {
-
-
- if (IACTION.equals(propertyName)) {
-
- IAction oldAction = (IAction) getProperty(IACTION);
- if (oldAction != null)
- oldAction.removePropertyChangeListener(this);
-
- boolean result = super.doSetProperty(propertyName, propertyValue);
-
- IAction newAction = (IAction) getProperty(IACTION);
- if (newAction != null)
- newAction.addPropertyChangeListener(this);
-
- return result;
- }
- return super.doSetProperty(propertyName, propertyValue);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#getDefaultProperty(java.lang.String)
- */
- protected Object getDefaultProperty(String propertyName) {
- if (ACTION_RAN_SUCCESSFULLY.equals(propertyName))
- return Boolean.TRUE;
- return super.getDefaultProperty(propertyName);
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#dispose()
- */
- public void dispose() {
- super.dispose();
- IAction action = (IAction) getProperty(IACTION);
- if (action != null)
- action.removePropertyChangeListener(this);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- IAction action = (IAction) getProperty(IACTION);
- if (action == null || action != event.getSource())
- return;
- // TODO MDE Implement this method
- //notifyListeners(event.getProperty(), 0, event.getOldValue(), event.getNewValue());
- if (IAction.RESULT.equals(event.getProperty())) {
- setProperty(ACTION_RAN_SUCCESSFULLY, event.getNewValue());
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedPageHandler.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedPageHandler.java
deleted file mode 100644
index 5331915..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedPageHandler.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 8, 2004
- *
- * To change the template for this generated file go to Window - Preferences -
- * Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public interface IExtendedPageHandler {
-
- /**
- * return this as the page name if the expectedNextPageName or expectedPreviousPageName should
- * be skipped
- */
- public static final String SKIP_PAGE = "IExtendedPageHandler.SKIP_PAGE"; //$NON-NLS-1$
-
- /**
- * prefix this string with the name of the page which occurs before the page that should be
- * returned. E.G. suppose your page contributions know about pages A, B and C, and you want the
- * to skip pages B and C, when going to the next page from A. To do this, return PAGE_AFTER+C.
- * The framework will then ask the wizard for the page that normally comes after page C.
- * PAGE_BEFORE works similarly.
- */
- public static final String PAGE_AFTER = "IExtendedPageHandler.PAGE_AFTER"; //$NON-NLS-1$
-
- /**
- * same as PAGE_AFTER, except for returing the page before.
- */
- public static final String PAGE_BEFORE = "IExtendedPageHandler.PAGE_BEFORE"; //$NON-NLS-1$
-
- /**
- * Return the name of the page that should be next
- *
- * @param currentPageName
- * the page the wizard is currently on
- * @param expectedNextPageName
- * the page that would normally be next
- * @return
- */
- public String getNextPage(String currentPageName, String expectedNextPageName);
-
- /**
- * Return the name of the page that should be previous
- *
- * @param currentPageName
- * the page the wizard is currently on
- * @param expectedNextPageName
- * the page that would normally be previous
- * @return
- */
- public String getPreviousPage(String currentPageName, String expectedPreviousPageName);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedWizardPage.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedWizardPage.java
deleted file mode 100644
index 4905710..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtendedWizardPage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 21, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public interface IExtendedWizardPage extends IWizardPage {
-
- WTPOperation createOperation();
-
- boolean canPageFinish();
-
- String getGroupID();
-
- void setGroupID(String id);
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtensibleViewFactory.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtensibleViewFactory.java
deleted file mode 100644
index b144f92..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IExtensibleViewFactory.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * @author mdelder
- */
-public interface IExtensibleViewFactory {
-
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IOperationNode.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IOperationNode.java
deleted file mode 100644
index 747b5ca..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/IOperationNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 5, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public interface IOperationNode {
-
- public IOperationNode[] getChildren();
-
- public boolean isChecked();
-
- /**
- * Same as calling setChecked(checked, true)
- *
- * @param checked
- */
- public void setChecked(boolean checked);
-
- public String getName();
-
- public String getDescription();
-
- public IOperationNode getParent();
-
- /**
- * @return
- */
- public boolean isAlwaysExecute();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/MasterDescriptor.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/MasterDescriptor.java
deleted file mode 100644
index 436f531..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/MasterDescriptor.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on May 5, 2004
- *
- * TODO To change the template for this generated file go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.internal.ActionExpression;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-public class MasterDescriptor extends SlaveDescriptor {
-
- public static final String MASTER_OPERATION = "masterOperation"; //$NON-NLS-1$
-
- public static final String ATT_EXTENDED_OPERATION_ID = "extendedGenericId"; //$NON-NLS-1$
-
- public static final String SELECTION_ENABLEMENT = "selectionEnablement"; //$NON-NLS-1$
-
- private static final String ATT_POPULATOR_CLASS = "populatorClass"; //$NON-NLS-1$
-
- private static final String ATT_ALWAYS_EXECUTE = "alwaysExecute"; //$NON-NLS-1$
-
- private ActionExpression enablement;
-
- private String extendedOperationId;
-
- private WTPOperationDataModelUICreator creator;
-
- private boolean alwaysExecute;
-
-
- public MasterDescriptor(IConfigurationElement element) {
- super(element);
- init();
- }
-
- private void init() {
- this.extendedOperationId = getElement().getAttribute(ATT_EXTENDED_OPERATION_ID);
- if (null == extendedOperationId)
- Logger.getLogger().log(WTPCommonUIResourceHandler.getString("MasterDescriptor_UI_0", new Object[]{ATT_EXTENDED_OPERATION_ID})); //$NON-NLS-1$
-
-
- if (Boolean.valueOf(getElement().getAttribute(ATT_ALWAYS_EXECUTE)).booleanValue())
- alwaysExecute = true;
-
- IConfigurationElement[] elements = getElement().getChildren(SELECTION_ENABLEMENT);
- if (elements.length == 1)
- this.enablement = new ActionExpression(elements[0]);
- else
- Logger.getLogger().log(WTPCommonUIResourceHandler.getString("MasterDescriptor_ERROR_2")); //$NON-NLS-1$
-
- }
-
- /**
- * @return Returns the extendedOperationId.
- */
- public String getExtendedOperationId() {
- return extendedOperationId;
- }
-
-
- public boolean isEnabledFor(IStructuredSelection selection) {
- if (getEnablement() == null)
- return true;
- boolean result = false;
- for (Iterator itr = selection.iterator(); itr.hasNext();) {
- result = getEnablement().isEnabledFor(itr.next());
- if (result)
- break;
- }
- return result;
- }
-
- public WTPOperationDataModelUICreator getCreator() {
- if (creator == null) {
- try {
- creator = (WTPOperationDataModelUICreator) getElement().createExecutableExtension(ATT_POPULATOR_CLASS);
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- }
- return creator;
- }
-
- protected ActionExpression getEnablement() {
- return enablement;
- }
-
-
- /**
- * @return Returns the alwaysExecute.
- */
- public boolean isAlwaysExecute() {
- return alwaysExecute;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperation.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperation.java
deleted file mode 100644
index c09631c..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 27, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-
-/**
- * @author mdelder
- *
- */
-public class PasteActionOperation extends IActionWTPOperation {
-
- public PasteActionOperation() {
- super();
- }
-
- public PasteActionOperation(PasteActionOperationDataModel opMdl) {
- super(opMdl);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperationDataModel.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperationDataModel.java
deleted file mode 100644
index dc12e79..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PasteActionOperationDataModel.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 26, 2004
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-//TODO This class has code commented out to get compile errors cleanup for Eclipse 3.1 as the internal classes ReorgResult and PasteActions have been removed in 3.1 - VKB
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- *
- */
-public class PasteActionOperationDataModel extends IActionWTPOperationDataModel {
-
- /**
- * Result Property. A java.util.Map of old-types-to-new-types
- */
- public static final String REFACTORED_RESOURCES = "PasteActionOperationDataModel.REFACTORED_RESOURCES"; //$NON-NLS-1$
- public static final String DESTINATION = "PasteActionOperationDataModel.DESTINATION"; //$NON-NLS-1$
- private Map prepasteSnapshot = new HashMap();
- //TODO Needs Clean up of compile errors for Eclipse 3.1 - VKB
- //private ReorgResult cachedResult;
-
- /**
- * @param action
- * @param selection
- * @param provider
- * @return
- */
- public static WTPOperationDataModel createDataModel(IActionDelegate action, IStructuredSelection selection, ISelectionProvider provider, Shell shell) {
- WTPOperationDataModel dataModel = new PasteActionOperationDataModel();
- dataModel.setProperty(IACTION, action);
- dataModel.setProperty(ISTRUCTURED_SELECTION, selection);
- dataModel.setProperty(ISELECTION_PROVIDER, provider);
- dataModel.setProperty(SHELL, shell);
- return dataModel;
- }
-
- /**
- * @param action
- * @param selection
- * @param provider
- * @return
- */
- public static WTPOperationDataModel createDataModel(Action action, IStructuredSelection selection, ISelectionProvider provider, Shell shell) {
- WTPOperationDataModel dataModel = new PasteActionOperationDataModel();
- dataModel.setProperty(IACTION, action);
- dataModel.setProperty(ISTRUCTURED_SELECTION, selection);
- dataModel.setProperty(ISELECTION_PROVIDER, provider);
- dataModel.setProperty(SHELL, shell);
- return dataModel;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.extension.ui.IActionWTPOperationDataModel#initValidBaseProperties()
- */
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(REFACTORED_RESOURCES);
- addValidBaseProperty(DESTINATION);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#getDefaultOperation()
- */
- public WTPOperation getDefaultOperation() {
- return new PasteActionOperation(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.extension.ui.IActionWTPOperationDataModel#isResultProperty(java.lang.String)
- */
- protected boolean isResultProperty(String propertyName) {
- if (REFACTORED_RESOURCES.equals(propertyName) || DESTINATION.equals(propertyName))
- return true;
- return super.isResultProperty(propertyName);
- }
-
-
- /*
- * (non-Javadoc)
- * TODO Needs Clean up of compile errors for Eclipse 3.1 - VKB
- * @see org.eclipse.wst.common.frameworks.internal.operation.extension.ui.IActionWTPOperationDataModel#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
-// public void propertyChange(PropertyChangeEvent event) {
-// if (PasteAction.PASTE_PRE_NOTIFICATION.equals(event.getProperty())) {
-//
-// ReorgResult result = (ReorgResult) event.getNewValue();
-// updatePrepasteSnapshot(result);
-// } else if (PasteAction.PASTE_RESULT_NOTIFICATION.equals(event.getProperty())) {
-// //System.out.println("Caching result");
-// cachedResult = (ReorgResult) event.getNewValue();
-// } else if (IAction.RESULT.equals(event.getProperty()) && cachedResult != null) {
-// //System.out.println("Applying cached result");
-// fillMapAsNecessary(cachedResult);
-//
-// Map refactorMap = cachedResult.getNameChanges();
-// setProperty(REFACTORED_RESOURCES, refactorMap);
-//
-// Object destination = cachedResult.getDestination();
-// if (cachedResult.getResourcesToCopy().length == 1) {
-// if (cachedResult.getResourcesToCopy()[0].equals(destination))
-// destination = cachedResult.getResourcesToCopy()[0].getParent();
-// } else if (cachedResult.getJavaElementsToCopy().length == 1) {
-// if (cachedResult.getJavaElementsToCopy()[0].equals(destination))
-// destination = cachedResult.getJavaElementsToCopy()[0].getParent();
-// }
-// setProperty(DESTINATION, destination);
-// cachedResult = null;
-//
-// }
-// super.propertyChange(event);
-// }
-
-// TODO Needs Clean up of compile errors for Eclipse 3.1 - VKB
-
-// protected void updatePrepasteSnapshot(ReorgResult result) {
-//
-// resetPrepasteSnapshot();
-//
-// IContainer container = getContainerFromResult(result);
-// if (container == null)
-// return;
-//
-// IResource resourceExisting = null;
-//
-// IResource[] resources = result.getResourcesToCopy();
-// if (resources != null) {
-// for (int i = 0; i < resources.length; i++) {
-// resourceExisting = getCorrespondingFileOrFolder(resources[i], new Path(resources[i].getName()), container);
-// if (resourceExisting.exists())
-// prepasteSnapshot.put(resourceExisting, new Long(resourceExisting.getModificationStamp()));
-// }
-// }
-//
-// IJavaElement[] elements = result.getJavaElementsToCopy();
-// if (elements != null) {
-// for (int i = 0; i < elements.length; i++) {
-// try {
-// resourceExisting = getCorrespondingFileOrFolder(elements[i].getCorrespondingResource(), new Path(elements[i].getCorrespondingResource().getName()), container);
-// if (resourceExisting != null && resourceExisting.exists())
-// prepasteSnapshot.put(resourceExisting, new Long(resourceExisting.getModificationStamp()));
-// } catch (JavaModelException e) {
-// }
-// }
-// }
-// }
-
- /**
- *
- */
- private void resetPrepasteSnapshot() {
- if (prepasteSnapshot == null)
- prepasteSnapshot = new HashMap();
- else
- prepasteSnapshot.clear();
- }
-
-// TODO Needs Clean up of compile errors for Eclipse 3.1 - VKB
-
-// protected void fillMapAsNecessary(ReorgResult result) {
-//
-// IContainer container = getContainerFromResult(result);
-//
-// if (container == null)
-// return;
-//
-// /*
-// * If you Ctrl+C -> Ctrl+V a Project, you get no pre-notification and the prepasteSnapshot
-// * is null
-// */
-// if (prepasteSnapshot == null)
-// prepasteSnapshot = new HashMap();
-//
-// Map nameChanges = result.getNameChanges();
-//
-// IResource resourceExisting = null;
-//
-// IResource[] resources = result.getResourcesToCopy();
-// if (resources != null) {
-// for (int i = 0; i < resources.length; i++) {
-// resourceExisting = getCorrespondingFileOrFolder(resources[i], new Path(resources[i].getName()), container);
-//
-// if (prepasteSnapshot.containsKey(resourceExisting)) {
-// Long timestamp = (Long) prepasteSnapshot.get(resourceExisting);
-// if (timestamp.longValue() != resourceExisting.getModificationStamp())
-// nameChanges.put(resources[i], resourceExisting);
-// } else
-// nameChanges.put(resources[i], resourceExisting);
-// }
-// }
-//
-// IJavaElement[] elements = result.getJavaElementsToCopy();
-// if (elements != null) {
-// for (int i = 0; i < elements.length; i++) {
-// try {
-// resourceExisting = getCorrespondingFileOrFolder(elements[i].getCorrespondingResource(), new Path(elements[i].getCorrespondingResource().getName()), container);
-//
-// if (prepasteSnapshot.containsKey(resourceExisting)) {
-// Long timestamp = (Long) prepasteSnapshot.get(resourceExisting);
-// if (timestamp.longValue() != resourceExisting.getModificationStamp())
-// nameChanges.put(elements[i].getCorrespondingResource(), resourceExisting);
-// } else
-// nameChanges.put(elements[i].getCorrespondingResource(), resourceExisting);
-// } catch (JavaModelException e) {
-// }
-// }
-// }
-// resetPrepasteSnapshot();
-// }
-//
-// private IContainer getContainerFromResult(ReorgResult result) {
-//
-// Object destination = result.getDestination();
-//
-// IContainer container = null;
-// if (result.getDestination() instanceof IContainer) {
-// container = (IContainer) destination;
-// } else if (destination instanceof IJavaElement) {
-// IJavaElement containerElement = (IJavaElement) destination;
-// IPackageFragment fragment = null;
-// IPackageFragmentRoot fragmentRoot = null;
-// switch (containerElement.getElementType()) {
-// case IJavaElement.PACKAGE_FRAGMENT :
-// fragment = (IPackageFragment) containerElement;
-// break;
-// case IJavaElement.PACKAGE_FRAGMENT_ROOT :
-// fragmentRoot = (IPackageFragmentRoot) containerElement;
-// break;
-//
-// }
-// try {
-// if (fragmentRoot == null ^ fragment == null) {
-// container = (fragmentRoot != null) ? (IContainer) fragmentRoot.getCorrespondingResource() : (IContainer) fragment.getCorrespondingResource();
-// }
-// } catch (JavaModelException e1) {
-// }
-// }
-// return container;
-// }
-
- private IResource getCorrespondingFileOrFolder(IResource existing, IPath expectedPath, IContainer container) {
- IResource resourceExisting = null;
- switch (existing.getType()) {
- case IResource.FOLDER :
- resourceExisting = container.getFolder(expectedPath);
- break;
- case IResource.FILE :
- resourceExisting = container.getFile(expectedPath);
- break;
- }
- return resourceExisting;
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PostPasteActionOperation.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PostPasteActionOperation.java
deleted file mode 100644
index 644f68e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/PostPasteActionOperation.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 27, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-
-
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class PostPasteActionOperation extends WTPOperation {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
- PasteActionOperationDataModel dataMdl = (PasteActionOperationDataModel) getOperationDataModel();
-
- Map refactoredResourcesMap = (Map) dataMdl.getProperty(PasteActionOperationDataModel.REFACTORED_RESOURCES);
- System.out.println(getClass().getName());
- System.out.println("Map:" + refactoredResourcesMap); //$NON-NLS-1$
-
- Object destination = dataMdl.getProperty(PasteActionOperationDataModel.DESTINATION);
- System.out.println("Destination:" + destination); //$NON-NLS-1$
-
-
-
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/SlaveDescriptor.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/SlaveDescriptor.java
deleted file mode 100644
index 3dc34b6..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/SlaveDescriptor.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 5, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class SlaveDescriptor {
-
- public static final String SLAVE_OPERATION = "slaveOperation"; //$NON-NLS-1$
-
- public static final String ATT_OPERATION_CLASS = "operationClass"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- private static final String ATT_OVERRIDE_ID = "overrideId"; //$NON-NLS-1$
- public static final String ATT_NAME = "name"; //$NON-NLS-1$
- public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
-
- private String id;
- private String name;
- private String description;
- private String operationClass;
- private String overrideId;
- private final IConfigurationElement element;
-
- public SlaveDescriptor(IConfigurationElement element) {
- this.element = element;
- init();
- }
-
- private void init() {
- this.id = this.element.getAttribute(ATT_ID);
- this.overrideId = this.element.getAttribute(ATT_OVERRIDE_ID);
- this.name = this.element.getAttribute(ATT_NAME);
- this.description = this.element.getAttribute(ATT_DESCRIPTION);
- this.operationClass = this.element.getAttribute(ATT_OPERATION_CLASS);
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getName() {
- return name;
- }
-
- public WTPOperation createOperation() {
- try {
- return (WTPOperation) this.element.createExecutableExtension(ATT_OPERATION_CLASS);
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- return null;
- }
-
- /**
- * @return Returns the element.
- */
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- * @return Returns the operationClass.
- */
- public String getOperationClass() {
- return operationClass;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return getClass() + "[name=" + getName() + ", operationClass=" + getOperationClass() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- /**
- * @return Returns the id.
- */
- public String getId() {
- return id;
- }
-
- /**
- * @return Returns the overrideId.
- */
- public String getOverrideId() {
- return overrideId;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/UIOperationExtensionRegistry.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/UIOperationExtensionRegistry.java
deleted file mode 100644
index d6272f5..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/UIOperationExtensionRegistry.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.common.frameworks.internal.operations.OperationExtensionRegistry;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class UIOperationExtensionRegistry extends RegistryReader {
-
- public static final UIOperationExtensionRegistry INSTANCE = new UIOperationExtensionRegistry();
-
- public static final String EXTENSION_POINT = "wtpuiAction"; //$NON-NLS-1$
-
- private Map slaveDescriptorMap;
-
- private Map masterDescriptorMap;
-
- private HashMap overriddingDescriptorMap;
-
- static {
- INSTANCE.readRegistry();
- }
-
- protected UIOperationExtensionRegistry() {
- super(WTPUIPlugin.PLUGIN_ID, EXTENSION_POINT);
- }
-
- public MasterDescriptor[] getExtendedUIOperations(String extendedOperationId, IStructuredSelection selection) {
- if (selection == null || selection.isEmpty())
- return new MasterDescriptor[0];
- List enabledExtendedOperations = new ArrayList();
- List descs = getMasterDescriptorsById(extendedOperationId);
- MasterDescriptor descriptor = null;
- for (Iterator itr = descs.iterator(); itr.hasNext();) {
- descriptor = (MasterDescriptor) itr.next();
- if (descriptor.isEnabledFor(selection) && !isOverridden(descriptor, selection))
- enabledExtendedOperations.add(descriptor);
- }
- if (enabledExtendedOperations.size() == 0)
- return new MasterDescriptor[0];
- MasterDescriptor[] enabledExtendedOperationsArray = new MasterDescriptor[enabledExtendedOperations.size()];
- enabledExtendedOperations.toArray(enabledExtendedOperationsArray);
- return enabledExtendedOperationsArray;
- }
-
- /**
- * @param descriptor
- * @return
- */
- protected boolean isOverridden(MasterDescriptor descriptor, IStructuredSelection selection) {
- MasterDescriptor overriddingDescriptor = getOverriddingDescriptor(descriptor);
- if (overriddingDescriptor == null)
- return false;
- return overriddingDescriptor.isEnabledFor(selection);
- }
-
- /**
- * @param descriptor
- * @return
- */
- protected MasterDescriptor getOverriddingDescriptor(MasterDescriptor descriptor) {
- return (MasterDescriptor) getOverriddingDescriptorMap().get(descriptor.getId());
- }
-
- /**
- * @return
- */
- protected Map getOverriddingDescriptorMap() {
- if (overriddingDescriptorMap == null)
- overriddingDescriptorMap = new HashMap();
- return overriddingDescriptorMap;
- }
-
- public SlaveDescriptor[] getSlaveDescriptors(String parentOperationClass) {
- String[] slaves = OperationExtensionRegistry.getRegisteredOperations(parentOperationClass);
- List slaveDescriptors = new ArrayList();
- SlaveDescriptor slaveDescriptor = null;
- for (int i = 0; null != slaves && i < slaves.length; i++) {
- slaveDescriptor = getSlaveDescriptor(slaves[i]);
- if (slaveDescriptor != null)
- slaveDescriptors.add(slaveDescriptor);
- }
- SlaveDescriptor[] slaveDescriptorsArray = new SlaveDescriptor[slaveDescriptors.size()];
- slaveDescriptors.toArray(slaveDescriptorsArray);
- return slaveDescriptorsArray;
- }
-
- /**
- * @param string
- * @return
- */
- public SlaveDescriptor getSlaveDescriptor(String operationClass) {
- return (SlaveDescriptor) getSlaveDescriptorMap().get(operationClass);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- if (MasterDescriptor.MASTER_OPERATION.equals(element.getName())) {
- MasterDescriptor md = new MasterDescriptor(element);
- addDescriptor(md);
- if (md.getOverrideId() != null && md.getOverrideId().length() > 0)
- getOverriddingDescriptorMap().put(md.getOverrideId(), md);
- } else if (SlaveDescriptor.SLAVE_OPERATION.equals(element.getName())) {
- addDescriptor(new SlaveDescriptor(element));
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * @param descriptor
- */
- protected void addDescriptor(MasterDescriptor descriptor) {
- getMasterDescriptorsById(descriptor.getExtendedOperationId()).add(descriptor);
- }
-
- /**
- * @param descriptor
- */
- protected void addDescriptor(SlaveDescriptor descriptor) {
- getSlaveDescriptorMap().put(descriptor.getOperationClass(), descriptor);
- }
-
- /**
- * @param string
- * @return
- */
- protected List getMasterDescriptorsById(String extendedOperationId) {
- List descs = (List) getMasterDescriptorMap().get(extendedOperationId);
- if (descs == null) {
- getMasterDescriptorMap().put(extendedOperationId, (descs = new ArrayList()));
- }
- return descs;
- }
-
- /**
- * @return
- */
- protected Map getMasterDescriptorMap() {
- if (masterDescriptorMap == null)
- masterDescriptorMap = new HashMap();
- return masterDescriptorMap;
- }
-
- /**
- * @return Returns the slaveDescriptorMap.
- */
- protected Map getSlaveDescriptorMap() {
- if (slaveDescriptorMap == null)
- slaveDescriptorMap = new HashMap();
- return slaveDescriptorMap;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionContentProvider.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionContentProvider.java
deleted file mode 100644
index 2cd231f..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionContentProvider.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 5, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPActionContentProvider implements ITreeContentProvider {
-
- /**
- *
- */
- public WTPActionContentProvider() {
- super();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement) {
- IOperationNode[] children = null;
- if (parentElement instanceof IOperationNode)
- children = ((IOperationNode) parentElement).getChildren();
- return (children != null) ? WTPOptionalOperationDataModel.filterRequiredChildren(children) : new Object[0];
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
-
- if (element instanceof IOperationNode)
- return ((IOperationNode) element).getParent();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
-
- return getChildren(element).length != 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- IOperationNode[] elements = null;
- if (inputElement != null && inputElement instanceof WTPOptionalOperationDataModel) {
- IOperationNode root = ((WTPOptionalOperationDataModel) inputElement).getOperationTree();
- if (root != null)
- elements = root.getChildren();
- }
- return (elements != null) ? WTPOptionalOperationDataModel.filterRequiredChildren(elements) : new Object[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionDialog.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionDialog.java
deleted file mode 100644
index a973f45..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionDialog.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPActionDialog extends Dialog implements WTPOperationDataModelListener {
-
- private ITreeViewerListener actionTreeListener;
-
- private ICheckStateListener checkStateListener;
-
- private ISelectionChangedListener updateDescriptionSelectionListener;
-
- private CheckboxTreeViewer checkboxTreeViewer;
-
- Text descriptionText;
-
- private final WTPOptionalOperationDataModel operationDataModel;
-
- /**
- * This action's id, or <code>null</code> if none.
- */
- private String id;
-
- /**
- * @param arg0
- */
- public WTPActionDialog(Shell arg0, WTPOptionalOperationDataModel operationDataModel) {
- super(arg0);
- this.operationDataModel = operationDataModel;
- this.operationDataModel.addListener(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- return super.createContents(parent);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- getShell().setText(WTPCommonUIResourceHandler.getString("WTPActionDialog_UI_0")); //$NON-NLS-1$
- Composite superComposite = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(superComposite, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = 0; //convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = 0; //convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- layout.numColumns = 1;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // set infopop based on id if id is set
- if (getId() != null)
- WorkbenchHelp.setHelp(composite, getId());
- Label availableFiltersLabel = new Label(composite, SWT.BOLD);
- GridData availableFiltersLabelGridData = new GridData(GridData.FILL_HORIZONTAL);
- availableFiltersLabelGridData.heightHint = convertHeightInCharsToPixels(1);
- availableFiltersLabel.setLayoutData(availableFiltersLabelGridData);
- availableFiltersLabel.setText(WTPCommonUIResourceHandler.getString("WTPActionDialog_UI_0")); //$NON-NLS-1$
-
- checkboxTreeViewer = new CheckboxTreeViewer(composite, SWT.CHECK | SWT.BORDER);
-
- checkboxTreeViewer.setContentProvider(new WTPActionContentProvider());
- checkboxTreeViewer.setLabelProvider(new WTPActionLabelProvider());
-
- checkboxTreeViewer.setInput(this.operationDataModel);
-
- Tree tree = checkboxTreeViewer.getTree();
- GridLayout treeLayout = new GridLayout();
- treeLayout.marginHeight = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- treeLayout.marginWidth = 0; //convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- treeLayout.verticalSpacing = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- treeLayout.horizontalSpacing = 0; //convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- treeLayout.numColumns = 1;
- GridData treeGridData = new GridData(GridData.FILL_HORIZONTAL);
- treeGridData.widthHint = convertHorizontalDLUsToPixels(225);
- treeGridData.heightHint = convertVerticalDLUsToPixels(150);
- tree.setLayout(treeLayout);
- tree.setLayoutData(treeGridData);
-
- descriptionText = new Text(composite, SWT.BORDER | SWT.WRAP);
- GridData descriptionTextGridData = new GridData(GridData.FILL_HORIZONTAL);
- descriptionTextGridData.heightHint = convertHeightInCharsToPixels(3);
- descriptionText.setLayoutData(descriptionTextGridData);
- descriptionText.setBackground(superComposite.getBackground());
-
- initListeners();
- updateCheckedItems();
-
- return composite;
- }
-
- /**
- *
- */
- protected void initListeners() {
- checkboxTreeViewer.addCheckStateListener(getCheckStateListener());
- checkboxTreeViewer.addSelectionChangedListener(getSelectionListener());
- checkboxTreeViewer.addTreeListener(getActionTreeListener());
- }
-
- /**
- * @return
- */
- protected ICheckStateListener getCheckStateListener() {
- if (checkStateListener == null)
- checkStateListener = new CheckStateListener();
- return checkStateListener;
- }
-
-
-
- public class CheckStateListener implements ICheckStateListener {
-
- public void checkStateChanged(CheckStateChangedEvent event) {
- boolean checked = event.getChecked();
- IOperationNode node = (IOperationNode) event.getElement();
- node.setChecked(checked);
- }
- }
-
- public class TreeViewerListener implements ITreeViewerListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- public void treeCollapsed(TreeExpansionEvent event) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- public void treeExpanded(TreeExpansionEvent event) {
- }
- }
-
- public class SelectionChangedListener implements ISelectionChangedListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
-
- IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
- Object element = structuredSelection.getFirstElement();
- String text = ""; //$NON-NLS-1$
- if (element instanceof IOperationNode)
- text = ((IOperationNode) element).getDescription();
- descriptionText.setText(text != null ? text : ""); //$NON-NLS-1$
- }
-
- }
-
- /**
- * @return
- */
- private ISelectionChangedListener getSelectionListener() {
- if (updateDescriptionSelectionListener == null)
- updateDescriptionSelectionListener = new SelectionChangedListener();
- return updateDescriptionSelectionListener;
- }
-
- /**
- * @return
- */
- private ITreeViewerListener getActionTreeListener() {
- if (actionTreeListener == null)
- actionTreeListener = new TreeViewerListener();
- return actionTreeListener;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelListener#propertyChanged(org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelEvent)
- */
- public void propertyChanged(WTPOperationDataModelEvent event) {
- switch (event.getFlag()) {
- case WTPOperationDataModelEvent.PROPERTY_CHG :
- if (WTPOptionalOperationDataModel.OPERATION_TREE.equals(event.getPropertyName()))
- updateCheckedItems();
- break;
- }
- }
-
- /**
- *
- */
- private void updateCheckedItems() {
- IOperationNode root = (IOperationNode) this.operationDataModel.getProperty(WTPOptionalOperationDataModel.OPERATION_TREE);
- updateCheckedState(root);
-
- }
-
- /**
- * @param root
- */
- private void updateCheckedState(IOperationNode root) {
- if (root == null)
- return;
-
- IOperationNode[] children = root.getChildren();
- if (children == null)
- return;
- for (int i = 0; i < children.length; i++) {
- checkboxTreeViewer.setChecked(children[i], children[i].isChecked());
- boolean disabled = (children[i].getParent() != null) ? children[i].getParent().isChecked() : false;
- checkboxTreeViewer.setGrayed(children[i], disabled);
- updateCheckedState(children[i]);
- }
- }
-
- /**
- * @return Returns the id.
- */
- public String getId() {
- return id;
- }
-
- /**
- * @param id
- * The id to set.
- */
- public void setId(String id) {
- this.id = id;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionLabelProvider.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionLabelProvider.java
deleted file mode 100644
index 06bfdc4..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPActionLabelProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 5, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPActionLabelProvider implements ILabelProvider {
-
- /**
- *
- */
- public WTPActionLabelProvider() {
- super();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object,
- * java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
-
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IOperationNode)
- return ((IOperationNode) element).getName();
-
- return element.toString();
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOperationDataModelUICreator.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOperationDataModelUICreator.java
deleted file mode 100644
index e8109ac..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOperationDataModelUICreator.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public interface WTPOperationDataModelUICreator {
-
- WTPOperationDataModel createDataModel(String extendedOperationId, String operationClass, IStructuredSelection selection, IWorkbenchSite site);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOptionalOperationDataModel.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOptionalOperationDataModel.java
deleted file mode 100644
index 994a92f..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WTPOptionalOperationDataModel.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 5, 2004
- *
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.wst.common.frameworks.internal.operations.ComposedOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin;
-
-
-/**
- * @author jsholl
- *
- */
-public class WTPOptionalOperationDataModel extends WTPOperationDataModel {
-
-
-
- /**
- * String, this is required along with a STRUCTURED_SELECTION unless MASTER_OPERATION_LIST is
- * set
- */
- public static final String EXTENDED_OPERATION_ID = "WTPOptionalOperationDataModel.EXTENDED_OPERATION_ID"; //$NON-NLS-1$
-
- /**
- * IStructuredSelection, this is required along with a EXTENDED_OPERATION_ID unless
- * MASTER_OPERATION_LIST is set
- */
- public static final String STRUCTURED_SELECTION = "WTPOptionalOperationDataModel.STRUCTURED_SELECTION"; //$NON-NLS-1$
-
- /**
- * List of MasterDescriptor, required unless both EXTENDED_OPERATION_ID and STRUCTURED_SELECTION
- * are set
- */
- public static final String MASTER_OPERATION_LIST = "WTPOptionalOperationDataModel.MASTER_OPERATION_LIST"; //$NON-NLS-1$
-
- /**
- * A root IOperationNode whose operation is null and children are the contents of the
- * MASTER_OPERATION_LIST
- */
- public static final String OPERATION_TREE = "WTPOptionalOperationDataModel.OPERATION_TREE"; //$NON-NLS-1$
-
- /**
- * Optional. Allow the WTPOperationDataModelUICreators access to the workbench site for
- * additional initializations.
- */
- public static final String IWORKBENCH_SITE = "IWORKBENCH_SITE"; //$NON-NLS-1$
-
- public static WTPOptionalOperationDataModel createDataModel(String extendedOperationId, IStructuredSelection selection) {
- WTPOptionalOperationDataModel dataModel = new WTPOptionalOperationDataModel();
- dataModel.setProperty(EXTENDED_OPERATION_ID, extendedOperationId);
- dataModel.setProperty(STRUCTURED_SELECTION, selection);
- return dataModel;
- }
-
- private class OperationNode implements IOperationNode {
-
- private WTPOperationDataModel dataModel = null;
-
- private SlaveDescriptor descriptor = null;
-
- private List children = null;
-
- private OperationNode parent = null;
-
- private boolean checked = false;
-
- public OperationNode(OperationNode parent, SlaveDescriptor descriptor) {
- this.parent = parent;
- this.descriptor = descriptor;
- verifyRoot();
- }
-
- private void verifyRoot() {
- if (null == parent) {
- return;
- }
- IOperationNode root = getOperationTree();
- OperationNode node = this;
- while (node.parent != null) {
- node = node.parent;
- }
- if (node != root) {
- throw new RuntimeException();
- }
- }
-
- public String getName() {
- return descriptor.getName();
- }
-
- public String getDescription() {
- return descriptor.getDescription();
- }
-
- public WTPOperationDataModel getDataModel() {
- IWorkbenchSite site = (IWorkbenchSite) getProperty(IWORKBENCH_SITE);
- if (dataModel == null) {
- IOperationNode root = getOperationTree();
- if (this.parent == root) {
- MasterDescriptor masterDescriptor = (MasterDescriptor) descriptor;
- dataModel = masterDescriptor.getCreator().createDataModel(masterDescriptor.getExtendedOperationId(), masterDescriptor.getOperationClass(), getStructuredSelection(), site);
- } else
- dataModel = parent.getDataModel();
- }
- return dataModel;
- }
-
- public WTPOperation getOperation() {
- WTPOperation operation = descriptor.createOperation();
- WTPOperationDataModel dataModel1 = getDataModel();
- if (dataModel1 != null) {
- if (operation == null)
- operation = dataModel.getDefaultOperation();
- else
- operation.setOperationDataModel(dataModel);
- }
- return operation;
- }
-
- public IOperationNode[] getChildren() {
- verifyRoot();
- return getChildren(true);
- }
-
- public IOperationNode[] getChildren(boolean expandChildren) {
- if (expandChildren && null == children && null != parent) {
- children = new ArrayList();
- SlaveDescriptor[] slaveDescriptors = UIOperationExtensionRegistry.INSTANCE.getSlaveDescriptors(descriptor.getOperationClass());
- for (int i = 0; null != slaveDescriptors && i < slaveDescriptors.length; i++) {
- OperationNode child = new OperationNode(this, slaveDescriptors[i]);
- child.checked = checked;
- addChild(child);
- }
- }
- if (null == children) {
- return null;
- }
- OperationNode[] childNodes = new OperationNode[children.size()];
- children.toArray(childNodes);
- return childNodes;
- }
-
- public void clearChildren() {
- if (null != children) {
- children.clear();
- }
- }
-
- public void addChild(OperationNode childNode) {
- if (null == children) {
- children = new ArrayList();
- }
- children.add(childNode);
- }
-
- public boolean isChecked() {
- verifyRoot();
- if (descriptor instanceof MasterDescriptor && ((MasterDescriptor) descriptor).isAlwaysExecute())
- return true;
- return checked;
- }
-
- public void setChecked(boolean checked) {
- if (descriptor instanceof MasterDescriptor && ((MasterDescriptor) descriptor).isAlwaysExecute())
- return;
- internalSetChecked(checked);
- Object root = getProperty(OPERATION_TREE);
- notifyListeners(OPERATION_TREE, root, root);
- }
-
- public IOperationNode getParent() {
- return parent;
- }
-
- protected void internalSetChecked(boolean checked1) {
- this.checked = checked1;
- if (checked) {
- OperationNode[] children1 = (OperationNode[]) getChildren(false);
- for (int i = 0; null != children && i < children1.length; i++)
- children1[i].internalSetChecked(checked);
- } else {
- if (this.parent != null)
- this.parent.internalSetChecked(checked);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.extension.ui.IOperationNode#isAlwaysExecute()
- */
- public boolean isAlwaysExecute() {
- if (descriptor instanceof MasterDescriptor && ((MasterDescriptor) descriptor).isAlwaysExecute())
- return true;
- return false;
- }
- }
-
- protected void init() {
- super.init();
- setProperty(OPERATION_TREE, new OperationNode(null, null));
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(MASTER_OPERATION_LIST);
- addValidBaseProperty(OPERATION_TREE);
- addValidBaseProperty(STRUCTURED_SELECTION);
- addValidBaseProperty(EXTENDED_OPERATION_ID);
- addValidBaseProperty(IWORKBENCH_SITE);
- }
-
- IStructuredSelection getStructuredSelection() {
- return (IStructuredSelection) getProperty(STRUCTURED_SELECTION);
- }
-
- public IOperationNode getOperationTree() {
- return (IOperationNode) getProperty(OPERATION_TREE);
- }
-
- public static IOperationNode[] getOptionalChildren(IOperationNode node) {
- IOperationNode[] children = node.getChildren();
- children = filterRequiredChildren(children);
- return children;
- }
-
- /**
- * @param children
- * @return
- */
- public static IOperationNode[] filterRequiredChildren(IOperationNode[] children) {
- List filteredChildren = new ArrayList(Arrays.asList(children));
- for (int i = 0; i < children.length; i++)
- if (children[i].isAlwaysExecute())
- filteredChildren.remove(children[i]);
- filteredChildren.toArray((children = new IOperationNode[filteredChildren.size()]));
- return children;
- }
-
- protected boolean doSetProperty(String propertyName, Object propertyValue) {
- boolean returnVal = super.doSetProperty(propertyName, propertyValue);
- if (propertyName.equals(STRUCTURED_SELECTION) || propertyName.equals(EXTENDED_OPERATION_ID)) {
- String extendedOperationID = getStringProperty(EXTENDED_OPERATION_ID);
- IStructuredSelection selection = (IStructuredSelection) getProperty(STRUCTURED_SELECTION);
- setProperty(MASTER_OPERATION_LIST, UIOperationExtensionRegistry.INSTANCE.getExtendedUIOperations(extendedOperationID, selection));
- }
- if (propertyName.equals(MASTER_OPERATION_LIST)) {
- OperationNode rootNode = (OperationNode) getOperationTree();
- rootNode.clearChildren();
- MasterDescriptor[] descriptors = (MasterDescriptor[]) propertyValue;
- if (null != descriptors) {
- for (int i = 0; i < descriptors.length; i++) {
- OperationNode child = new OperationNode(rootNode, descriptors[i]);
- child.setChecked(true);
- rootNode.addChild(child);
- }
- }
- notifyListeners(OPERATION_TREE, rootNode, rootNode);
- }
- return returnVal;
- }
-
- public WTPOperation getDefaultOperation() {
- ComposedOperation operation = new ComposedOperation();
- OperationNode root = (OperationNode) getOperationTree();
- addOperationIfNecessary(operation, root);
- return operation;
- }
-
- private void addOperationIfNecessary(ComposedOperation operation, OperationNode node) {
- if (node.isAlwaysExecute() || node.isChecked()) {
- WTPOperation op = node.getOperation();
- if (op != null)
- operation.addRunnable(op);
- } else {
- IOperationNode[] children = node.getChildren(false);
- for (int i = 0; null != children && i < children.length; i++)
- addOperationIfNecessary(operation, (OperationNode) children[i]);
- }
- }
-
- private boolean hasSelectedNodes(OperationNode node) {
- if (node.isChecked()) {
- return true;
- }
- boolean foundSelection = false;
- OperationNode[] children = (OperationNode[]) node.getChildren(false);
- for (int i = 0; !foundSelection && null != children && i < children.length; i++) {
- foundSelection = hasSelectedNodes(children[i]);
- }
- return foundSelection;
- }
-
- protected IStatus doValidateProperty(String propertyName) {
- if (propertyName.equals(OPERATION_TREE)) {
- OperationNode root = (OperationNode) getOperationTree();
- if (root.isChecked()) {
- return WTPUIPlugin.createErrorStatus(WTPCommonUIResourceHandler.getString("WTPOptionalOperationDataModel_UI_0")); //$NON-NLS-1$
- } else if (!hasSelectedNodes(root)) {
- return WTPUIPlugin.createErrorStatus(WTPCommonUIResourceHandler.getString("WTPOptionalOperationDataModel_UI_1"));} //$NON-NLS-1$
- }
- return super.doValidateProperty(propertyName);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardExtensionFactory.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardExtensionFactory.java
deleted file mode 100644
index d539adf..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardExtensionFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-
-public abstract class WizardExtensionFactory {
-
- public WizardExtensionFactory() {
- super();
- }
-
- public abstract IExtendedWizardPage[] createPageGroup(WTPOperationDataModel dataModel, String pageGroupID);
-
- /*
- * this is optional
- */
- public IExtendedPageHandler createPageHandler(WTPOperationDataModel dataModel, String pageGroupID) {
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageElement.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageElement.java
deleted file mode 100644
index 76f5be1..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageElement.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.AbstractRegistryDescriptor;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclispe.wst.common.frameworks.internal.enablement.IdentifiableComparator;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-public class WizardPageElement extends AbstractRegistryDescriptor implements Comparable {
- /** Type designation for an {@link ExtendedEditorPage} */
- public static final int EXTENDED_EDITOR_PAGE = 0;
- /** Type designation for a nested editor */
- public static final int NESTED_EDITOR = 1;
- static final String[] EMPTY_STRING_ARRAY = new String[0];
- static final String ELEMENT_PAGE_GROUP = "wizardPageGroup"; //$NON-NLS-1$
- static final String ATT_PAGE_ID = "pageGroupID"; //$NON-NLS-1$
- static final String ATT_WIZARD_ID = "wizardID"; //$NON-NLS-1$
- static final String ATT_GROUP_ID = "groupID"; //$NON-NLS-1$
- static final String ATT_ALLOWS_EXTENDED_PAGES_AFTER = "allowsExtendedPagesAfter"; //$NON-NLS-1$
- static final String ATT_PAGE_INSERTION_ID = "pageGroupInsertionID"; //$NON-NLS-1$
- static final String ELEMENT_FACTORY = "factory"; //$NON-NLS-1$
-
- protected WizardPageFactoryElement wizardPageFactoryElement;
- protected String pluginID;
- protected String wizardID;
- protected String pageGroupID;
- protected String wizardFactoryElement;
- protected boolean allowsExtendedPagesAfter;
- protected String pageInsertionID;
- private int loadOrder;
- private static int loadOrderCounter;
-
-
- private int type;
-
- public WizardPageElement(IConfigurationElement element1) {
- super(element1);
- pluginID = element1.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier();
- wizardID = element1.getAttribute(ATT_WIZARD_ID);
- pageGroupID = element1.getAttribute(ATT_PAGE_ID);
- readAllowsExtendedPageAfter(element1);
- pageInsertionID = element1.getAttribute(ATT_PAGE_INSERTION_ID);
- readFactory(element1);
- validateSettings();
- loadOrder = loadOrderCounter++;
- }
-
- private void validateSettings() {
- if (wizardID == null || wizardPageFactoryElement == null) {
- Logger.getLogger().logError("Incomplete page extension specification."); //$NON-NLS-1$
- }
- }
-
-
- private void readAllowsExtendedPageAfter(IConfigurationElement element1) {
- String allowsPageAfterValue = element1.getAttribute(ATT_ALLOWS_EXTENDED_PAGES_AFTER);
- allowsExtendedPagesAfter = allowsPageAfterValue == null ? false : Boolean.valueOf(allowsPageAfterValue).booleanValue();
- }
-
- private void readFactory(IConfigurationElement element1) {
- IConfigurationElement[] factories = element1.getChildren(ELEMENT_FACTORY);
- if (factories != null && factories.length > 0) {
- wizardPageFactoryElement = new WizardPageFactoryElement(factories[0], pageGroupID);
- }
- }
-
- public IExtendedPageHandler createPageHandler(WTPOperationDataModel dataModel) {
- if (wizardPageFactoryElement != null)
- return wizardPageFactoryElement.createPageHandler(dataModel);
- return null;
- }
-
- public IExtendedWizardPage[] createPageGroup(WTPOperationDataModel dataModel) {
- if (wizardPageFactoryElement != null)
- return wizardPageFactoryElement.createPageGroup(dataModel);
- return null;
- }
-
-
- public int compareTo(Object o) {
- return IdentifiableComparator.getInstance().compare(this, o);
- /*
- * if (o == null) return GREATER_THAN; WizardPageElement element = (WizardPageElement) o; if
- * (getID() == null && element.getID() == null) return compareLoadOrder(element); if
- * (getID() == null) return GREATER_THAN; else if (element.getID() == null) return
- * LESS_THAN;
- *
- * int priority = getPriority(); int elementPriority =element.getPriority();
- *
- * if (priority == elementPriority) return compareLoadOrder(element); if (priority <
- * elementPriority) return GREATER_THAN; if (priority > elementPriority) return LESS_THAN;
- * return EQUAL;
- */
- }
-
- /**
- * @return
- */
- public boolean allowsExtendedPagesAfter() {
- return allowsExtendedPagesAfter;
- }
-
- /**
- * @return
- */
- public String getPluginID() {
- return pluginID;
- }
-
- /**
- * @return
- */
- public String getPageID() {
- return pageGroupID;
- }
-
- /**
- * @return
- */
- public String getPageInsertionID() {
- return pageInsertionID;
- }
-
- /**
- * @return
- */
- public int getType() {
- return type;
- }
-
- /**
- * @return
- */
- public int getLoadOrder() {
- return loadOrder;
- }
-
-
- /**
- * @return Returns the allowsExtendedPagesAfter.
- */
- public boolean isAllowsExtendedPagesAfter() {
- return allowsExtendedPagesAfter;
- }
-
- /**
- * @param allowsExtendedPagesAfter
- * The allowsExtendedPagesAfter to set.
- */
- public void setAllowsExtendedPagesAfter(boolean allowsExtendedPagesAfter) {
- this.allowsExtendedPagesAfter = allowsExtendedPagesAfter;
- }
-
- /**
- * @return Returns the wizardFactoryElement.
- */
- public String getWizardFactoryElement() {
- return wizardFactoryElement;
- }
-
- /**
- * @param wizardFactoryElement
- * The wizardFactoryElement to set.
- */
- public void setWizardFactoryElement(String wizardFactoryElement) {
- this.wizardFactoryElement = wizardFactoryElement;
- }
-
- /**
- * @return Returns the wizardID.
- */
- public String getWizardID() {
- return wizardID;
- }
-
- /**
- * @param wizardID
- * The wizardID to set.
- */
- public void setWizardID(String wizardID) {
- this.wizardID = wizardID;
- }
-
- /**
- * @return Returns the wizardPageFactoryElement.
- */
- public WizardPageFactoryElement getWizardPageFactoryElement() {
- return wizardPageFactoryElement;
- }
-
- /**
- * @param wizardPageFactoryElement
- * The wizardPageFactoryElement to set.
- */
- public void setWizardPageFactoryElement(WizardPageFactoryElement wizardPageFactoryElement) {
- this.wizardPageFactoryElement = wizardPageFactoryElement;
- }
-
-
- /**
- * @param pageID
- * The pageID to set.
- */
- public void setPageID(String pageID) {
- this.pageGroupID = pageID;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.AbstractRegistryDescriptor#getID()
- */
- public String getID() {
- return getPageID();
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageExtensionManager.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageExtensionManager.java
deleted file mode 100644
index 7e97e40..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageExtensionManager.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementManager;
-
-import com.ibm.wtp.common.RegistryReader;
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-public class WizardPageExtensionManager {
-
- public static final String ORG_ECLIPSE_UI = "org.eclipse.ui"; //$NON-NLS-1$
-
- protected static WizardPageExtensionManager instance = null;
-
- HashMap wizardPluginIDMap = null;
-
- TreeMap wizardPageElements = null;
-
- //private TreeSet wizardExtPageElements = null;
- List nonSyncedPageElementList = null;
-
- private WizardPageExtensionReader reader = null;
-
- private WizardPageExtensionManager() {
- setupWizardPluginIDMap();
- readFromRegistry();
- postReadFromRegistry();
- }
-
- private void setupWizardPluginIDMap() {
- wizardPluginIDMap = new HashMap();
- // get editor plugin and save it to a hash map
- // Note: editors extension id is different from editor id
-
- IExtensionPoint[] point = new IExtensionPoint[]{Platform.getPluginRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "exportWizards"), //$NON-NLS-1$
- Platform.getPluginRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "importWizards"), //$NON-NLS-1$
- Platform.getPluginRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "newWizards"), //$NON-NLS-1$
- Platform.getPluginRegistry().getExtensionPoint("org.eclipse.wst.common.frameworks.ui", "extendableWizard")}; //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int x = 0; x < point.length; x++) {
- IConfigurationElement[] elements = point[x].getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- String wizardID = elements[i].getAttribute("id"); //$NON-NLS-1$
- String pluginID = elements[i].getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier();
- wizardPluginIDMap.put(wizardID, pluginID);
- }
- }
- }
-
- private void readFromRegistry() {
- wizardPageElements = new TreeMap();
- //wizardExtPageElements = new TreeSet();
- nonSyncedPageElementList = new ArrayList();
- // Read all page extensions into editorPageElements
- reader = new WizardPageExtensionReader();
- reader.readRegistry();
-
- }
-
- protected class WizardPageExtensionReader extends RegistryReader {
-
- public WizardPageExtensionReader() {
- super(CommonUIPluginConstants.PLUGIN_ID, WizardPageElement.ELEMENT_PAGE_GROUP);
- }
-
- public boolean readElement(IConfigurationElement element) {
- if (!WizardPageElement.ELEMENT_PAGE_GROUP.equals(element.getName()))
- return false;
- WizardPageElement newElement = new WizardPageElement(element);
-
- // put the element into a hashmap, wizardID as key,
- // list of page elements as object
- String wizardID = newElement.getWizardID();
- if (!wizardPageElements.containsKey(wizardID)) {
- wizardPageElements.put(wizardID, createPageMapEntry(newElement));
- } else {
- TreeMap pageMap = (TreeMap) wizardPageElements.get(wizardID);
- insertPageElement(pageMap, newElement);
- }
-
- return true;
- }
-
- public void insertPageElement(TreeMap pageMap, WizardPageElement newElement) {
- if (newElement.pageInsertionID == null) {
- pageMap.put(newElement, new TreeSet());
- } else {
- String elementName = newElement.pageInsertionID;
- WizardPageElement parentElement = getPageElement(elementName, pageMap);
- insertExtPageElement(pageMap, parentElement, newElement);
- }
-
- newElement.getPageInsertionID();
-
- }
-
- private void insertExtPageElement(TreeMap pageMap, WizardPageElement parentElement, WizardPageElement newElement) {
- if (parentElement == null) {
- nonSyncedPageElementList.add(newElement);
- return;
- }
- if (!parentElement.allowsExtendedPagesAfter()) {
- Logger.getLogger().logError(WTPCommonUIResourceHandler.getString("WizardPageExtensionManager_UI_0", new Object[]{parentElement.getPageID()})); //$NON-NLS-1$
- Logger.getLogger().logError(WTPCommonUIResourceHandler.getString("WizardPageExtensionManager_UI_1", new Object[]{newElement.getPageID()})); //$NON-NLS-1$
- return;
- }
- TreeSet set = (TreeSet) pageMap.get(parentElement);
- set.add(newElement);
-
- if (newElement.allowsExtendedPagesAfter)
- pageMap.put(newElement, new TreeSet());
-
- if (nonSyncedPageElementList.contains(newElement))
- nonSyncedPageElementList.remove(newElement);
- }
-
- private WizardPageElement getPageElement(String elementName, TreeMap map) {
- Set keySet = map.keySet();
- for (Iterator iter = keySet.iterator(); iter.hasNext();) {
- WizardPageElement element = (WizardPageElement) iter.next();
- if (element.getPageID().equals(elementName))
- return element;
- }
- return null;
-
- }
-
- private TreeMap createPageMapEntry(WizardPageElement newElement) {
- TreeMap pageMap = new TreeMap();
- TreeSet pageExtensionSet = new TreeSet();
- pageMap.put(newElement, pageExtensionSet);
- return pageMap;
-
- }
-
- }
-
- public boolean hasExtensionElements(String wizardID) {
- TreeMap treeMap = (TreeMap) wizardPageElements.get(wizardID);
- return treeMap.isEmpty();
- }
-
- public WizardPageElement[] getPageElements(String wizardID) {
- TreeMap elementMap = (TreeMap) wizardPageElements.get(wizardID);
- if (elementMap == null || elementMap.isEmpty()) {
- return new WizardPageElement[0];
- }
- ArrayList alreadyVistedList = new ArrayList(elementMap.size());
- Set allPageElementsList = elementMap.keySet();
- ArrayList orderedPageList = new ArrayList(elementMap.size());
-
- for (Iterator iter = allPageElementsList.iterator(); iter.hasNext();) {
- WizardPageElement element = (WizardPageElement) iter.next();
- if (alreadyVistedList.contains(element))
- continue;
- if (EnablementManager.INSTANCE.getIdentifier(element.getID(), null).isEnabled()) {
- orderedPageList.add(element);
- TreeSet treeSet = (TreeSet) elementMap.get(element);
- if (treeSet != null && !treeSet.isEmpty())
- flatenTreeSet(treeSet, allPageElementsList, alreadyVistedList, orderedPageList, elementMap);
- }
- }
- return getPageArray(orderedPageList);
-
- }
-
- private WizardPageElement[] getPageArray(ArrayList orderedPageList) {
- WizardPageElement[] pageElements = new WizardPageElement[orderedPageList.size()];
- for (int i = 0; i < orderedPageList.size(); i++) {
- pageElements[i] = (WizardPageElement) orderedPageList.get(i);
- }
- return pageElements;
- }
-
- private void flatenTreeSet(TreeSet treeSet, Set allPageElementsList, ArrayList alreadyVistedList, ArrayList orderedPageList, TreeMap elementMap) {
- for (Iterator iter = treeSet.iterator(); iter.hasNext();) {
- WizardPageElement element = (WizardPageElement) iter.next();
- if (alreadyVistedList.contains(element)) {
- Logger.getLogger().logError(WTPCommonUIResourceHandler.getString("WizardPageExtensionManager_UI_2", new Object[]{element.getPageID(), WizardPageElement.ATT_PAGE_INSERTION_ID})); //$NON-NLS-1$
- return;
- }
- if (allPageElementsList.contains(element)) {
- TreeSet set = (TreeSet) elementMap.get(element);
- orderedPageList.add(element);
- alreadyVistedList.add(element);
- flatenTreeSet(set, allPageElementsList, alreadyVistedList, orderedPageList, elementMap);
- } else {
- orderedPageList.add(element);
- alreadyVistedList.add(element);
- }
-
- }
-
- }
-
- // if child elements are read in before parent element. Do post read.
- protected ArrayList listRemoveObjects;
-
- private void postReadFromRegistry() {
- listRemoveObjects = new ArrayList(nonSyncedPageElementList.size());
- for (int i = 0; i < nonSyncedPageElementList.size(); i++) {
- WizardPageElement element = (WizardPageElement) nonSyncedPageElementList.get(i);
- TreeMap pageMap = (TreeMap) wizardPageElements.get(element.wizardID);
- if (element.pageInsertionID == null) {
- addToFirstAvialiable(pageMap, element);
- } else if (reader != null && pageMap != null)
- reader.insertPageElement(pageMap, element);
- }
- nonSyncedPageElementList.removeAll(listRemoveObjects);
- if (!nonSyncedPageElementList.isEmpty())
- logMissingClassError();
- nonSyncedPageElementList.clear();
-
- }
-
- /**
- * @param pageMap
- * @param element
- */
- private void addToFirstAvialiable(TreeMap pageMap, WizardPageElement newElement) {
- boolean insertNotFound = true;
- for (Iterator iter = pageMap.keySet().iterator(); iter.hasNext();) {
- WizardPageElement element = (WizardPageElement) iter.next();
- if (element.allowsExtendedPagesAfter) {
- TreeSet set = (TreeSet) pageMap.get(element);
- set.add(newElement);
- listRemoveObjects.add(newElement);
- return;
- }
- }
- if (insertNotFound) {
- Logger logger = Logger.getLogger();
- logger.logError(WTPCommonUIResourceHandler.getString("WizardPageExtensionManager_UI_3")); //$NON-NLS-1$
- }
-
- }
-
- private void logMissingClassError() {
- Logger logger = Logger.getLogger();
- for (int i = 0; i < nonSyncedPageElementList.size(); i++) {
- WizardPageElement element = (WizardPageElement) nonSyncedPageElementList.get(i);
- logger.logError(WTPCommonUIResourceHandler.getString("WizardPageExtensionManager_UI_4", new Object[]{element.pageInsertionID, element.getPageID(), element.pluginID})); //$NON-NLS-1$
- }
- nonSyncedPageElementList.clear();
-
- }
-
- /**
- * Gets the instance.
- *
- * @return Returns a EjbPageExtensionRegistry
- */
- public static WizardPageExtensionManager getInstance() {
- if (instance == null) {
- instance = new WizardPageExtensionManager();
- }
- return instance;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageFactoryElement.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageFactoryElement.java
deleted file mode 100644
index 802ae5d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/operation/extensionui/WizardPageFactoryElement.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 20, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operation.extensionui;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.ConfigurationElementWrapper;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class WizardPageFactoryElement extends ConfigurationElementWrapper {
-
- static final String ATT_CLASS_NAME = "className"; //$NON-NLS-1$
-
- protected String className;
- protected WizardExtensionFactory wizardPageFactory;
- protected boolean isPageFactoryInitialized;
- protected String pageGroupID;
-
- /**
- * @param element
- */
- public WizardPageFactoryElement(IConfigurationElement element, String pageGroupID) {
- super(element);
- className = element.getAttribute(ATT_CLASS_NAME);
- this.pageGroupID = pageGroupID;
- }
-
- public IExtendedPageHandler createPageHandler(WTPOperationDataModel dataModel) {
- if (!isPageFactoryInitialized)
- initPageFactory();
- if (wizardPageFactory == null)
- return null;
-
- IExtendedPageHandler handler = wizardPageFactory.createPageHandler(dataModel, pageGroupID);
- return handler;
- }
-
- public IExtendedWizardPage[] createPageGroup(WTPOperationDataModel dataModel) {
- if (!isPageFactoryInitialized)
- initPageFactory();
-
- if (wizardPageFactory == null)
- return null;
-
- IExtendedWizardPage[] pages = wizardPageFactory.createPageGroup(dataModel, pageGroupID);
- for (int i = 0; i < pages.length; i++) {
- pages[i].setGroupID(pageGroupID);
- }
- return pages;
- }
-
- private void initPageFactory() {
- try {
- wizardPageFactory = (WizardExtensionFactory) element.createExecutableExtension(ATT_CLASS_NAME);
- } catch (CoreException e) {
- Logger.getLogger().logError("Error getting page factory: " + className); //$NON-NLS-1$
- Logger.getLogger().logError(e);
- } finally {
- isPageFactoryInitialized = true;
- }
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/AbstractWTPUIPlugin.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/AbstractWTPUIPlugin.java
deleted file mode 100644
index b2477db..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/AbstractWTPUIPlugin.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Dec 10, 2003
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-import com.ibm.wtp.logger.proxyrender.DefaultPluginTraceRenderer;
-import com.ibm.wtp.logger.proxyrender.IMsgLogger;
-
-public abstract class AbstractWTPUIPlugin extends AbstractUIPlugin implements IMsgLogger {
- protected static Logger logger = null;
-
- /**
- * @param descriptor
- */
- public AbstractWTPUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- }
-
- public Logger getMsgLogger() {
- if (logger == null) {
- logger = Logger.getLogger(getPluginID());
- setRenderer(logger);
- }
- return logger;
- }
-
- public abstract String getPluginID();
-
- /**
- * @param aLogger
- */
- protected void setRenderer(Logger aLogger) {
- new DefaultPluginTraceRenderer(aLogger);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ClosableWizardDialog.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ClosableWizardDialog.java
deleted file mode 100644
index 7316c8b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ClosableWizardDialog.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Mar 24, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author DABERG
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class ClosableWizardDialog extends WizardDialog {
- /**
- * @param parentShell
- * @param newWizard
- */
- public ClosableWizardDialog(Shell parentShell, IWizard newWizard) {
- super(parentShell, newWizard);
- }
-
- public void finishAndClose() {
- super.finishPressed();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/DisplayUtility.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/DisplayUtility.java
deleted file mode 100644
index 647f58e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/DisplayUtility.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 19, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mdelder
- */
-public class DisplayUtility {
-
- public static void asyncExec(Runnable runnable) {
-
- Display d = Display.getCurrent();
- if (d == null)
- Display.getDefault().asyncExec(runnable);
- else
- runnable.run();
-
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ErrorDialog.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ErrorDialog.java
deleted file mode 100644
index 9cd3cf1..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ErrorDialog.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Added a Details button to the MessageDialog to show the exception stack trace.
- *
- * Borrowed from an eclipse InternalErrorDialog
- */
-public class ErrorDialog extends MessageDialog {
- protected static final String[] LABELS_OK = {IDialogConstants.OK_LABEL};
- protected static final String[] LABELS_OK_CANCEL = {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL};
- protected static final String[] LABELS_OK_DETAILS = {IDialogConstants.OK_LABEL, IDialogConstants.SHOW_DETAILS_LABEL};
- protected static final String[] LABELS_OK_CANCEL_DETAILS = {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL, IDialogConstants.SHOW_DETAILS_LABEL};
- private Throwable detail;
- private int detailButtonID = -1;
- private Text text;
- private String message;
- //Workaround. SWT does not seem to set the default button if
- //there is not control with focus. Bug: 14668
- private int defaultButtonIndex = 0;
- /**
- * Size of the text in lines.
- */
- private static final int TEXT_LINE_COUNT = 15;
-
- public ErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, Throwable detail, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- defaultButtonIndex = defaultIndex;
- this.detail = detail;
- message = dialogMessage;
- setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.RESIZE);
- }
-
- //Workaround. SWT does not seem to set rigth the default button if
- //there is not control with focus. Bug: 14668
- public int open() {
- create();
- Button b = getButton(defaultButtonIndex);
- b.setFocus();
- b.getShell().setDefaultButton(b);
- return super.open();
- }
-
- /**
- * Set the detail button;
- */
- public void setDetailButton(int index) {
- detailButtonID = index;
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == detailButtonID) {
- toggleDetailsArea();
- } else {
- setReturnCode(buttonId);
- close();
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user pressing the details
- * button.
- */
- private void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- if (text != null) {
- text.dispose();
- text = null;
- getButton(detailButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- createDropDownText((Composite) getContents());
- getButton(detailButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
- Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- }
-
- /**
- * Create this dialog's drop-down list component.
- *
- * @param parent
- * the parent composite
- * @return the drop-down list component
- */
- protected void createDropDownText(Composite parent) {
- // create the list
- text = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- // print the stacktrace in the text field
- try {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- detail.printStackTrace(ps);
- if ((detail instanceof SWTError) && (((SWTError) detail).throwable != null)) {
- ps.println("\n*** Stack trace of contained exception ***"); //$NON-NLS-1$
- ((SWTError) detail).throwable.printStackTrace(ps);
- } else if ((detail instanceof SWTException) && (((SWTException) detail).throwable != null)) {
- ps.println("\n*** Stack trace of contained exception ***"); //$NON-NLS-1$
- ((SWTException) detail).throwable.printStackTrace(ps);
- }
- ps.flush();
- baos.flush();
- text.setText(baos.toString());
- } catch (IOException e) {
- }
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- data.heightHint = text.getLineHeight() * TEXT_LINE_COUNT;
- text.setLayoutData(data);
- }
-
- public static boolean openError(Shell parent, String title, String message, Throwable detail, int defaultIndex, boolean showCancel) {
- String[] labels;
- if (detail == null)
- labels = showCancel ? LABELS_OK_CANCEL : LABELS_OK;
- else
- labels = showCancel ? LABELS_OK_CANCEL_DETAILS : LABELS_OK_DETAILS;
- ErrorDialog dialog = new ErrorDialog(parent, title, null, // accept
- // the
- // default
- // window
- // icon
- message, detail, ERROR, labels, defaultIndex);
- if (detail != null)
- dialog.setDetailButton(labels.length - 1);
- return dialog.open() == 0;
- }
-
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- ((GridLayout) composite.getLayout()).numColumns = 2;
- // create image
- Image image = composite.getDisplay().getSystemImage(SWT.ICON_ERROR);
- if (image != null) {
- Label label = new Label(composite, 0);
- image.setBackground(label.getBackground());
- label.setImage(image);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
- }
- // create message
- if (message != null) {
- Label label = new Label(composite, SWT.WRAP);
- label.setText(message);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- ;
- label.setLayoutData(data);
- label.setFont(parent.getFont());
- }
- return composite;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/GenericWizardNode.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/GenericWizardNode.java
deleted file mode 100644
index 62d4cec..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/GenericWizardNode.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * @version 1.0
- * @author
- */
-public abstract class GenericWizardNode implements IWizardNode {
-
- protected IWizard wizard;
-
- /**
- * Constructor for GenericWizardNode.
- */
- public GenericWizardNode() {
- super();
- }
-
- /*
- * @see IWizardNode#dispose()
- */
- public void dispose() {
- if (wizard != null)
- wizard.dispose();
- }
-
- /*
- * @see IWizardNode#getContents()
- */
- public Point getContents() {
- return null;
- }
-
- public final IWizard getWizard() {
- if (wizard == null)
- wizard = createWizard();
- return wizard;
- }
-
- /**
- * Subclasses must override to create the wizard
- */
- protected abstract IWizard createWizard();
-
- /*
- * @see IWizardNode#isContentCreated()
- */
- public boolean isContentCreated() {
- return wizard != null;
- }
-
- /**
- * @see org.eclipse.jface.wizard.IWizardNode#getExtent()
- */
- public Point getExtent() {
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListMessageDialog.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListMessageDialog.java
deleted file mode 100644
index aed38af..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListMessageDialog.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 5, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author dfholt
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class ListMessageDialog extends MessageDialog {
- protected String[] listItems;
- protected List list;
-
- /**
- * EJBSelectiveImportDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- * @param dialogTitle
- * java.lang.String
- * @param dialogTitleImage
- * org.eclipse.swt.graphics.Image
- * @param dialogMessage
- * java.lang.String
- * @param dialogImageType
- * int
- * @param dialogButtonLabels
- * java.lang.String[]
- * @param defaultIndex
- * int
- */
- public ListMessageDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- }
-
- /**
- * ListMessageDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- * @param dialogTitle
- * java.lang.String
- * @param dialogTitleImage
- * org.eclipse.swt.graphics.Image
- * @param dialogMessage
- * java.lang.String
- * @param dialogImageType
- * int
- * @param dialogButtonLabels
- * java.lang.String[]
- * @param defaultIndex
- * int
- */
- public ListMessageDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex, String[] names) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- listItems = names;
- }
-
- /**
- * Creates and returns the contents of an area of the dialog which appears below the message and
- * above the button bar.
- * <p>
- * The default implementation of this framework method returns <code>null</code>. Subclasses
- * may override.
- * </p>
- *
- * @param the
- * parent composite to contain the custom area
- * @return the custom area control, or <code>null</code>
- */
- protected Control createCustomArea(Composite parent) {
-
- Composite composite = new Composite(parent, 0);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (listItems != null) {
- list = new List(composite, SWT.BORDER);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- list.setLayoutData(data);
- list.setItems(listItems);
- }
-
- return composite;
-
- }
-
- /**
- * Convenience method to open a simple confirm (OK/Cancel) dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise
- */
- public static boolean openConfirm(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, QUESTION, new String[]{IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0, items); // OK
- // is
- // the
- // default
- return dialog.open() == 0;
- }
-
- /**
- * Convenience method to open a standard error dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openError(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, ERROR, new String[]{IDialogConstants.OK_LABEL}, 0, items); // ok is the
- // default
- dialog.open();
- return;
- }
-
- /**
- * Convenience method to open a standard information dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openInformation(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, INFORMATION, new String[]{IDialogConstants.OK_LABEL}, 0, items);
- // ok is the default
- dialog.open();
- return;
- }
-
- /**
- * Convenience method to open a simple Yes/No question dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise
- */
- public static boolean openQuestion(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, QUESTION, new String[]{IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 0, items); // yes
- // is
- // the
- // default
- return dialog.open() == 0;
- }
-
- /**
- * Convenience method to open a standard warning dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openWarning(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, WARNING, new String[]{IDialogConstants.OK_LABEL}, 0, items); // ok is
- // the
- // default
- dialog.open();
- return;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListenerList.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListenerList.java
deleted file mode 100644
index ce56714..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ListenerList.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-
-
-import java.awt.event.ActionListener;
-
-public class ListenerList {
- private final static ActionListener[] NULL_ARRAY = new ActionListener[0];
- protected transient ActionListener[] listenerList = NULL_ARRAY;
-
- /**
- * Add the listener as a listener of the specified type.
- *
- * @param t
- * the type of the listener to be added
- * @param l
- * the listener to be added
- */
- public synchronized void add(ActionListener l) {
- if (l == null)
- return;
- if (listenerList == NULL_ARRAY) {
- // if this is the first listener added,
- // initialize the lists
- listenerList = new ActionListener[]{l};
- } else {
- // Otherwise copy the array and add the new listener
- int i = listenerList.length;
- ActionListener[] tmp = new ActionListener[i + 1];
- System.arraycopy(listenerList, 0, tmp, 0, i);
-
- tmp[i + 1] = l;
-
- listenerList = tmp;
- }
- }
-
- /**
- * Return the total number of listeners for this listenerlist
- */
- public int getListenerCount() {
- return listenerList.length;
- }
-
- public ActionListener[] getListenerList() {
- return listenerList;
- }
-
- public synchronized void remove(ActionListener l) {
- if (l == null)
- return;
- int index = -1;
- for (int i = listenerList.length - 1; i >= 0; i -= 1) {
- if (listenerList[i].equals(l)) {
- index = i;
- break;
- }
- }
- if (index != -1) {
- ActionListener[] tmp = new ActionListener[listenerList.length - 1];
- // Copy the list up to index
- System.arraycopy(listenerList, 0, tmp, 0, index);
- // Copy from two past the index, up to
- // the end of tmp (which is two elements
- // shorter than the old list)
- if (index < tmp.length)
- System.arraycopy(listenerList, index + 1, tmp, index, tmp.length - index);
- // set the listener array to the new array or null
- listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java
deleted file mode 100644
index 3faf52d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 3, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModel;
-
-/**
- * @author DABERG
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class NewProjectGroup {
- private ProjectCreationDataModel model;
- public Text projectNameField = null;
- protected Text locationPathField = null;
- protected Button browseButton = null;
- // constants
- private static final int SIZING_TEXT_FIELD_WIDTH = 305;
- // default values
- private String defProjectNameLabel = WTPCommonUIResourceHandler.getString("Name_"); //$NON-NLS-1$
- private String defBrowseButtonLabel = WTPCommonUIResourceHandler.getString("Browse_");//$NON-NLS-1$
- private static final String defDirDialogLabel = "Directory"; //$NON-NLS-1$
-
- private WTPDataModelSynchHelper synchHelper;
-
- /**
- * @param parent
- * @param style
- */
- public NewProjectGroup(Composite parent, int style, ProjectCreationDataModel model) {
- this.model = model;
- synchHelper = new WTPDataModelSynchHelper(model);
- buildComposites(parent);
- }
-
- /**
- * Create the controls within this composite
- */
- public void buildComposites(Composite parent) {
- createProjectNameGroup(parent);
- createProjectLocationGroup(parent);
- projectNameField.setFocus();
- }
-
- /**
- *
- */
- private void createProjectNameGroup(Composite parent) {
- // set up project name label
- Label projectNameLabel = new Label(parent, SWT.NONE);
- projectNameLabel.setText(defProjectNameLabel);
- GridData data = new GridData();
- projectNameLabel.setLayoutData(data);
- // set up project name entry field
- projectNameField = new Text(parent, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = SIZING_TEXT_FIELD_WIDTH;
- projectNameField.setLayoutData(data);
- new Label(parent, SWT.NONE); // pad
- synchHelper.synchText(projectNameField, ProjectCreationDataModel.PROJECT_NAME, new Control[]{projectNameLabel});
- }
-
- /**
- *
- */
- private void createProjectLocationGroup(Composite parent) {
- // set up location path label
- Label locationPathLabel = new Label(parent, SWT.NONE);
- locationPathLabel.setText(WTPCommonUIResourceHandler.getString("Project_location_"));//$NON-NLS-1$
- GridData data = new GridData();
- locationPathLabel.setLayoutData(data);
- // set up location path entry field
- locationPathField = new Text(parent, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = SIZING_TEXT_FIELD_WIDTH;
- locationPathField.setLayoutData(data);
- // set up browse button
- browseButton = new Button(parent, SWT.PUSH);
- browseButton.setText(defBrowseButtonLabel);
- browseButton.setLayoutData((new GridData(GridData.FILL_HORIZONTAL)));
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleLocationBrowseButtonPressed();
- }
- });
- browseButton.setEnabled(true);
- synchHelper.synchText(locationPathField, ProjectCreationDataModel.PROJECT_LOCATION, null);
- }
-
- /**
- * Open an appropriate directory browser
- */
- protected void handleLocationBrowseButtonPressed() {
- DirectoryDialog dialog = new DirectoryDialog(locationPathField.getShell());
- dialog.setMessage(defDirDialogLabel);
- String dirName = model.getStringProperty(ProjectCreationDataModel.PROJECT_LOCATION);
- if ((dirName != null) && (dirName.length() != 0)) {
- File path = new File(dirName);
- if (path.exists()) {
- dialog.setFilterPath(dirName);
- }
- }
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- model.setProperty(ProjectCreationDataModel.PROJECT_LOCATION, selectedDirectory);
- }
- }
-
- public void dispose() {
- model.removeListener(synchHelper);
- synchHelper.dispose();
- model = null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java
deleted file mode 100644
index a52cbe9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/OverlayIcon.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2000, 2001, 2002 - All Rights
- * Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by
- * GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-
-public class OverlayIcon extends org.eclipse.jface.resource.CompositeImageDescriptor {
- // //$NON-NLS-1$
- static final int DEFAULT_WIDTH = 16;
- static final int DEFAULT_HEIGHT = 16;
- private Point fSize = null;
- private ImageDescriptor fBase;
- private ImageDescriptor fOverlays[][];
-
- public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays) {
- fBase = base;
- if (fBase == null)
- fBase = ImageDescriptor.getMissingImageDescriptor();
- fOverlays = overlays;
- fSize = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
- }
-
- public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays, Point size) {
- fBase = base;
- if (fBase == null)
- fBase = ImageDescriptor.getMissingImageDescriptor();
- fOverlays = overlays;
- fSize = size;
- }
-
- protected void drawBottomLeft(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length = overlays.length;
- int x = 0;
- for (int i = 0; i < 3; i++) {
- if (i < length && overlays[i] != null) {
- ImageData id = overlays[i].getImageData();
- drawImage(id, x, getSize().y - id.height);
- x += id.width;
- }
- }
- }
-
- protected void drawBottomRight(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length = overlays.length;
- int x = getSize().x;
- for (int i = 2; i >= 0; i--) {
- if (i < length && overlays[i] != null) {
- ImageData id = overlays[i].getImageData();
- x -= id.width;
- drawImage(id, x, getSize().y - id.height);
- }
- }
- }
-
- protected void drawCompositeImage(int width, int height) {
- ImageData bg = fBase.getImageData();
- drawImage(bg, 0, 0);
-
- if (fOverlays != null) {
- if (fOverlays.length > 0)
- drawTopRight(fOverlays[0]);
-
- if (fOverlays.length > 1)
- drawBottomRight(fOverlays[1]);
-
- if (fOverlays.length > 2)
- drawBottomLeft(fOverlays[2]);
-
- if (fOverlays.length > 3)
- drawTopLeft(fOverlays[3]);
- }
- }
-
- protected void drawTopLeft(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length = overlays.length;
- int x = 0;
- for (int i = 0; i < 3; i++) {
- if (i < length && overlays[i] != null) {
- ImageData id = overlays[i].getImageData();
- drawImage(id, x, 0);
- x += id.width;
- }
- }
- }
-
- protected void drawTopRight(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length = overlays.length;
- int x = getSize().x;
- for (int i = 2; i >= 0; i--) {
- if (i < length && overlays[i] != null) {
- ImageData id = overlays[i].getImageData();
- x -= id.width;
- drawImage(id, x, 0);
- }
- }
- }
-
- protected Point getSize() {
- return fSize;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/RunnableWithProgressWrapper.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/RunnableWithProgressWrapper.java
deleted file mode 100644
index 9a91f1f..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/RunnableWithProgressWrapper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress;
-
-
-/**
- * This is a wrapper for our IHeadlessRunnableWithProgress to the IRunnableWithProgress. This class
- * needs to be used when running the operation from a IRunnableContext.
- *
- * @see IRunnableContext
- * @see JavaUIPlugin#getRunnableWithProgress Creation date: (5/8/2001 1:28:45 PM)
- * @author: Administrator
- */
-public class RunnableWithProgressWrapper implements org.eclipse.jface.operation.IRunnableWithProgress {
- // //$NON-NLS-1$
- private IHeadlessRunnableWithProgress headlessRunnable;
-
- /**
- * RunnableWithProgressWrapper constructor comment.
- */
- public RunnableWithProgressWrapper(IHeadlessRunnableWithProgress aHeadlessRunnableWithProgress) {
- setHeadlessRunnable(aHeadlessRunnableWithProgress);
- }
-
- /**
- * Insert the method's description here. Creation date: (5/8/2001 1:29:52 PM)
- *
- * @return com.ibm.etools.j2ee.operations.IHeadlessRunnableWithProgress
- */
- protected org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress getHeadlessRunnable() {
- return headlessRunnable;
- }
-
- /**
- * Runs this operation. Progress should be reported to the given progress monitor. This method
- * is usually invoked by an <code>IRunnableContext</code>'s<code>run</code> method, which
- * supplies the progress monitor. A request to cancel the operation should be honored and
- * acknowledged by throwing <code>InterruptedException</code>.
- *
- * @param monitor
- * the progress monitor to use to display progress and receive requests for
- * cancelation
- * @exception InvocationTargetException
- * if the run method must propagate a checked exception, it should wrap it inside
- * an <code>InvocationTargetException</code>; runtime exceptions are
- * automatically wrapped in an <code>InvocationTargetException</code> by the
- * calling context
- * @exception InterruptedException
- * if the operation detects a request to cancel, using
- * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing
- * <code>InterruptedException</code>
- *
- * @see IRunnableContext#run
- */
- public void run(org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException {
- getHeadlessRunnable().run(monitor);
- }
-
- /**
- * Insert the method's description here. Creation date: (5/8/2001 1:29:52 PM)
- *
- * @param newHeadlessRunnable
- * com.ibm.etools.j2ee.operations.IHeadlessRunnableWithProgress
- */
- protected void setHeadlessRunnable(org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress newHeadlessRunnable) {
- headlessRunnable = newHeadlessRunnable;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/SaveHandlerUI.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/SaveHandlerUI.java
deleted file mode 100644
index 2309b78..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/SaveHandlerUI.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.frameworks.internal.ISaveHandler;
-import org.eclipse.wst.common.frameworks.internal.SaveFailedException;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-
-public class SaveHandlerUI implements ISaveHandler {
- public static final String SAVE_FAILED = WTPCommonPlugin.getResourceString("16"); //$NON-NLS-1$
- public static final String BEGINNING_MESSAGE = WTPCommonPlugin.getResourceString("17"); //$NON-NLS-1$
- protected boolean isYesToAll = false;
- protected int referenceCount = 0;
-
- /**
- * SaveHandlerUI constructor comment.
- */
- public SaveHandlerUI() {
- super();
- }
-
- /**
- * access method comment.
- */
- public void access() {
- referenceCount++;
- }
-
- protected Shell getParentShellForDialog() {
- if (Display.getCurrent() != null)
- return Display.getCurrent().getActiveShell();
-
- return null;
- }
-
- protected Display getDisplay() {
- Display result = Display.getCurrent();
- return result == null ? Display.getDefault() : result;
- }
-
- public void handleSaveFailed(SaveFailedException ex, IProgressMonitor monitor) {
- if (referenceCount > 1)
- //Let the outermost reference handle it
- throw ex;
- String exMsg = ex.getInnerMostNestedException() == null ? ex.getMessage() : ex.getInnerMostNestedException().getMessage();
- final String message = BEGINNING_MESSAGE + ":\n" + exMsg;//$NON-NLS-1$
- getDisplay().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(getParentShellForDialog(), SAVE_FAILED, message);
- }
- });
- if (monitor != null)
- monitor.setCanceled(true);
- else
- throw ex;
- }
-
- protected boolean promptUserToSaveReadOnly(IFile aFile) {
-
- String[] buttonStrings = {WTPCommonPlugin.getResourceString("Yes_UI_"), WTPCommonPlugin.getResourceString("Yes_To_All_UI_"), WTPCommonPlugin.getResourceString("No_UI_")}; //$NON-NLS-3$ = "No" //$NON-NLS-2$ = "Yes To All" //$NON-NLS-1$ = "Yes"
- String title = WTPCommonPlugin.getResourceString("Saving_Read-Only_File_UI_"); //$NON-NLS-1$ = "Saving Read-Only File"
- String message = WTPCommonPlugin.getResourceString("2concat_INFO_", (new Object[]{aFile.getFullPath()})); //$NON-NLS-1$ = "The file {0} is read-only and cannot be saved. Would you like to make it editable and save anyway?"
-
- final MessageDialog dialog = new MessageDialog(getParentShellForDialog(), title, null, // accept
- // the
- // default
- // window
- // icon
- message, MessageDialog.QUESTION, buttonStrings, 0); // Yes is the default
-
- final int[] ret = new int[1];
- getDisplay().syncExec(new Runnable() {
- public void run() {
- dialog.setBlockOnOpen(true);
- ret[0] = dialog.open();
- }
- });
-
- switch (ret[0]) {
- case 0 : {
- return true;
- }
- case 1 : {
- isYesToAll = true;
- return true;
- }
- case 2 : {
- return false;
- }
- }
- return false;
- }
-
- /**
- * release method comment.
- */
- public void release() {
- referenceCount--;
- if (referenceCount == 0)
- isYesToAll = false;
-
- }
-
- /**
- * shouldContinueAndMakeFileEditable method comment.
- */
- public boolean shouldContinueAndMakeFileEditable(IFile aFile) {
- boolean yes = isYesToAll || promptUserToSaveReadOnly(aFile);
- if (yes)
- aFile.setReadOnly(false);
-
- return yes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedKeyListener.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedKeyListener.java
deleted file mode 100644
index 0106d52..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedKeyListener.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-import java.awt.event.ActionListener;
-
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Insert the type's description here. Creation date: (8/30/2001 4:00:28 PM)
- *
- * @author: Administrator
- */
-public class TimedKeyListener extends Timer implements KeyListener, MouseListener, MouseTrackListener, ModifyListener {
-
- protected Widget monitoringTarget;
-
- private final static int TIME_LIMIT = 200;
-
- /**
- * J2EETimedKeyListener constructor comment.
- *
- * @param delay
- * int
- * @param listener
- * java.awt.event.ActionListener
- */
- public TimedKeyListener(int delay, ActionListener listener) {
- super(delay, listener);
- setRepeats(false);
- }
-
- /**
- * Insert the method's description here. Creation date: (8/30/2001 4:43:33 PM)
- *
- * @param a
- * java.awt.event.ActionListener
- */
- public TimedKeyListener(ActionListener listener) {
- this(TIME_LIMIT, listener);
- }
-
- /**
- * Sent when a key is pressed on the system keyboard.
- *
- * @param e
- * an event containing information about the key press
- */
- public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
- }
-
- /**
- * Sent when a key is released on the system keyboard.
- *
- * @param e
- * an event containing information about the key release
- */
- public void keyReleased(org.eclipse.swt.events.KeyEvent e) {
- // Replaced with SWT.Modify -- see modifyText() in this class
- // monitoringTarget = (Widget) e.getSource();
- // restart();
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseDown(MouseEvent)
- */
- public void mouseDown(MouseEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseUp(MouseEvent)
- */
- public void mouseUp(MouseEvent e) {
- monitoringTarget = (Widget) e.getSource();
- restart();
- }
-
- /**
- * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter(MouseEvent)
- */
- public void mouseEnter(MouseEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.MouseTrackListener#mouseExit(MouseEvent)
- */
- public void mouseExit(MouseEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.MouseTrackListener#mouseHover(MouseEvent)
- */
- public void mouseHover(MouseEvent e) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.ui.util.Timer#getSource()
- */
- protected Object getSource() {
- return monitoringTarget;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- monitoringTarget = (Widget) e.getSource();
- restart();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedModifyListener.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedModifyListener.java
deleted file mode 100644
index 72b1ab6..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimedModifyListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * This class perform the same function as the J2EETimedKeyListener but using the Modify SWT event
- * instead of the KeyUp. Creation date: (9/10/2001 11:46:51 AM)
- *
- * @author: Administrator
- */
-import java.awt.event.ActionListener;
-
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Widget;
-
-public class TimedModifyListener extends TimedKeyListener implements ModifyListener {
- /**
- * J2EETimedModefyListener constructor comment.
- *
- * @param delay
- * int
- * @param listener
- * java.awt.event.ActionListener
- */
- public TimedModifyListener(int delay, ActionListener listener) {
- super(delay, listener);
- }
-
- /**
- * J2EETimedModefyListener constructor comment.
- *
- * @param listener
- * java.awt.event.ActionListener
- */
- public TimedModifyListener(ActionListener listener) {
- super(listener);
- }
-
- /*
- * Re/Start the timer
- */
- public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
- monitoringTarget = (Widget) e.getSource();
- restart();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/Timer.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/Timer.java
deleted file mode 100644
index 6cbb548..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/Timer.java
+++ /dev/null
@@ -1,249 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-
-public class Timer {
- /**
- * DoPostEvent is a runnable class that fires actionEvents to the listeners on the
- * EventDispatchThread, via invokeLater.
- *
- * @see #post
- */
- class DoPostEvent implements Runnable {
- public void run() {
- if (eventQueued) {
- fireActionPerformed(new ActionEvent(getSource(), 0, null));
- cancelEvent();
- }
- }
-
- Timer getTimer() {
- return Timer.this;
- }
- }
-
- protected ListenerList listenerList = new ListenerList();
- boolean eventQueued = false;
- int initialDelay, delay;
- boolean repeats = true, coalesce = true;
- private Runnable doPostEvent;
- // These fields are maintained by TimerQueue.
- // eventQueued can also be reset by the TimerQueue, but will only ever
- // happen in applet case when TimerQueues thread is destroyed.
- long expirationTime;
- Timer nextTimer;
- boolean running;
-
- /**
- * Creates a Timer that will notify its listeners every <i>delay </i> milliseconds.
- *
- * @param delay
- * The number of milliseconds between listener notification
- * @param listener
- * An initial listener
- * @see #setInitialDelay
- * @see #setRepeats
- */
- public Timer(int delay, ActionListener listener) {
- super();
- this.delay = delay;
- this.initialDelay = delay;
-
- doPostEvent = new DoPostEvent();
-
- if (listener != null) {
- addActionListener(listener);
- }
- }
-
- /**
- * Adds an actionListener to the Timer
- */
- public void addActionListener(ActionListener listener) {
- listenerList.add(listener);
- }
-
- synchronized void cancelEvent() {
- eventQueued = false;
- }
-
- /**
- * Notify all listeners that have registered interest for notification on this event type. The
- * event instance is lazily created using the parameters passed into the fire method.
- *
- * @see EventListenerList
- */
- protected void fireActionPerformed(ActionEvent e) {
- // Guaranteed to return a non-null array
- ActionListener[] listeners = listenerList.getListenerList();
-
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length - 1; i >= 0; i -= 1) {
- listeners[i].actionPerformed(e);
- }
- }
-
- /**
- * Returns the Timer's delay.
- *
- * @see #setDelay
- */
- public int getDelay() {
- return delay;
- }
-
- /**
- * Returns the Timer's initial delay.
- *
- * @see #setDelay
- */
- public int getInitialDelay() {
- return initialDelay;
- }
-
- /**
- * Returns <b>true </b> if the Timer coalesces multiple pending <b>performCommand() </b>
- * messages.
- *
- * @see #setCoalesce
- */
- public boolean isCoalesce() {
- return coalesce;
- }
-
- /**
- * Returns <b>true </b> if the Timer will send a <b>actionPerformed() </b> message to its
- * listeners multiple times.
- *
- * @see #setRepeats
- */
- public boolean isRepeats() {
- return repeats;
- }
-
- /**
- * Returns <b>true </b> if the Timer is running.
- *
- * @see #start
- */
- public boolean isRunning() {
- return timerQueue().containsTimer(this);
- }
-
- synchronized void post() {
- if (!eventQueued) {
- eventQueued = true;
- org.eclipse.swt.widgets.Display.getDefault().asyncExec(doPostEvent);
- }
- }
-
- /**
- * Removes an ActionListener from the Timer.
- */
- public void removeActionListener(ActionListener listener) {
- listenerList.remove(listener);
- }
-
- /**
- * Restarts a Timer, canceling any pending firings, and causing it to fire with its initial
- * dely.
- */
- public void restart() {
- stop();
- start();
- }
-
- /**
- * Sets whether the Timer coalesces multiple pending ActionEvent firings. A busy application may
- * not be able to keep up with a Timer's message generation, causing multiple
- * <b>actionPerformed() </b> message sends to be queued. When processed, the application sends
- * these messages one after the other, causing the Timer's listeners to receive a sequence of
- * <b>actionPerformed() </b> messages with no delay between them. Coalescing avoids this
- * situation by reducing multiple pending messages to a single message send. Timers coalesce
- * their message sends by default.
- */
- public void setCoalesce(boolean flag) {
- coalesce = flag;
- }
-
- /**
- * Sets the Timer's delay, the number of milliseconds between successive <b>actionPerfomed()
- * </b> messages to its listeners
- *
- * @see #setInitialDelay
- */
- public void setDelay(int delay) {
- if (delay < 0) {
- String msg = WTPCommonUIResourceHandler.getString("Timer_UI_0", new Object[]{Integer.toString(delay)}); //$NON-NLS-1$
- throw new IllegalArgumentException(msg);
- }
- this.delay = delay;
- }
-
- /**
- * Sets the Timer's initial delay. This will be used for the first "ringing" of the Timer only.
- * Subsequent ringings will be spaced using the delay property.
- *
- * @see #setDelay
- */
- public void setInitialDelay(int initialDelay) {
- if (initialDelay < 0) {
- String msg = WTPCommonUIResourceHandler.getString("Timer_UI_1", new Object[]{Integer.toString(initialDelay)}); //$NON-NLS-1$
- throw new IllegalArgumentException(msg);
- }
- this.initialDelay = initialDelay;
- }
-
- /**
- * If <b>flag </b> is <b>false </b>, instructs the Timer to send <b>actionPerformed() </b> to
- * its listeners only once, and then stop.
- */
- public void setRepeats(boolean flag) {
- repeats = flag;
- }
-
- /**
- * Starts the Timer, causing it to send <b>actionPerformed() </b> messages to its listeners.
- *
- * @see #stop
- */
- public void start() {
- timerQueue().addTimer(this, System.currentTimeMillis() + getInitialDelay());
- }
-
- /**
- * Stops a Timer, causing it to stop sending <b>actionPerformed() </b> messages to its Target.
- *
- * @see #start
- */
- public void stop() {
- timerQueue().removeTimer(this);
- cancelEvent();
- }
-
- /**
- * Returns the timer queue.
- */
- TimerQueue timerQueue() {
- return TimerQueue.singleton();
- }
-
- /**
- * Return the source for the ActionEvent that is fired.
- *
- * @return
- */
- protected Object getSource() {
- return this;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimerQueue.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimerQueue.java
deleted file mode 100644
index 3ca9284..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/TimerQueue.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-
-
-
-class TimerQueue implements Runnable {
- private static TimerQueue singleton;
- Timer firstTimer;
- boolean running;
- private static final Object classLock = new Object();
-
- /**
- * Constructor for TimerQueue.
- */
- public TimerQueue() {
- super();
-
- // Now start the TimerQueue thread.
- start();
- }
-
- synchronized void addTimer(Timer timer, long expirationTime) {
- Timer previousTimer;
- Timer nextTimer;
-
- // If the Timer is already in the queue, then ignore the add.
- if (timer.running) {
- return;
- }
-
- previousTimer = null;
- nextTimer = firstTimer;
-
- // Insert the Timer into the linked list in the order they will
- // expire. If two timers expire at the same time, put the newer entry
- // later so they expire in the order they came in.
-
- while (nextTimer != null) {
- if (nextTimer.expirationTime > expirationTime)
- break;
-
- previousTimer = nextTimer;
- nextTimer = nextTimer.nextTimer;
- }
-
- if (previousTimer == null) {
- firstTimer = timer;
- } else {
- previousTimer.nextTimer = timer;
- }
-
- timer.expirationTime = expirationTime;
- timer.nextTimer = nextTimer;
- timer.running = true;
- notify();
- }
-
- synchronized boolean containsTimer(Timer timer) {
- return timer.running;
- }
-
- /**
- * If there are a ton of timers, this method may never return. It loops checking to see if the
- * head of the Timer list has expired. If it has, it posts the Timer and reschedules it if
- * necessary.
- */
- synchronized long postExpiredTimers() {
- Timer timer;
- long currentTime;
- long timeToWait;
-
- // The timeToWait we return should never be negative and only be zero
- // when we have no Timers to wait for.
-
- do {
- timer = firstTimer;
- if (timer == null)
- return 0;
-
- currentTime = System.currentTimeMillis();
- timeToWait = timer.expirationTime - currentTime;
-
- if (timeToWait <= 0) {
- try {
- timer.post(); // have timer post an event
- } catch (SecurityException e) {
- }
-
- // Remove the timer from the queue
- removeTimer(timer);
-
- // This tries to keep the interval uniform at
- // the cost of drift.
- if (timer.isRepeats()) {
- addTimer(timer, currentTime + timer.getDelay());
- }
- }
-
- // Allow other threads to call addTimer() and removeTimer()
- // even when we are posting Timers like mad. Since the wait()
- // releases the lock, be sure not to maintain any state
- // between iterations of the loop.
-
- try {
- wait(1);
- } catch (InterruptedException e) {
- }
- } while (timeToWait <= 0);
-
- return timeToWait;
- }
-
- synchronized void removeTimer(Timer timer) {
- Timer previousTimer;
- Timer nextTimer;
- boolean found;
-
- if (!timer.running)
- return;
-
- previousTimer = null;
- nextTimer = firstTimer;
- found = false;
-
- while (nextTimer != null) {
- if (nextTimer == timer) {
- found = true;
- break;
- }
-
- previousTimer = nextTimer;
- nextTimer = nextTimer.nextTimer;
- }
-
- if (!found)
- return;
-
- if (previousTimer == null) {
- firstTimer = timer.nextTimer;
- } else {
- previousTimer.nextTimer = timer.nextTimer;
- }
-
- timer.expirationTime = 0;
- timer.nextTimer = null;
- timer.running = false;
- }
-
- public synchronized void run() {
- long timeToWait;
-
- try {
- while (running) {
- timeToWait = postExpiredTimers();
- try {
- wait(timeToWait);
- } catch (InterruptedException e) {
- }
- }
- } catch (ThreadDeath td) {
- running = false;
- // Mark all the timers we contain as not being queued.
- Timer timer = firstTimer;
- while (timer != null) {
- timer.eventQueued = false;
- timer = timer.nextTimer;
- }
- synchronized (this) {
- if (!this.running)
- start();
- }
- throw td;
- }
- }
-
- public static TimerQueue singleton() {
- if (singleton == null)
- synchronized (classLock) {
- singleton = new TimerQueue();
- }
- return singleton;
- }
-
- synchronized void start() {
- if (running) {
- throw new RuntimeException(WTPCommonUIResourceHandler.getString("TimerQueue_ERROR_0")); //$NON-NLS-1$
- }
- Thread timerThread = new Thread(this, "TimerQueue");//$NON-NLS-1$
- try {
- timerThread.setDaemon(true);
- } catch (SecurityException e) {
- }
- timerThread.start();
- running = true;
- }
-
- synchronized void stop() {
- running = false;
- notify();
- }
-
- public synchronized String toString() {
- StringBuffer buf;
- Timer nextTimer;
-
- buf = new StringBuffer();
- buf.append("TimerQueue (");//$NON-NLS-1$
-
- nextTimer = firstTimer;
- while (nextTimer != null) {
- buf.append(nextTimer.toString());
-
- nextTimer = nextTimer.nextTimer;
- if (nextTimer != null)
- buf.append(", ");//$NON-NLS-1$
- }
-
- buf.append(")");//$NON-NLS-1$
- return buf.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementIdentifier.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementIdentifier.java
deleted file mode 100644
index c46f4d6..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementIdentifier.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 12, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.ui.activities.IActivityManager;
-import org.eclipse.ui.activities.IIdentifier;
-import org.eclipse.ui.activities.IIdentifierListener;
-import org.eclipse.ui.activities.IdentifierEvent;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementIdentifier;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementIdentifierEvent;
-import org.eclispe.wst.common.frameworks.internal.enablement.IEnablementManager;
-
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-class UIEnablementIdentifier extends EnablementIdentifier implements IIdentifierListener {
-
- private IIdentifier activityIdentifier;
-
- /**
- * @param id
- * @param project
- */
- public UIEnablementIdentifier(String id, IProject project) {
- super(id, project);
- activityIdentifier = getActivityManager().getIdentifier(id);
- activityIdentifier.addIdentifierListener(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.activities.IIdentifierListener#identifierChanged(org.eclipse.ui.activities.IdentifierEvent)
- */
- public void identifierChanged(IdentifierEvent identifierEvent) {
- boolean enabledChanged = resetEnabled();
- EnablementIdentifierEvent evt = new EnablementIdentifierEvent(this, false, enabledChanged);
- fireIdentifierChanged(evt);
- }
-
- protected IActivityManager getActivityManager() {
- return ((UIEnablementManager) IEnablementManager.INSTANCE).getActivityManager();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclispe.wst.common.frameworks.internal.enablement.EnablementIdentifier#getNewEnabled()
- */
- protected boolean getNewEnabled() {
- return activityIdentifier.isEnabled() && super.getNewEnabled();
- }
-
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementManager.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementManager.java
deleted file mode 100644
index 47a1930..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIEnablementManager.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 3, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.IActivityManager;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementIdentifier;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementManager;
-
-/**
- * @author mdelder
- */
-public class UIEnablementManager extends EnablementManager {
-
- private IWorkbenchActivitySupport activitySupport = null;
-
- public UIEnablementManager() {
- super();
- }
-
- protected IActivityManager getActivityManager() {
- return getActivitySupport().getActivityManager();
- }
-
- /**
- * @return Returns the activitySupport.
- */
- protected IWorkbenchActivitySupport getActivitySupport() {
- if (activitySupport == null)
- activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- return activitySupport;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.enablement.EnablementManager#createIdentifier(java.lang.String,
- * org.eclipse.core.resources.IProject)
- */
- protected EnablementIdentifier createIdentifier(String identifierId, IProject project) {
- return new UIEnablementIdentifier(identifierId, project);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIOperationHandler.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIOperationHandler.java
deleted file mode 100644
index b596e8a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UIOperationHandler.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 5, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.frameworks.internal.operations.IOperationHandler;
-
-
-/**
- * @author dfholt
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class UIOperationHandler implements IOperationHandler {
- protected Shell parentShell;
- final public static String DEFAULT_INFORMATION = "Information";//EMFWorkbenchUIResourceHandler.getString("Information_UI__UI_");
- // //$NON-NLS-1$
- // //$NON-NLS-1$ = "Information"
- final public static String DEFAULT_ERROR = "Error";// EMFWorkbenchUIResourceHandler.getString("Error_UI_");
- // //$NON-NLS-1$
- // //$NON-NLS-1$ = "Error"
- final public static String DEFAULT_CONFIRM = "Confirm";//EMFWorkbenchUIResourceHandler.getString("Confirm_UI_");
- // //$NON-NLS-1$
- // //$NON-NLS-1$ = "Confirm"
- protected String informationTitle = DEFAULT_INFORMATION;
- protected String confirmTitle = DEFAULT_CONFIRM;
- protected String errorTitle = DEFAULT_ERROR;
-
- /**
- * UIOperationHandler constructor comment.
- */
- public UIOperationHandler() {
- super();
- }
-
- /**
- * UIOperationHandler constructor comment.
- */
- public UIOperationHandler(Shell parent) {
- super();
- parentShell = parent;
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue
- */
- public boolean canContinue(String message) {
- return MessageDialog.openQuestion(getParentShell(), getConfirmTitle(), message);
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue
- */
- public boolean canContinue(String message, String[] items) {
- return ListMessageDialog.openQuestion(getParentShell(), getConfirmTitle(), message, items);
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue. The boolean array
- * will return two booleans. The first indicates their response to the original question and the
- * second indicates if they selected the apply to all check box.
- *
- * Return the return code for the dialog. 0 = Yes, 1 = Yes to all, 2 = No
- */
- public int canContinueWithAllCheck(String message) {
- MessageDialog dialog = new MessageDialog(getParentShell(), getConfirmTitle(), null, // accept
- // the
- // default
- // window
- // icon
- message, MessageDialog.QUESTION, new String[]{IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL}, 1); // yes
- // is
- // the
- // default
- return dialog.open();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.j2ee.operations.IOperationHandler#canContinueWithAllCheckAllowCancel(java.lang.String)
- */
- public int canContinueWithAllCheckAllowCancel(String message) {
- MessageDialog dialog = new MessageDialog(getParentShell(), getConfirmTitle(), null, // accept
- // the
- // default
- // window
- // icon
- message, MessageDialog.QUESTION, new String[]{IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL}, 1); // yes
- // is
- // the
- // default
- return dialog.open();
- }
-
- /**
- * An error has occurred
- */
- public void error(String message) {
- MessageDialog.openError(getParentShell(), getErrorTitle(), message);
- }
-
- /**
- * The dialog title to be used for confirmations
- */
- public java.lang.String getConfirmTitle() {
- return confirmTitle;
- }
-
- /**
- * The dialog title to be used for errors
- */
- public java.lang.String getErrorTitle() {
- return errorTitle;
- }
-
- /**
- * The dialog title to be used for information
- */
- public java.lang.String getInformationTitle() {
- return informationTitle;
- }
-
- public Shell getParentShell() {
- if (parentShell == null)
- parentShell = WTPUIPlugin.getPluginWorkbench().getActiveWorkbenchWindow().getShell();
-
- return parentShell;
- }
-
- /**
- * An informational message needs to be presented
- */
- public void inform(String message) {
- MessageDialog.openInformation(getParentShell(), getInformationTitle(), message);
- }
-
- /**
- * Insert the method's description here. Creation date: (8/9/2001 11:51:36 AM)
- *
- * @param newConfirmTitle
- * java.lang.String
- */
- public void setConfirmTitle(java.lang.String newConfirmTitle) {
- confirmTitle = newConfirmTitle;
- }
-
- /**
- * Insert the method's description here. Creation date: (8/9/2001 11:51:36 AM)
- *
- * @param newErrorTitle
- * java.lang.String
- */
- public void setErrorTitle(java.lang.String newErrorTitle) {
- errorTitle = newErrorTitle;
- }
-
- /**
- * Insert the method's description here. Creation date: (8/9/2001 11:51:36 AM)
- *
- * @param newInformationTitle
- * java.lang.String
- */
- public void setInformationTitle(java.lang.String newInformationTitle) {
- informationTitle = newInformationTitle;
- }
-
- /**
- * @see com.ibm.etools.j2ee.operations.IOperationHandler#getContext()
- */
- public Object getContext() {
- return getParentShell();
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java
deleted file mode 100644
index e22ce99..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 27, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.Workbench;
-
-import com.ibm.wtp.common.UITester;
-
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class UITesterImpl implements UITester {
-
- /**
- *
- */
- public UITesterImpl() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.UITester#isCurrentContextUI()
- */
- public boolean isCurrentContextUI() {
- try {
- return PlatformUI.isWorkbenchRunning() || ((Workbench) PlatformUI.getWorkbench()).isClosing();
- } catch (RuntimeException e) {
- return false;
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ValidationStatus.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ValidationStatus.java
deleted file mode 100644
index 926f899..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/ValidationStatus.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This object encompas a set of Validation status Creation date: (9/10/2001 5:35:12 PM)
- *
- * @author: Administrator
- */
-public class ValidationStatus {
- Hashtable errMsgs = new Hashtable();
- Hashtable errStatus = new Hashtable();
- Hashtable tControls = new Hashtable();
- Map warnMsgs;
- Map warnStatus;
-
- /**
- * ValidationStatus constructor comment.
- */
- public ValidationStatus() {
- super();
- }
-
- /*
- * Look for any error. If there is more than one, return errors according to their key. i.e.,
- * lower key errors will be returned first.
- */
- public String getLastErrMsg() {
-
- Enumeration e = errStatus.keys();
- String[] errs = new String[errStatus.size()];
- for (int i = 0; i < errs.length; i++)
- errs[i] = null;
- boolean foundOne = false;
- while (e.hasMoreElements()) {
- Integer key = (Integer) e.nextElement();
- if (!((Boolean) errStatus.get(key)).booleanValue()) {
- errs[key.intValue() % errs.length] = (String) errMsgs.get(key);
- foundOne = true;
- }
- }
- if (foundOne)
- for (int i = 0; i < errs.length; i++)
- if (errs[i] != null)
- return errs[i];
- return null;
- }
-
- private Map getWarningMsgs() {
- if (warnMsgs == null)
- warnMsgs = new HashMap();
- return warnMsgs;
- }
-
- private Map getWarningStatusMap() {
- if (warnStatus == null)
- warnStatus = new HashMap();
- return warnStatus;
- }
-
- /*
- * Look for any warning. If there is more than one, return warnings according to their key.
- * i.e., lower key errors will be returned first.
- */
- public String getLastWarningMsg() {
- if (warnStatus == null)
- return null;
- Iterator e = warnStatus.keySet().iterator();
- String[] warns = new String[warnStatus.size()];
- for (int i = 0; i < warns.length; i++)
- warns[i] = null;
- boolean foundOne = false;
- while (e.hasNext()) {
- Integer key = (Integer) e.next();
- if (!((Boolean) warnStatus.get(key)).booleanValue()) {
- warns[key.intValue() % warns.length] = (String) warnMsgs.get(key);
- foundOne = true;
- }
- }
- if (foundOne)
- for (int i = 0; i < warns.length; i++)
- if (warns[i] != null)
- return warns[i];
- return null;
- }
-
- public String getLastErrMsgAndFocus() {
-
- Enumeration e = errStatus.keys();
-
- Integer theOne = null;
- while (e.hasMoreElements()) {
- Integer key = (Integer) e.nextElement();
- if (!((Boolean) errStatus.get(key)).booleanValue()) {
- if (theOne == null || key.intValue() < theOne.intValue()) {
- theOne = key;
- }
- }
- }
- if (theOne != null) {
- Control control = (Control) tControls.get(theOne);
- if (control != null) {
- control.setFocus();
- }
- return ((String) errMsgs.get(theOne));
- }
- return null;
- }
-
- public boolean hasError(Integer key) {
- Boolean stat = (Boolean) errStatus.get(key);
- if (stat != null)
- return stat.booleanValue();
- return true;
- }
-
- public void setControl(Integer key, Control control) {
- tControls.put(key, control);
- }
-
- public void setErrorStatus(Integer key, Boolean status, String msg) {
- errMsgs.put(key, msg);
- errStatus.put(key, status);
- }
-
- public void setErrorStatus(Integer key, String msg) {
- errMsgs.put(key, msg);
- errStatus.put(key, new Boolean(false));
- }
-
- public void setWarningStatus(Integer key, String msg) {
- getWarningMsgs().put(key, msg);
- getWarningStatusMap().put(key, new Boolean(false));
- }
-
- public void setOKStatus(Integer key) {
- errMsgs.put(key, ""); //$NON-NLS-1$
- errStatus.put(key, new Boolean(true));
- if (warnMsgs != null)
- warnMsgs.put(key, ""); //$NON-NLS-1$
- if (warnStatus != null)
- warnStatus.put(key, new Boolean(true));
- }
-
- public void setStatus(Integer key, boolean ok, String msg) {
- errMsgs.put(key, msg);
- errStatus.put(key, new Boolean(ok));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityBridgeHelperImpl.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityBridgeHelperImpl.java
deleted file mode 100644
index a8440eb..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityBridgeHelperImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.ui.IPluginContribution;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.IActivityManager;
-import org.eclipse.ui.activities.IIdentifier;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.wst.common.frameworks.internal.activities.WTPActivityBridgeHelper;
-
-
-/**
- * @author jsholl
- *
- */
-public class WTPActivityBridgeHelperImpl implements WTPActivityBridgeHelper {
-
- private IWorkbenchActivitySupport workbenchActivitySupport = null;
- private IActivityManager activityManager = null;
-
- public WTPActivityBridgeHelperImpl() {
- workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
- activityManager = workbenchActivitySupport.getActivityManager();
- }
-
- public void enableActivity(String activityID, boolean enabled) {
- Set enabledActivities = activityManager.getEnabledActivityIds();
- Set newEnabledActivities = null;
- if (enabled && !enabledActivities.contains(activityID)) {
- newEnabledActivities = new HashSet();
- newEnabledActivities.addAll(enabledActivities);
- newEnabledActivities.add(activityID);
- }
- if (!enabled && enabledActivities.contains(activityID)) {
- newEnabledActivities = new HashSet();
- newEnabledActivities.addAll(enabledActivities);
- newEnabledActivities.remove(activityID);
- }
- if (null != newEnabledActivities) {
- workbenchActivitySupport.setEnabledActivityIds(newEnabledActivities);
- }
- }
-
- public Set getEnabledActivityIds() {
- return activityManager.getEnabledActivityIds();
- }
-
- public void setEnabledActivityIds(Set activityIDs) {
- workbenchActivitySupport.setEnabledActivityIds(activityIDs);
- }
-
- public Set getActivityIDsFromContribution(final String localID, final String pluginID) {
- IIdentifier identifier = activityManager.getIdentifier(WorkbenchActivityHelper.createUnifiedId(new IPluginContribution() {
- public String getLocalId() {
- return localID;
- }
-
- public String getPluginId() {
- return pluginID;
- }
- }));
- return identifier.getActivityIds();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityHelper.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityHelper.java
deleted file mode 100644
index 37a0221..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPActivityHelper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 9, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.ui.IPluginContribution;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.IIdentifier;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public class WTPActivityHelper {
-
- /**
- * @return whether the UI is set up to filter contributions (has defined activity categories).
- */
- public static final boolean isFiltering() {
- return !PlatformUI.getWorkbench().getActivitySupport().getActivityManager().getDefinedActivityIds().isEmpty();
- }
-
- public static boolean allowUseOf(Object object) {
- if (!isFiltering())
- return true;
- if (object instanceof IPluginContribution) {
- IPluginContribution contribution = (IPluginContribution) object;
- if (contribution.getPluginId() != null) {
- IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
- IIdentifier identifier = workbenchActivitySupport.getActivityManager().getIdentifier(createUnifiedId(contribution));
- return identifier.isEnabled();
- }
- }
- return true;
- }
-
-
- public static final String createUnifiedId(IPluginContribution contribution) {
- if (contribution.getPluginId() != null)
- return contribution.getPluginId() + '/' + contribution.getLocalId();
- return contribution.getLocalId();
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPCommonUIResourceHandler.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPCommonUIResourceHandler.java
deleted file mode 100644
index 00eb1f0..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPCommonUIResourceHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 23, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author vijayb
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class WTPCommonUIResourceHandler {
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("wtpcommonui"); //$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!"; //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- return "!" + key + "!"; //$NON-NLS-2$//$NON-NLS-1$
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-
- public static String getString(String key, Object[] args, int x) {
- return getString(key);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPDataModelSynchHelper.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPDataModelSynchHelper.java
deleted file mode 100644
index 3b06e3b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPDataModelSynchHelper.java
+++ /dev/null
@@ -1,679 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 3, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and
- * Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPPropertyDescriptor;
-
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class WTPDataModelSynchHelper implements WTPOperationDataModelListener {
- protected WTPOperationDataModel dataModel;
- protected Map widgetToPropertyHash;
- protected Map propertyToWidgetHash;
- protected Map widgetToDepControls;
- /**
- * @deprecated
- */
- private Map deprecatedConvertPropertyNames; //TODO delete this
- /**
- * @deprecated
- */
- private HashSet deprecatedCombos; //TODO delete this
-
- protected String currentProperty;
- protected Widget currentWidget;
- protected boolean ignoreModifyEvent = false;
-
- private class ModifyTextListener implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- if (ignoreModifyEvent)
- return;
- Text text = (Text) e.getSource();
- if (currentWidget == text)
- return;
- String propertyName = (String) widgetToPropertyHash.get(text);
- setProperty(propertyName, text.getText());
- }
- }
-
- private ModifyTextListener modifyTextListener;
- private TimedModifyListener timedModifyListener;
-
- /**
- * @deprecated
- * @author jsholl
- */
- private class ComboListenerDeprecated implements SelectionListener, ModifyListener { //TODO delete this
- public void modifyText(ModifyEvent e) {
- if (ignoreModifyEvent)
- return;
- Combo combo = (Combo) e.getSource();
- if (currentWidget == combo)
- return;
- String propertyName = (String) widgetToPropertyHash.get(combo);
- setProperty(propertyName, combo.getText());
- }
-
- public void widgetSelected(SelectionEvent e) {
- Combo combo = (Combo) e.getSource();
- if (currentWidget == combo)
- return;
- String propertyName = (String) widgetToPropertyHash.get(combo);
- if (combo.getSelectionIndex() >= 0)
- setProperty(propertyName, combo.getItem(combo.getSelectionIndex()));
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- }
-
- /**
- * @deprecated
- */
- private ComboListenerDeprecated comboListenerDeprecated; //TODO delete this
-
- private class ComboListener implements SelectionListener, ModifyListener {
- public void modifyText(ModifyEvent e) {
- if (ignoreModifyEvent)
- return;
- Combo combo = (Combo) e.getSource();
- if (currentWidget == combo)
- return;
- String propertyName = (String) widgetToPropertyHash.get(combo);
- WTPPropertyDescriptor[] descriptors = dataModel.getValidPropertyDescriptors(propertyName);
- String description = combo.getText();
- for (int i = 0; i < descriptors.length; i++) {
- if (description.equals(descriptors[i].getPropertyDescription())) {
- setProperty(propertyName, descriptors[i].getPropertyValue());
- return;
- }
- }
- setProperty(propertyName, combo.getText());
- }
-
- public void widgetSelected(SelectionEvent e) {
- Combo combo = (Combo) e.getSource();
- if (currentWidget == combo)
- return;
- String propertyName = (String) widgetToPropertyHash.get(combo);
- if (combo.getSelectionIndex() >= 0) {
- WTPPropertyDescriptor[] descriptors = dataModel.getValidPropertyDescriptors(propertyName);
- String description = combo.getItem(combo.getSelectionIndex());
- for (int i = 0; i < descriptors.length; i++) {
- if (description.equals(descriptors[i].getPropertyDescription())) {
- setProperty(propertyName, descriptors[i].getPropertyValue());
- return;
- }
- }
- setProperty(propertyName, combo.getItem(combo.getSelectionIndex()));
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- }
-
- private ComboListener comboListener;
-
-
- private class CheckboxSelectionListener implements SelectionListener {
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.getSource();
- if (currentWidget == button)
- return;
- String propertyName = (String) widgetToPropertyHash.get(button);
- setProperty(propertyName, new Boolean(button.getSelection()));
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- }
-
- private CheckboxSelectionListener checkboxSelectionListener;
-
- public WTPDataModelSynchHelper(WTPOperationDataModel model) {
- this.dataModel = model;
- dataModel.addListener(this);
- }
-
-
- private CheckBoxViewerListener checkBoxViewerStateListener;
-
- private class CheckBoxViewerListener implements ICheckStateListener {
- public void checkStateChanged(CheckStateChangedEvent event) {
- StructuredViewer viewer = (StructuredViewer) event.getSource();
- CheckboxTableViewer checkBoxTableViewer;
- CheckboxTreeViewer checkBoxTreeViewer;
- Object[] items = null;
- if (viewer instanceof CheckboxTableViewer) {
- checkBoxTableViewer = (CheckboxTableViewer) viewer;
- items = checkBoxTableViewer.getCheckedElements();
- } else if (viewer instanceof CheckboxTreeViewer) {
- checkBoxTreeViewer = (CheckboxTreeViewer) viewer;
- items = checkBoxTreeViewer.getCheckedElements();
- }
- String propertyName = (String) widgetToPropertyHash.get(viewer.getControl());
- setPropertyItems(propertyName, items);
- }
- }
-
- public void propertyChanged(WTPOperationDataModelEvent event) {
- String propertyName = event.getPropertyName();
- int flag = event.getFlag();
- if (currentProperty != null) {
- String convertedProp = propertyName;
- if (flag == WTPOperationDataModelListener.PROPERTY_CHG)
- convertedProp = getConvertedProperty(propertyName);
- if (currentProperty.equals(convertedProp))
- return;
- }
- if (flag == WTPOperationDataModelListener.ENABLE_CHG)
- setEnablement(propertyName, ((Boolean) event.getNewValue()).booleanValue());
- else
- synchUIWithModel(propertyName, flag);
- }
-
- protected void setProperty(String propertyName, Object value) {
- currentProperty = propertyName;
- try {
- dataModel.setProperty(propertyName, value);
- } finally {
- currentProperty = null;
- }
- }
-
- protected void setPropertyItems(String propertyName, Object[] items) {
- currentProperty = propertyName;
- try {
- dataModel.setProperty(propertyName, items);
- } finally {
- currentProperty = null;
- }
- }
-
- /**
- * Sets the UI to have the property value defined in the model
- *
- * @param propertyName
- * @link WTPOperationDataModelListener for the flag values.
- */
- public void synchUIWithModel(String propertyName, int flag) {
- if (null != propertyToWidgetHash && propertyToWidgetHash.containsKey(propertyName)) {
- try {
- dataModel.setIgnorePropertyChanges(true);
- currentWidget = (Widget) propertyToWidgetHash.get(propertyName);
- if (currentWidget != null) {
- ignoreModifyEvent = true;
- try {
- if (currentWidget instanceof Text)
- setWidgetValue(propertyName, flag, (Text) currentWidget);
- else if (currentWidget instanceof Combo){
- if(null != deprecatedCombos && deprecatedCombos.contains(currentWidget)){
- setWidgetValueDeprecated(propertyName, flag, (Combo) currentWidget);
- } else {
- setWidgetValue(propertyName, flag, (Combo) currentWidget);
- }
- }else if (currentWidget instanceof Button)
- setWidgetValue(propertyName, flag, (Button) currentWidget);
- else if (currentWidget instanceof Label)
- setWidgetValue(propertyName, flag, (Label) currentWidget);
- else if (currentWidget instanceof List)
- setWidgetValue(propertyName, flag, (List) currentWidget);
- else if (currentWidget instanceof Table)
- setWidgetValue(propertyName, flag, (Table) currentWidget);
- else if (currentWidget instanceof Tree)
- setWidgetValue(propertyName, flag, (Tree) currentWidget);
- } finally {
- ignoreModifyEvent = false;
- }
- setEnablement(propertyName);
- }
- } finally {
- currentWidget = null;
- dataModel.setIgnorePropertyChanges(false);
- }
- }
- }
-
- /**
- * @param control
- */
- private void setEnablement(String propertyName) {
- if (currentWidget == null)
- return;
- Boolean enabled = dataModel.isEnabled(propertyName);
- if (enabled != null)
- setEnablement((Control) currentWidget, enabled.booleanValue());
- }
-
- /**
- * @param control
- * @param enabled
- */
- private void setEnablement(Control control, boolean enabled) {
- if (control.isEnabled() != enabled)
- control.setEnabled(enabled);
- setDependentControlEnablement(control, enabled);
- }
-
- private void setEnablement(String propertyName, boolean enabled) {
- if (propertyToWidgetHash != null) {
- Control control = (Control) propertyToWidgetHash.get(propertyName);
- if (control != null) {
- setEnablement(control, enabled);
- }
- }
- }
-
- /**
- * @param control
- * @param enabled
- */
- private void setDependentControlEnablement(Control control, boolean enabled) {
- if (widgetToDepControls != null) {
- Control[] dependents = (Control[]) widgetToDepControls.get(control);
- if (dependents != null) {
- Control dep = null;
- for (int i = 0; i < dependents.length; i++) {
- dep = dependents[i];
- if (dep.isEnabled() != enabled)
- dep.setEnabled(enabled);
- }
- }
- }
- }
-
- protected void setWidgetValue(String propertyName, int flag, Button button) {
- if ((button.getStyle() & SWT.CHECK) == SWT.CHECK || (button.getStyle() & SWT.RADIO) == SWT.RADIO) {
- boolean checked = dataModel.getBooleanProperty(propertyName);
- if (button.getSelection() != checked) {
- button.setSelection(checked);
- }
- }
- }
-
- /**
- * @deprecated
- * @param propertyName
- * @param flag
- * @param combo
- */
- private void setWidgetValueDeprecated(String propertyName, int flag, Combo combo) {
- String prop = getConvertedProperty(propertyName);
- if (flag == WTPOperationDataModelListener.VALID_VALUES_CHG || combo.getItemCount() == 0) {
- // Display properties should only fire if the contents change.
- String[] items = dataModel.getValidStringPropertyValues(prop);
- combo.setItems(items);
- }
- String newText = dataModel.getStringProperty(prop);
- int selIndex = combo.getSelectionIndex();
- if (selIndex < 0 || !newText.equals(combo.getItem(selIndex))) {
- String[] items = combo.getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i].equals(newText)) {
- combo.select(i);
- return;
- }
- }
- }
- combo.setText(newText);
- }
-
- protected void setWidgetValue(String propertyName, int flag, Combo combo) {
- if (flag == WTPOperationDataModelListener.VALID_VALUES_CHG || combo.getItemCount() == 0) {
- // Display properties should only fire if the contents change.
- WTPPropertyDescriptor[] descriptors = dataModel.getValidPropertyDescriptors(propertyName);
- String[] items = new String[descriptors.length];
- for (int i = 0; i < descriptors.length; i++) {
- items[i] = descriptors[i].getPropertyDescription();
- }
- combo.setItems(items);
- }
- String newText = dataModel.getPropertyDescriptor(propertyName).getPropertyDescription();
- int selIndex = combo.getSelectionIndex();
- if (selIndex < 0 || !newText.equals(combo.getItem(selIndex))) {
- String[] items = combo.getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i].equals(newText)) {
- combo.select(i);
- return;
- }
- }
- }
- combo.setText(newText);
- }
-
- /**
- * @param propertyName
- * @return
- * @deprecated
- */
- private String getConvertedProperty(String propertyName) {
- if (deprecatedConvertPropertyNames != null) {
- String prop = (String) deprecatedConvertPropertyNames.get(propertyName);
- if (prop != null)
- return prop;
- }
- return propertyName;
- }
-
- protected void setWidgetValue(String propertyName, int flag, Text text) {
- String newText = dataModel.getStringProperty(propertyName);
- if (!newText.equals(text.getText())) {
- text.setText(newText);
- }
- }
-
- protected void setWidgetValue(String propertyName, int flag, Table table) {
- Object[] elements = (Object[]) dataModel.getProperty(propertyName);
- if (elements == null || elements.length == 0) {
- setTableItemsChecked(table.getItems(), false);
- return;
- }
- java.util.List elementList = Arrays.asList(elements);
- TableItem[] tableItems = table.getItems();
- for (int i = 0; i < tableItems.length; i++) {
- TableItem item = tableItems[i];
- if (elementList.contains(item.getData()))
- item.setChecked(true);
- else
- item.setChecked(false);
- }
- }
-
- protected void setTableItemsChecked(TableItem[] tableItems, boolean b) {
- for (int i = 0; i < tableItems.length; i++)
- tableItems[i].setChecked(b);
- }
-
- protected void setWidgetValue(String propertyName, int flag, Tree tree) {
- Object[] elements = (Object[]) dataModel.getProperty(propertyName);
- if (elements == null)
- return;
- java.util.List elementList = Arrays.asList(elements);
- TreeItem[] treeItems = tree.getItems();
- if (elementList.size() == 0) {
- setTreeItemsGrey(treeItems, false);
- return;
- }
- if (treeItems.length > 0)
- setTreeItemChecked(treeItems, elementList);
- }
-
- public void setTreeItemsGrey(TreeItem[] treeItems, boolean b) {
- for (int i = 0; i < treeItems.length; i++) {
- TreeItem item = treeItems[i];
- item.setGrayed(b);
- setTreeItemsGrey(treeItems[i].getItems(), b);
- }
- }
-
- protected void setTreeItemChecked(TreeItem[] treeItems, java.util.List items) {
- for (int i = 0; i < treeItems.length; i++) {
- if (items.contains(treeItems[i].getData()))
- treeItems[i].setChecked(true);
- else
- treeItems[i].setGrayed(true);
- TreeItem[] childernItems = treeItems[i].getItems();
- if (childernItems.length > 0) {
- treeItems[i].setExpanded(true);
- setTreeItemChecked(childernItems, items);
- }
- }
- }
-
- protected void setWidgetValue(String propertyName, int flag, Label label) {
- String newText = dataModel.getStringProperty(propertyName);
- if (!newText.equals(label.getText())) {
- label.setText(newText);
- }
- }
-
- protected void setWidgetValue(String propertyName, int flag, List list) {
- Object newContents = dataModel.getProperty(propertyName);
- if (newContents == null) {
- list.setItems(new String[0]);
- return;
- }
- if (newContents instanceof java.util.List) {
- java.util.List modelContents = (java.util.List) newContents;
- String[] items = new String[modelContents.size()];
- for (int i = 0; i < modelContents.size(); i++) {
- items[i] = modelContents.get(i).toString();
- }
- list.setItems(items);
- } else if (newContents instanceof String[]) {
- list.setItems((String[]) newContents);
- }
- }
-
- public void synchAllUIWithModel() {
- if (null != propertyToWidgetHash) {
- Collection keys = propertyToWidgetHash.keySet();
- if (!keys.isEmpty()) {
- Iterator propertyNames = keys.iterator();
- String propertyName = null;
- while (propertyNames.hasNext()) {
- propertyName = (String) propertyNames.next();
- synchUIWithModel(propertyName, WTPOperationDataModelListener.PROPERTY_CHG);
- }
- }
- }
- }
-
- protected void synchComposite(Widget widget, String propertyName, Control[] depControls) {
- if (null == widgetToPropertyHash)
- widgetToPropertyHash = new HashMap();
- if (propertyToWidgetHash == null)
- propertyToWidgetHash = new HashMap();
- widgetToPropertyHash.put(widget, propertyName);
- propertyToWidgetHash.put(propertyName, widget);
- if (depControls != null) {
- if (widgetToDepControls == null)
- widgetToDepControls = new HashMap();
- widgetToDepControls.put(widget, depControls);
- }
- synchUIWithModel(propertyName, WTPOperationDataModelListener.PROPERTY_CHG);
- }
-
- public void synchText(Text text, String propertyName, Control[] dependentControls) {
- synchText(text, propertyName, false, dependentControls);
- }
-
- public void synchText(Text text, String propertyName, boolean isTimeModified, Control[] dependentControls) {
- synchComposite(text, propertyName, dependentControls);
- if (isTimeModified)
- text.addModifyListener(getTimedListener());
- else
- text.addModifyListener(getModifyTextListener());
- }
-
- public void synchLabel(Label label, String propertyName, Control[] dependentControls) {
- synchComposite(label, propertyName, dependentControls);
- }
-
- /**
- * Use this to synch the contents of the <code>list</code> to the List elements returned from
- * the <code>propertyName</code>.
- */
- public void synchList(List list, String propertyName, Control[] dependentControls) {
- synchComposite(list, propertyName, dependentControls);
- }
-
- /**
- * @deprecated use syncCombo(Combo, String, Control[])
- * @param combo
- * @param propertyName
- * @param actualProperty
- * @param dependentControls
- */
- public void synchCombo(Combo combo, String propertyName, String actualProperty, Control[] dependentControls) {
- if (actualProperty != null) {
- if (propertyToWidgetHash == null)
- propertyToWidgetHash = new Hashtable();
- propertyToWidgetHash.put(actualProperty, combo);
- setConvertProperty(actualProperty, propertyName);
- if (null == deprecatedCombos) {
- deprecatedCombos = new HashSet();
- }
- deprecatedCombos.add(combo);
- }
- synchComposite(combo, propertyName, dependentControls);
- if (null == comboListenerDeprecated) {
- comboListenerDeprecated = new ComboListenerDeprecated();
- }
- combo.addSelectionListener(comboListenerDeprecated);
- combo.addModifyListener(comboListenerDeprecated);
- }
-
- public void synchCombo(Combo combo, String propertyName, Control[] dependentControls) {
- synchComposite(combo, propertyName, dependentControls);
- if (null == comboListener) {
- comboListener = new ComboListener();
- }
- combo.addSelectionListener(comboListener);
- combo.addModifyListener(comboListener);
- }
-
-
- public void synchCheckbox(Button checkbox, String propertyName, Control[] dependentControls) {
- synchComposite(checkbox, propertyName, dependentControls);
- if (null == checkboxSelectionListener) {
- checkboxSelectionListener = new CheckboxSelectionListener();
- }
- checkbox.addSelectionListener(checkboxSelectionListener);
- }
-
- public void synchCheckBoxTableViewer(CheckboxTableViewer tableViewer, String propertyName, Control[] dependentControls) {
- synchComposite(tableViewer.getControl(), propertyName, dependentControls);
- if (null == checkBoxViewerStateListener) {
- checkBoxViewerStateListener = new CheckBoxViewerListener();
- }
- tableViewer.addCheckStateListener(checkBoxViewerStateListener);
- }
-
- public void synchCheckBoxTreeViewer(CheckboxTreeViewer treeViewer, String propertyName, Control[] dependentControls) {
- treeViewer.expandAll();
- synchComposite(treeViewer.getControl(), propertyName, dependentControls);
- if (null == checkBoxViewerStateListener) {
- checkBoxViewerStateListener = new CheckBoxViewerListener();
- }
- treeViewer.addCheckStateListener(checkBoxViewerStateListener);
- }
-
- public void synchRadio(Button radio, String propertyName, Control[] dependentControls) {
- // Uses checkbox syncher
- synchCheckbox(radio, propertyName, dependentControls);
- }
-
- /**
- * This is necessary when a property is not actually persisted in the model but converted to
- * another property. @param actualProperty @param convertProperty
- * @deprecated
- */
- private void setConvertProperty(String actualProperty, String convertProperty) {
- if (deprecatedConvertPropertyNames == null)
- deprecatedConvertPropertyNames = new HashMap();
- deprecatedConvertPropertyNames.put(actualProperty, convertProperty);
- }
-
- private TimedModifyListener getTimedListener() {
- if (timedModifyListener == null)
- timedModifyListener = new TimedModifyListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Widget w = (Widget) e.getSource();
- if (currentWidget == w || w.isDisposed())
- return;
- String propertyName = (String) widgetToPropertyHash.get(w);
- setTextProperty(propertyName, (Text) w);
- }
- }) {
- public void modifyText(ModifyEvent e) {
- if (ignoreModifyEvent)
- return;
- super.modifyText(e);
- }
- };
- return timedModifyListener;
- }
-
- protected void setTextProperty(String propertyName, Text text) {
- setProperty(propertyName, text.getText());
- }
-
- private ModifyTextListener getModifyTextListener() {
- if (null == modifyTextListener)
- modifyTextListener = new ModifyTextListener();
- return modifyTextListener;
- }
-
- public WTPOperationDataModel getDataModel() {
- return dataModel;
- }
-
- public void dispose() {
- dataModel.removeListener(this);
- checkboxSelectionListener = null;
- deprecatedConvertPropertyNames = null;
- deprecatedCombos = null;
- currentWidget = null;
- modifyTextListener = null;
- propertyToWidgetHash = null;
- timedModifyListener = null;
- widgetToDepControls = null;
- widgetToPropertyHash = null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPGenericActionIds.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPGenericActionIds.java
deleted file mode 100644
index faaa453..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPGenericActionIds.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jun 16, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public interface WTPGenericActionIds {
-
- String CUT = "org.eclipse.wst.common.generic.Cut"; //$NON-NLS-1$
- String COPY = "org.eclipse.wst.common.generic.Copy"; //$NON-NLS-1$
- String PASTE = "org.eclipse.wst.common.generic.Paste"; //$NON-NLS-1$
- String RENAME = "org.eclipse.wst.common.generic.Rename"; //$NON-NLS-1$
- String DELETE = "org.eclipse.wst.common.generic.Delete"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOperationAction.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOperationAction.java
deleted file mode 100644
index ed0f12e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOperationAction.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 29, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.MasterDescriptor;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.UIOperationExtensionRegistry;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.WTPOptionalOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.ComposedOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPOperationAction extends Action implements IActionDelegate, IViewActionDelegate {
-
- private IStructuredSelection selection;
-
- private IViewPart viewPart;
-
- private IWorkbenchSite workbenchSite;
-
- public WTPOperationAction() {
- }
-
- public WTPOperationAction(String id, String name) {
- super(name);
- init(id, null);
- }
-
- public WTPOperationAction(String id, String name, ImageDescriptor imgDescriptor) {
- super(name, imgDescriptor);
- init(id, null);
- }
-
- public WTPOperationAction(String id, String name, IWorkbenchSite site) {
- super(name);
- init(id, site);
- }
-
- public WTPOperationAction(String id, String name, ImageDescriptor imgDescriptor, IWorkbenchSite site) {
- super(name, imgDescriptor);
- init(id, site);
- }
-
- /**
- * @param id
- * @param site
- */
- private void init(String id, IWorkbenchSite site) {
- this.setId(id);
- this.setWorkbenchSite(site);
- }
-
- /**
- * @param selection
- * @return
- */
- protected boolean updateSelection(IAction action, IStructuredSelection selection1) {
- this.selection = selection1;
- MasterDescriptor[] masters = UIOperationExtensionRegistry.INSTANCE.getExtendedUIOperations(action.getId(), selection);
- action.setEnabled(masters.length > 0);
- return masters.length > 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- run(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public final void run(IAction action) {
-
- if (action == null)
- return;
-
- WTPOptionalOperationDataModel operationDataModel = WTPOptionalOperationDataModel.createDataModel(action.getId(), this.selection);
- operationDataModel.setProperty(WTPOptionalOperationDataModel.IWORKBENCH_SITE, getWorkbenchSite());
-
- executeCompoundOperation(operationDataModel);
- }
-
- /**
- * @return
- */
- public IWorkbenchSite getWorkbenchSite() {
- if (workbenchSite != null)
- return workbenchSite;
- if (viewPart != null)
- return viewPart.getSite();
- return null;
- }
-
- /**
- * @param shell
- * @param operationDataModel
- * @param exec
- */
- protected void executeCompoundOperation(WTPOptionalOperationDataModel operationDataModel) {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- try {
- WTPOperation operation = operationDataModel.getDefaultOperation();
- operationDataModel.setOperationValidationEnabled(true);
- final List runnables = ((ComposedOperation) operation).getRunnables();
- /*
- * PlatformUI.getWorkbench().getProgressService().run(true, false, new
- * IRunnableWithProgress() {
- *
- *
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- *
- * public void run(IProgressMonitor monitor) throws InvocationTargetException,
- * InterruptedException {
- */
- /* monitor.beginTask("Executing compound operation", runnables.size()); */
- SubProgressMonitor submonitor = null;
- for (int i = 0; i < runnables.size(); i++) {
- final WTPOperation op = (WTPOperation) runnables.get(i);
- if (op != null) {
- /* submonitor = new SubProgressMonitor(monitor, 3); */
- op.run(submonitor);
- }
- /* monitor.worked(1); */
- }
- /* monitor.done(); */
- /*
- * } });
- */
- /* operation.run(new NullProgressMonitor()); */
- status = operation.getStatus();
- if (!status.isOK()) {
- ErrorDialog.openError(shell, WTPCommonUIResourceHandler.getString("WTPOperationAction_UI_0"), WTPCommonUIResourceHandler.getString("WTPOperationAction_UI_1"), status); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- status = new Status(IStatus.ERROR, WTPUIPlugin.PLUGIN_ID, 0, e.toString(), e);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection1) {
- if (selection1 instanceof IStructuredSelection)
- setEnabled(updateSelection(action, (IStructuredSelection) selection1));
- else {
- action.setEnabled(false);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- this.viewPart = view;
- }
-
- /**
- * @param workbenchSite
- * The workbenchSite to set.
- */
- public void setWorkbenchSite(IWorkbenchSite workbenchSite) {
- this.workbenchSite = workbenchSite;
- }
-
- protected IStatus status;
-
- /**
- * @return Returns the status.
- */
- public IStatus getStatus() {
- return status;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOptionalOperationAction.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOptionalOperationAction.java
deleted file mode 100644
index a2d36d3..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPOptionalOperationAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 29, 2004
- *
- * TODO To change the template for this generated file go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.IOperationNode;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.WTPActionDialog;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.WTPOptionalOperationDataModel;
-
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPOptionalOperationAction extends WTPOperationAction {
-
- public WTPOptionalOperationAction() {
- }
-
-
- public WTPOptionalOperationAction(String id, String name) {
- super(id, name);
- }
-
- public WTPOptionalOperationAction(String id, String name, ImageDescriptor imgDescriptor) {
- super(id, name, imgDescriptor);
- }
-
-
- public WTPOptionalOperationAction(String id, String name, IWorkbenchSite site) {
- super(id, name, site);
- }
-
- public WTPOptionalOperationAction(String id, String name, ImageDescriptor imgDescriptor, IWorkbenchSite site) {
- super(id, name, imgDescriptor, site);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.ui.WTPOperationAction#executeCompoundOperation(org.eclipse.wst.common.frameworks.internal.operation.extension.ui.WTPOptionalOperationDataModel)
- */
- protected void executeCompoundOperation(WTPOptionalOperationDataModel operationDataModel) {
- if (operationDataModel != null) {
- IOperationNode root = (IOperationNode) operationDataModel.getProperty(WTPOptionalOperationDataModel.OPERATION_TREE);
- if (WTPOptionalOperationDataModel.getOptionalChildren(root).length > 0) {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- WTPActionDialog optionalDialog = new WTPActionDialog(shell, operationDataModel);
- optionalDialog.setId(getId());
- if (optionalDialog.open() == Window.OK)
- super.executeCompoundOperation(operationDataModel);
- else
- status = Status.CANCEL_STATUS;
- } else
- super.executeCompoundOperation(operationDataModel);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPUIPlugin.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPUIPlugin.java
deleted file mode 100644
index c831bb7..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPUIPlugin.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class WTPUIPlugin extends AbstractUIPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.wst.common.frameworks.internal.ui"; //$NON-NLS-1$
- public static final String EXTENDED_VIEWER_REGISTRY_EXTENSION_POINT = "extendedViewer"; //$NON-NLS-1$
- //The shared instance.
- private static WTPUIPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public WTPUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.common.frameworks.internal.ui.WTPUIPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createErrorStatus(String message) {
- return createErrorStatus(message, null);
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, PLUGIN_ID, -1, message, exception);
- }
-
- /**
- * Returns the shared instance.
- */
- public static WTPUIPlugin getDefault() {
- return plugin;
- }
-
- public static Logger getLogger() {
- return Logger.getLogger(PLUGIN_ID);
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Return the workbench
- *
- * This method is internal to the j2ee plugin and must not be called by any other plugins.
- */
-
- public static IWorkbench getPluginWorkbench() {
- return getDefault().getWorkbench();
-
- }
-
- public static IRunnableWithProgress getRunnableWithProgress(IHeadlessRunnableWithProgress aHeadlessRunnableWithProgress) {
- return new RunnableWithProgressWrapper(aHeadlessRunnableWithProgress);
- }
-
- /**
- * Returns the string from the plugin's resource bundle, or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = WTPUIPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null ? bundle.getString(key) : key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizard.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizard.java
deleted file mode 100644
index a22012e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizard.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.IExtendedWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementManager;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-
-public abstract class WTPWizard extends Wizard {
- protected WTPOperationDataModel model;
-
- public WTPWizard(WTPOperationDataModel model) {
- this.model = model;
- }
-
- public WTPWizard() {
- this.model = createDefaultModel();
- }
-
- /**
- * Return a new default WTPOperationDataModel.
- *
- * @return
- */
- protected abstract WTPOperationDataModel createDefaultModel();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#canFinish()
- */
- public boolean canFinish() {
- if (super.canFinish())
- return model.isValid();
- return false;
- }
-
- protected void resetAfterFinishError() {
- IWizardPage[] pages = getPages();
- for (int i = 0; i < pages.length; i++) {
- WTPWizardPage wtpPage = (WTPWizardPage) pages[i];
- wtpPage.validatePage(true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public final boolean performFinish() {
- WTPOperation op = null;
- boolean wasSuccessful = false;
- try {
- model.setProperty(WTPOperationDataModel.UI_OPERATION_HANLDER, new UIOperationHandler(getShell()));
- if (prePerformFinish()) {
- storeDefaultSettings();
- op = createOperation();
- if (!model.getBooleanProperty(WTPOperationDataModel.RUN_OPERATION)) {
- model.setProperty(WTPOperationDataModel.CACHED_DELAYED_OPERATION, op);
- wasSuccessful = isSuccessfulFinish(op);
- return wasSuccessful;
- }
- if (op != null) {
- IRunnableWithProgress runnable = WTPUIPlugin.getRunnableWithProgress(op);
- try {
- getContainer().run(runForked(), isCancelable(), runnable);
- postPerformFinish();
- } catch (InvocationTargetException e) {
- Logger.getLogger().logError(e);
- ErrorDialog.openError(getShell(), WTPCommonUIResourceHandler.getString("WTPWizard_UI_0", new Object[]{getWindowTitle()}), WTPCommonUIResourceHandler.getString("WTPWizard_UI_1", new Object[]{getWindowTitle()}), e, 0, false); //$NON-NLS-1$ //$NON-NLS-2$
- wasSuccessful = false;
- return wasSuccessful;
- } catch (InterruptedException e) {
- Logger.getLogger().logError(e);
- wasSuccessful = false;
- return wasSuccessful;
- }
- }
- }
- wasSuccessful = isSuccessfulFinish(op);
- return wasSuccessful;
- } finally {
- if (!wasSuccessful) {
- resetAfterFinishError();
- }
- }
- }
-
- /**
- * @param op
- * @return
- */
- protected boolean isSuccessfulFinish(WTPOperation op) {
- return op != null;
- }
-
- /**
- * Subclass can override to perform any tasks prior to running the operation. Return true to
- * have the operation run and false to stop the execution of the operation.
- *
- * @return
- */
- protected boolean prePerformFinish() {
- return true;
- }
-
- /**
- * Subclasses should override to perform any actions necessary after performing Finish.
- */
- protected void postPerformFinish() throws InvocationTargetException {
- }
-
- protected void storeDefaultSettings() {
- IWizardPage[] pages = getPages();
- for (int i = 0; i < pages.length; i++)
- storeDefaultSettings(pages[i], i);
- }
-
- /**
- * Subclasses may override if they need to do something special when storing the default
- * settings for a particular page.
- *
- * @param page
- * @param pageIndex
- */
- protected void storeDefaultSettings(IWizardPage page, int pageIndex) {
- if (page instanceof WTPWizardPage)
- ((WTPWizardPage) page).storeDefaultSettings();
- }
-
- /**
- * Subclasses should override if the running operation is allowed to be cancelled. The default
- * is false.
- *
- * @return
- */
- protected boolean isCancelable() {
- return false;
- }
-
- /**
- * Subclasses should override to return false if the running operation cannot be run forked.
- *
- * @return
- */
- protected boolean runForked() {
- return false;
- }
-
- /**
- * Return the operation that will perform the task suported by this wizard.
- *
- * @return IHeadlessRunnableWithProgress
- */
- protected abstract WTPOperation createOperation();
-
- /**
- * @return Returns the model.
- */
- public WTPOperationDataModel getModel() {
- return model;
- }
-
- public void dispose() {
- super.dispose();
- if (null != model) {
- model.dispose();
- }
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getNextPage(IWizardPage page) {
- IWizardPage nextPage = super.getNextPage(page);
-
- if (nextPage instanceof IExtendedWizardPage) {
- IExtendedWizardPage extendedWizardPage = (IExtendedWizardPage) nextPage;
- if (!EnablementManager.INSTANCE.getIdentifier(extendedWizardPage.getGroupID(), getModel().getTargetProject()).isEnabled())
- return getNextPage(nextPage);
- }
- return nextPage;
- }
-
- public void addPage(IWizardPage page) {
- if (model.isProperty(WTPWizardSkipPageDataModel.SKIP_PAGES) && null != page.getName()) {
- List pagesToSkip = (List) model.getProperty(WTPWizardSkipPageDataModel.SKIP_PAGES);
- if (null != pagesToSkip && pagesToSkip.contains(page.getName())) {
- return;
- }
- }
- super.addPage(page);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardPage.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardPage.java
deleted file mode 100644
index b1a4baa..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardPage.java
+++ /dev/null
@@ -1,435 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelListener;
-
-
-public abstract class WTPWizardPage extends WizardPage implements Listener, WTPOperationDataModelListener {
- protected static final int NEXT = 1;
- protected static final int PREVIOUS = 2;
- protected static final int COMPOSITE_BORDER = SWT.NULL;
- private ValidationStatus status = new ValidationStatus();
- private boolean isValidating = false;
- protected boolean isFirstTimeToPage = true;
- protected WTPOperationDataModel model;
- private Map validationMap;
- private String[] validationPropertyNames;
- protected WTPDataModelSynchHelper synchHelper;
- private String infopopID;
-
- /**
- * J2EEWizardPage constructor comment.
- *
- * @param pageName
- * java.lang.String
- */
- protected WTPWizardPage(WTPOperationDataModel model, String pageName) {
- super(pageName);
- this.model = model;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
- /**
- * @return
- */
- public WTPDataModelSynchHelper initializeSynchHelper(WTPOperationDataModel dm) {
- return new WTPDataModelSynchHelper(dm);
- }
-
- /**
- * J2EEWizardPage constructor comment.
- *
- * @param pageName
- * java.lang.String
- * @param title
- * java.lang.String
- * @param titleImage
- * org.eclipse.jface.resource.ImageDescriptor
- */
- protected WTPWizardPage(WTPOperationDataModel model, String pageName, String title, org.eclipse.jface.resource.ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- this.model = model;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
- protected IPath convertPackageNameToPath(String qualifiedName) {
- String name = qualifiedName.replace('.', '/');
- return new Path(name);
- }
-
- /**
- * Creates the top level control for this dialog page under the given parent composite. This
- * method has been abstract and it uses the template pattern to get the correct items setup in
- * the correct order. See the set of methods below that are called in this method.
- * <p>
- * Implementors are responsible for ensuring that the created control can be accessed via
- * <code>getControl</code>
- * </p>
- *
- * @param parent
- * the parent composite
- */
- public final void createControl(org.eclipse.swt.widgets.Composite parent) {
- Composite top = createTopLevelComposite(parent);
- setControl(top);
- setupInfopop(top);
- setDefaults();
- addListeners();
- initializeValidationProperties();
- }
-
- private void initializeValidationProperties() {
- validationPropertyNames = getValidationPropertyNames();
- if (validationPropertyNames == null || validationPropertyNames.length == 0)
- validationMap = Collections.EMPTY_MAP;
- else {
- validationMap = new HashMap(validationPropertyNames.length);
- for (int i = 0; i < validationPropertyNames.length; i++)
- validationMap.put(validationPropertyNames[i], new Integer(i));
- }
- }
-
- /**
- * Subclass should return the model property names that need to be validated on this page in the
- * order that they should present their messages.
- *
- * @return
- */
- protected abstract String[] getValidationPropertyNames();
-
- /**
- * Return true of the property validation status is OK.
- *
- * @param propertyKey
- * @return
- */
- protected boolean getPropertyOKStatus(String propertyKey) {
- Integer validationKey = getValidationKey(propertyKey);
- if (validationKey != null)
- return getStatus(validationKey);
- return true;
- }
-
- /**
- * @param propertyKey
- * @return
- */
- private Integer getValidationKey(String propertyKey) {
- return (Integer) validationMap.get(propertyKey);
- }
-
- /**
- * Return the top level Composite for this page.
- */
- protected abstract Composite createTopLevelComposite(Composite parent);
-
- /**
- * Set up info pop hooks if set.
- */
- protected void setupInfopop(Control parent) {
- if (getInfopopID() != null)
- WorkbenchHelp.setHelp(parent, getInfopopID());
- }
-
- /**
- * Setup the default values for this page. Subclasses should override to provide appropriate
- * defaults.
- */
- protected void setDefaults() {
- restoreDefaultSettings();
- }
-
- /**
- * Subclasses should implement this method if they have default settings that have been stored
- * and need to be restored.
- *
- * @see storeDefaultSettings()
- */
- protected void restoreDefaultSettings() {
- }
-
- /**
- * Add Listeners to controls at this point to avoid unnecessary events. Subclasses should
- * override to add listeners to its controls.
- */
- protected void addListeners() {
- }
-
- /**
- * The page is being made current and visible. Subclasses may extend.
- */
- protected void enter() {
- try {
- validatePage(showValidationErrorsOnEnter());
- } finally {
- isFirstTimeToPage = false;
- }
- }
-
- /**
- * The default behavior is to return true unless it is the first time entering this page in
- * which case we check to see if there is a previous page and return true if there is not.
- * Subclasses should override if they do not want this default behavior.
- */
- protected boolean showValidationErrorsOnEnter() {
- return !isFirstTimeToPage();
- }
-
- /**
- * The default behavior is to return true unless it is the first time entering this page in
- * which case we check to see if there is a previous page and return true if there is not.
- * Subclasses should override if they do not want this default behavior.
- *
- * @deprecated - use showValidatoinErrorsOnEnter instead
- */
- protected boolean shouldValidateOnEnter() {
- return showValidationErrorsOnEnter();
- }
-
- /**
- * Exiting the page. Subclasses may extend.
- */
- protected void exit() {
- }
-
- protected boolean getStatus(Integer key) {
- return status.hasError(key);
- }
-
- /**
- * Sent when an event that the receiver has registered for occurs. If a subclass overrides this
- * method, it must call super.
- *
- * @param event
- * the event which occurred
- */
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- //validatePage();
- }
-
- /**
- * Set the error message for this page based on the last error in the ValidationStatus.
- */
- protected void setErrorMessage() {
- String error = status.getLastErrMsg();
- if (error == null) {
- if (getErrorMessage() != null)
- setErrorMessage((String) null);
- String warning = status.getLastWarningMsg();
- if (warning == null) {
- if (getMessage() != null && getMessageType() == IMessageProvider.WARNING)
- setMessage(null, IMessageProvider.WARNING);
- } else if (!warning.equals(getMessage()))
- setMessage(warning, IMessageProvider.WARNING);
- } else if (!error.equals(getErrorMessage()))
- setErrorMessage(error);
- }
-
- protected void setErrorStatus(Integer key, String errorMessage) {
- status.setErrorStatus(key, errorMessage);
- }
-
- protected void setWarningStatus(Integer key, String warningMessage) {
- status.setWarningStatus(key, warningMessage);
- }
-
- protected void setOKStatus(Integer key) {
- status.setOKStatus(key);
- }
-
- /**
- * The <code>DialogPage</code> implementation of this <code>IDialogPage</code> method sets
- * the control to the given visibility state. Subclasses may extend.
- */
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible)
- enter();
- else
- exit();
- }
-
- /**
- * This should be called by the Wizard just prior to running the performFinish operation.
- * Subclasses should override to store their default settings.
- */
- public void storeDefaultSettings() {
- }
-
- /**
- * The page is now being validated. At this time, each control is validated and then the
- * controls are updated based on the results in the ValidationStatus which was updated during
- * <code>validateControls()</code>. Finally, it will display the last error message and it
- * will set the page complete. Subclasses will not typically override this method.
- */
- protected void validatePage() {
- validatePage(true);
- }
-
- protected void validatePage(boolean showMessage) {
- if (!isValidating) {
- isValidating = true;
- try {
- validateControlsBase();
- updateControls();
- if (showMessage)
- setErrorMessage();
- setPageComplete(status.getLastErrMsg() == null);
- } finally {
- isValidating = false;
- }
- }
- }
-
- /**
- * Validate individual controls. Use validation keys to keep track of errors.
- *
- * @see setOKStatus(Integer) and setErrorMessage(Integer, String)
- */
- protected final String validateControlsBase() {
- if (!validationMap.isEmpty()) {
- String propName;
- for (int i = 0; i < validationPropertyNames.length; i++) {
- propName = validationPropertyNames[i];
- Integer valKey = (Integer) validationMap.get(propName);
- if (valKey != null)
- validateProperty(propName, valKey);
- if (!getStatus(valKey))
- return propName;
- }
- }
- return null;
- }
-
- /**
- * @param propertyName
- * @param validationkey
- */
- private void validateProperty(String propertyName, Integer validationKey) {
- setOKStatus(validationKey);
- IStatus status1 = model.validateProperty(propertyName);
- if (!status1.isOK()) {
- String message = status1.isMultiStatus() ? status1.getChildren()[0].getMessage() : status1.getMessage();
- switch (status1.getSeverity()) {
- case IStatus.ERROR :
- setErrorStatus(validationKey, message);
- break;
- case IStatus.WARNING :
- setWarningStatus(validationKey, message);
- break;
- }
- }
- }
-
- /**
- * Update the enablement of controls after validation. Sublcasses should check the status of
- * validation keys to determine enablement.
- */
- protected void updateControls() {
- }
-
- /**
- * Gets the isFirstTimeToPage.
- *
- * @return Returns a boolean
- */
- protected boolean isFirstTimeToPage() {
- return isFirstTimeToPage;
- }
-
- protected void setJavaStatusMessage(IStatus javaStatus, Integer statusKey, String message) {
- if (javaStatus.getSeverity() == IStatus.WARNING)
- setWarningStatus(statusKey, message);
- else
- setErrorStatus(statusKey, message);
- }
-
- /**
- * @param b
- */
- public void setFirstTimeToPage(boolean b) {
- isFirstTimeToPage = b;
- }
-
- /*
- * If a property changes that we want to validate, force validation on this page.
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelListener#propertyChanged(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- public void propertyChanged(WTPOperationDataModelEvent event) {
- String propertyName = event.getPropertyName();
- if (validationPropertyNames != null && (event.getFlag() == PROPERTY_CHG || (!isPageComplete() && event.getFlag() == VALID_VALUES_CHG))) {
- for (int i = 0; i < validationPropertyNames.length; i++) {
- if (validationPropertyNames[i].equals(propertyName)) {
- validatePage();
- break;
- }
- }
- }
- }
-
- protected void addSpacers(Composite comp, int spacers) {
- for (int i = 0; i < spacers; i++)
- new Label(comp, SWT.NONE);
- }
-
- /**
- * @return Returns the model.
- */
- protected WTPOperationDataModel getModel() {
- return model;
- }
-
- /**
- * @return Returns the synchHelper.
- */
- protected WTPDataModelSynchHelper getSynchHelper() {
- return synchHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
- */
- public void dispose() {
- super.dispose();
- if (synchHelper != null) {
- synchHelper.dispose();
- synchHelper = null;
- }
- }
-
- protected String getInfopopID() {
- return infopopID;
- }
-
- public void setInfopopID(String infopopID) {
- this.infopopID = infopopID;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSelectionPage.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSelectionPage.java
deleted file mode 100644
index 4382c0e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSelectionPage.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 27, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-/**
- * @author DABERG
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public abstract class WTPWizardSelectionPage extends WTPWizardPage {
- /**
- * @param model
- * @param pageName
- */
- public WTPWizardSelectionPage(WTPOperationDataModel model, String pageName) {
- super(model, pageName);
- }
-
- /**
- * @param model
- * @param pageName
- * @param title
- * @param titleImage
- */
- public WTPWizardSelectionPage(WTPOperationDataModel model, String pageName, String title, ImageDescriptor titleImage) {
- super(model, pageName, title, titleImage);
- }
-
- /**
- * The selected node; <code>null</code> if none.
- */
- private IWizardNode selectedNode = null;
-
- /**
- * List of wizard nodes that have cropped up in the past (element type: <code>IWizardNode</code>).
- */
- private List selectedWizardNodes = new ArrayList();
-
- /**
- * Adds the given wizard node to the list of selected nodes if it is not already in the list.
- *
- * @param node
- * the wizard node, or <code>null</code>
- */
- private void addSelectedNode(IWizardNode node) {
- if (node == null)
- return;
-
- if (selectedWizardNodes.contains(node))
- return;
-
- selectedWizardNodes.add(node);
- }
-
- /**
- * The <code>WizardSelectionPage</code> implementation of this <code>IWizardPage</code>
- * method returns <code>true</code> if there is a selected node.
- */
- public boolean canFlipToNextPage() {
- return isPageComplete() && selectedNode != null;
- }
-
- /**
- * The <code>WizardSelectionPage</code> implementation of an <code>IDialogPage</code> method
- * disposes of all nested wizards. Subclasses may extend.
- */
- public void dispose() {
- super.dispose();
- // notify nested wizards
- for (int i = 0; i < selectedWizardNodes.size(); i++) {
- ((IWizardNode) selectedWizardNodes.get(i)).dispose();
- }
- }
-
- /**
- * The <code>WizardSelectionPage</code> implementation of this <code>IWizardPage</code>
- * method returns the first page of the currently selected wizard if there is one.
- */
- public IWizardPage getNextPage() {
- if (selectedNode == null)
- return null;
-
- boolean isCreated = selectedNode.isContentCreated();
-
- IWizard wizard = selectedNode.getWizard();
-
- if (wizard == null) {
- setSelectedNode(null);
- return null;
- }
-
- if (!isCreated)
- // Allow the wizard to create its pages
- wizard.addPages();
-
- return wizard.getStartingPage();
- }
-
- /**
- * Returns the currently selected wizard node within this page.
- *
- * @return the wizard node, or <code>null</code> if no node is selected
- */
- public IWizardNode getSelectedNode() {
- return selectedNode;
- }
-
- /**
- * Sets or clears the currently selected wizard node within this page.
- *
- * @param node
- * the wizard node, or <code>null</code> to clear
- */
- protected void setSelectedNode(IWizardNode node) {
- addSelectedNode(node);
- selectedNode = node;
- if (isCurrentPage())
- getContainer().updateButtons();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSkipPageDataModel.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSkipPageDataModel.java
deleted file mode 100644
index 22532f4..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WTPWizardSkipPageDataModel.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 25, 2004
- *
- */
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-import java.util.Collections;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-
-/**
- * @author jsholl
- *
- */
-public class WTPWizardSkipPageDataModel extends WTPOperationDataModel {
-
- /**
- * A List of Strings identifying the page id's to skip
- */
- public static final String SKIP_PAGES = "WTPWizardSkipPageDataModel.SKIP_PAGES"; //$NON-NLS-1$
-
- public WTPOperation getDefaultOperation() {
- return null;
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(SKIP_PAGES);
- }
-
- protected Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(SKIP_PAGES)) {
- return Collections.EMPTY_LIST;
- }
- return super.getDefaultProperty(propertyName);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WorkspaceModifyComposedOperation.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WorkspaceModifyComposedOperation.java
deleted file mode 100644
index 82aea76..0000000
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/WorkspaceModifyComposedOperation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.ui;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-/**
- * An operation which delegates its work to a runnable that modifies the workspace.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- */
-public class WorkspaceModifyComposedOperation extends org.eclipse.ui.actions.WorkspaceModifyOperation {
- protected List fRunnables;
-
- public WorkspaceModifyComposedOperation(ISchedulingRule rule) {
- super(rule);
- }
-
- /**
- * Creates a new operation which will delegate its work to the given runnable.
- */
- public WorkspaceModifyComposedOperation() {
- super();
- }
-
- public WorkspaceModifyComposedOperation(ISchedulingRule rule, List nestedRunnablesWithProgress) {
- super(rule);
- fRunnables = nestedRunnablesWithProgress;
- }
-
- public WorkspaceModifyComposedOperation(List nestedRunnablesWithProgress) {
- super();
- fRunnables = nestedRunnablesWithProgress;
- }
-
- /**
- * Creates a new operation which will delegate its work to the given runnable.
- *
- * @param content
- * the runnable to delegate to when this operation is executed
- */
- public WorkspaceModifyComposedOperation(IRunnableWithProgress nestedOp) {
- super();
- getRunnables().add(nestedOp);
- }
-
- public boolean addRunnable(IRunnableWithProgress nestedOp) {
- return getRunnables().add(nestedOp);
- }
-
- protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- int size = fRunnables.size();
- monitor.beginTask("", size);//$NON-NLS-1$
- for (int i = 0; i < fRunnables.size(); i++) {
- IRunnableWithProgress op = (IRunnableWithProgress) fRunnables.get(i);
- op.run(new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- }
- }
-
- protected List getRunnables() {
- if (fRunnables == null)
- fRunnables = new ArrayList(3);
- return fRunnables;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/.classpath b/plugins/org.eclipse.wst.common.frameworks/.classpath
deleted file mode 100644
index da6dc6b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="src-non_workbench/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.common.frameworks/.cvsignore b/plugins/org.eclipse.wst.common.frameworks/.cvsignore
deleted file mode 100644
index ce4d9ca..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-temp.folder
-common_core.jar
-common.jar
diff --git a/plugins/org.eclipse.wst.common.frameworks/.options b/plugins/org.eclipse.wst.common.frameworks/.options
deleted file mode 100644
index 2eaab8a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/.options
+++ /dev/null
@@ -1,3 +0,0 @@
-org.eclipse.wtp.common/debug/logtrace=false
-org.eclipse.wtp.common/debug/logtracefile=false
-org.eclipse.wtp.common/debug/loglevel=WARNING
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/.project b/plugins/org.eclipse.wst.common.frameworks/.project
deleted file mode 100644
index 30f458a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.frameworks</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.common.frameworks/build.properties b/plugins/org.eclipse.wst.common.frameworks/build.properties
deleted file mode 100644
index 69bbf71..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-output.common_core.jar = bin/
-bin.includes = plugin.xml,\
- common_core.jar,\
- common.jar,\
- .options
-jars.compile.order = common_core.jar,\
- common.jar
-src.includes = schema/
-source.common_core.jar = src-non_workbench/
-source.common.jar = src/
diff --git a/plugins/org.eclipse.wst.common.frameworks/plugin.xml b/plugins/org.eclipse.wst.common.frameworks/plugin.xml
deleted file mode 100644
index 96b726e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/plugin.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.common.frameworks"
- name="org.eclipse.wst.common.frameworks"
- version="1.0.0"
- description="This is a holding place for common frameworks used by components used in WTP currently it includes the following frameworks: operation/data model,function groups framework"
- class="org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin">
-
- <runtime>
- <library name="common.jar">
- <export name="*"/>
- </library>
- <library name="common_core.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="com.ibm.wtp.common.util" export="true"/>
- </requires>
-
-
- <extension-point id="ExtendableOperation" name="Extendable Operation" schema="schema/ExtendableOperation.exsd"/>
- <extension-point id="OperationExtension" name="OperationExtension" schema="schema/OperationExtension.exsd"/>
- <extension-point id="functionGroup" name="Function Extension Group" schema="schema/functionGroup.exsd"/>
- <extension-point id="WTPActivityBridgeHelper" name="WTPActivityBridgeHelper" schema="schema/WTPActivityBridgeHelper.exsd"/>
- <extension-point id="validationSelectionHandler" name="validationSelectionHandler" schema="schema/validationSelectionHandler.exsd"/>
-
- <extension
- id="context.Sensitive.Class.saveHandler"
- name="Save Handler - Headless Context Class"
- point="com.ibm.wtp.common.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- key="saveHandler"
- context="Headless"
- className="org.eclipse.wst.common.frameworks.internal.SaveHandlerHeadless">
- </uiContextSensitiveClass>
- </extension>
- <extension
- id="org.eclipse.wst.common.frameworks.internal.enablement"
- point="com.ibm.wtp.common.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- key="org.eclipse.wst.common.frameworks.internal.EnablementDetermination"
- context="Headless"
- className="org.eclispe.wst.common.frameworks.internal.enablement.EnablementManager">
- </uiContextSensitiveClass>
- </extension>
-
-</plugin>
diff --git a/plugins/org.eclipse.wst.common.frameworks/prepareforpii.xml b/plugins/org.eclipse.wst.common.frameworks/prepareforpii.xml
deleted file mode 100644
index 638c7dc..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/prepareforpii.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<project name="PrepareForPII" default="main" basedir=".">
-
- <!-- Setup temp variables -->
- <target name="init">
- <property name="nlsDir" value="d:/NLS/Corona/0526"/>
- <property name="plugin" value="com.ibm.wtp.common"/>
- <property name="plugindir" value="d:/workspaceCorona/${plugin}"/>
- <property name="outputDir" value="${nlsDir}/${plugin}"/>
-
-
- </target>
-
- <!-- Create the destination dir -->
- <target name="nlsDir" depends="init">
- <mkdir dir="${nlsDir}"/>
- </target>
-
- <!-- Create the destination dir -->
- <target name="plugindir" depends="nlsDir">
- <delete dir="${outputDir}"/>
- <mkdir dir="${outputDir}"/>
- </target>
-
- <!-- Move the files to the correct locations in the workspace. -->
- <target name="main" depends="plugindir">
-
- <messageIdGen folderPath = "${plugindir}" componentId = "E" />
-
- <copy todir = "${outputDir}/src" >
- <fileset dir="${plugindir}/src">
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
-
- </target>
-</project>
diff --git a/plugins/org.eclipse.wst.common.frameworks/schema/ExtendableOperation.exsd b/plugins/org.eclipse.wst.common.frameworks/schema/ExtendableOperation.exsd
deleted file mode 100644
index af71234..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/schema/ExtendableOperation.exsd
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.etools.j2ee">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.etools.j2ee" id="ExtendableOperation" name="ExtendabledOperation"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="extendableOperation"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="extendableOperation">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks/schema/OperationExtension.exsd b/plugins/org.eclipse.wst.common.frameworks/schema/OperationExtension.exsd
deleted file mode 100644
index 1af334f..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/schema/OperationExtension.exsd
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.etools.j2ee.com.ibm.etools.operations">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.etools.j2ee.com.ibm.etools.operations" id="extension" name="OperationExtension"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="operationExtension"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="operationExtension">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="preOperationClass" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="postOperationClass" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks/schema/WTPActivityBridgeHelper.exsd b/plugins/org.eclipse.wst.common.frameworks/schema/WTPActivityBridgeHelper.exsd
deleted file mode 100644
index 42ce152..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/schema/WTPActivityBridgeHelper.exsd
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.wtp.common">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.frameworks" id="WTPActivityBridge" name="WTPActivityBridge"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="WTPActivityBridgeHelper"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="WTPActivityBridgeHelper">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks/schema/functionGroup.exsd b/plugins/org.eclipse.wst.common.frameworks/schema/functionGroup.exsd
deleted file mode 100644
index aafd7e3..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/schema/functionGroup.exsd
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="com.ibm.etools.emf.workbench">
-<annotation>
- <appInfo>
- <meta.schema plugin="com.ibm.etools.emf.workbench" id="group" name="Grouping for function contribution"/>
- </appInfo>
- <documentation>
- A functionGroup provides a grouping of related function that can be contributed to the tools. For example, a third party component may want to contribute actions, editor pages, edit model resources, and many other functions specific to a given product. By associating all these functions with a group id, a mechanism is exposed for users to selectively enable and disable baskets of function. Extension points that allow for a "groupID" attribute generally will hide those functions when the group id is disabled.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <choice>
- <element ref="functionGroup" minOccurs="1" maxOccurs="unbounded"/>
- <element ref="functionGroupPatternBinding" minOccurs="1" maxOccurs="unbounded"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="functionGroup">
- <annotation>
- <documentation>
- Extension point definition for a group.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="functionGroupID" type="string" use="required">
- <annotation>
- <documentation>
- A unique id for the group.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A human readable name.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
- A short description of the group.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="url" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="priority" type="string" use="required">
- <annotation>
- <documentation>
- Ordering magnitude of plugins
- </documentation>
- </annotation>
- </attribute>
- <attribute name="initializerClassName" type="string" use="required">
- <annotation>
- <documentation>
- Class used to determine plugin enablement
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="functionGroupPatternBinding">
- <annotation>
- <documentation>
- This element allows one to bind function groups to patterns.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="functionGroupID" type="string" use="required">
- <annotation>
- <documentation>
- The unique identifier of the function group to bind.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pattern" type="string" use="required">
- <annotation>
- <documentation>
- The pattern to be bound. Patterns are regular expressions which match unique identifiers.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 6.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- <code>
-&nbsp;&nbsp;&nbsp;<br>
-&nbsp;&nbsp;&nbsp;&lt;extension<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point="com.ibm.wtp.common.functionGroup"&gt;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;functionGroup<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name="Acme&nbsp;Co.&nbsp;Function&nbsp;Extension"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;functionGroupID="com.acme.acmepro"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description="The&nbsp;AcmePro&nbsp;Extensions&nbsp;add&nbsp;integration&nbsp;to&nbsp;the&nbsp;Acme&nbsp;Web&nbsp;Server."<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabledByDefault="true"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;icon="..."<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url="http://www.acme.com/"<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;<br>
-&nbsp;&nbsp;&nbsp;&lt;/extension&gt;<br>
-</code>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- WTP Function Groups can be referenced through com.ibm.wtp.common.group.WTPFunctionGroupRegistry.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks/schema/validationSelectionHandler.exsd b/plugins/org.eclipse.wst.common.frameworks/schema/validationSelectionHandler.exsd
deleted file mode 100644
index 283f7b9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/schema/validationSelectionHandler.exsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.common.frameworks">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.frameworks" id="validationSelectionHandler" name="validationSelectionHandler"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="validationSelectionHandler" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="validationSelectionHandler">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="handlerClass" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="selectionType" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/IWFTWrappedException.java b/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/IWFTWrappedException.java
deleted file mode 100644
index d92bafd..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/IWFTWrappedException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.enablement.nonui;
-
-/**
- * Common interface for ArchiveRuntime and ArchiveWrapped exceptions, which can contain nested
- * exceptions
- */
-public interface IWFTWrappedException {
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to innermost
- */
- public String[] getAllMessages();
-
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to
- * innermost, concatenated as one
- */
- public String getConcatenatedMessages();
-
- public Exception getInnerMostNestedException();
-
- public String getMessage();
-
- public java.lang.Exception getNestedException();
-
- public void printStackTrace();
-
- public void printStackTrace(java.io.PrintStream s);
-
- public void printStackTrace(java.io.PrintWriter s);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WFTWrappedException.java b/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WFTWrappedException.java
deleted file mode 100644
index 9a59c94..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WFTWrappedException.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.enablement.nonui;
-
-//import com.ibm.etools.wft.nls.WFTUtilsResourceHandler;
-
-
-
-/**
- * Insert the type's description here. Creation date: (04/03/01 11:12:51 AM)
- *
- * @author: Administrator
- */
-public class WFTWrappedException extends java.lang.reflect.InvocationTargetException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = -6885044277377784429L;
-
- /**
- * WFTWrappedException constructor comment.
- */
- protected WFTWrappedException() {
- super();
- }
-
- /**
- * WFTWrappedException constructor comment.
- *
- * @param target
- * java.lang.Throwable
- */
- public WFTWrappedException(Throwable target) {
- super(target);
- }
-
- /**
- * WFTWrappedException constructor comment.
- *
- * @param target
- * java.lang.Throwable
- * @param s
- * java.lang.String
- */
- public WFTWrappedException(Throwable target, String s) {
- super(target, s);
- }
-
- /**
- * Print out a stack trace to the system err.
- */
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintStream s) {
- if (getTargetException() != null) {
- s.println(this);
- //TODO add this back in
- // s.println(WFTUtilsResourceHandler.getString("Stack_trace_of_nested_exce_ERROR_"));
- // //$NON-NLS-1$ = "Stack trace of nested exception:"
- getTargetException().printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintWriter s) {
- if (getTargetException() != null) {
- s.println(this);
- //TODO add this back in
- // s.println(WFTUtilsResourceHandler.getString("Stack_trace_of_nested_exce_ERROR_"));
- // //$NON-NLS-1$ = "Stack trace of nested exception:"
- getTargetException().printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WorkbenchUtil.java b/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WorkbenchUtil.java
deleted file mode 100644
index 67cac79..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src-non_workbench/org/eclipse/wst/common/frameworks/internal/enablement/nonui/WorkbenchUtil.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.enablement.nonui;
-
-public class WorkbenchUtil {
-
- protected static boolean WorkbenchRunning = false;
-
- private WorkbenchUtil() {
- super();
- }
-
- /**
- * workbenchIsRunning() - test whether or not we are running in the workbench environment.
- *
- * @see JavaPlugin.startup()
- */
- public static boolean workbenchIsRunning() {
- return WorkbenchRunning;
- }
-
- /**
- * Set to true if you are running in a Workbench environment.
- *
- * @see JavaPlugin.startup()
- */
- public static void setWorkbenchIsRunning(boolean aBoolean) {
- WorkbenchRunning = aBoolean;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AbstractRegistryDescriptor.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AbstractRegistryDescriptor.java
deleted file mode 100644
index 07b44b3..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AbstractRegistryDescriptor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 12, 2004
- *
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclispe.wst.common.frameworks.internal.enablement.FunctionGroupRegistry;
-import org.eclispe.wst.common.frameworks.internal.enablement.IEnablementIdentifier;
-import org.eclispe.wst.common.frameworks.internal.enablement.IEnablementManager;
-import org.eclispe.wst.common.frameworks.internal.enablement.Identifiable;
-
-
-/**
- * @author schacher
- *
- * Common superclass for enablement-aware (e.g., using function groups or activiities) extension
- * points.
- */
-public abstract class AbstractRegistryDescriptor extends ConfigurationElementWrapper implements Identifiable {
-
- protected Integer priority;
-
- public AbstractRegistryDescriptor(IConfigurationElement anElement) {
- super(anElement);
- }
-
- public IEnablementIdentifier getEnablementIdentifier(IProject project) {
- return IEnablementManager.INSTANCE.getIdentifier(getID(), project);
- }
-
- public abstract String getID();
-
- public int getPriority() {
- if (priority == null)
- priority = new Integer(FunctionGroupRegistry.getInstance().getFunctionPriority(getID()));
- return priority.intValue();
- }
-
- public boolean isEnabled(IProject p) {
- IEnablementIdentifier id = getEnablementIdentifier(p);
- return id.isEnabled();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AdaptabilityUtility.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AdaptabilityUtility.java
deleted file mode 100644
index 9e8a19d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/AdaptabilityUtility.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @author mdelder
- *
- */
-public class AdaptabilityUtility {
-
-
- public static Object getAdapter(Object element, Class adapter) {
- if (element == null)
- return null;
- else if (element instanceof IAdaptable)
- return ((IAdaptable) element).getAdapter(adapter);
- else
- return Platform.getAdapterManager().getAdapter(element, adapter);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ConfigurationElementWrapper.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ConfigurationElementWrapper.java
deleted file mode 100644
index 1f3572a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ConfigurationElementWrapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 20, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class ConfigurationElementWrapper {
-
- protected IConfigurationElement element;
-
- /**
- *
- */
- public ConfigurationElementWrapper(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
-
-
- /**
- * @return Returns the element.
- */
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- * Return the plugin id of the configuration element
- *
- * @return
- */
- public String getPluginId() {
- String pluginId = null;
-
- if (element != null) {
- IExtension extension = element.getDeclaringExtension();
-
- if (extension != null) {
- pluginId = extension.getNamespace();
- // TODO jsholl is this correct???
- }
- }
-
- return pluginId;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ExceptionHelper.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ExceptionHelper.java
deleted file mode 100644
index 56e276c..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ExceptionHelper.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Utility class to factor common code for implementers of IArchiveWrappedException
- */
-public class ExceptionHelper {
- /**
- * Utility class; cannot be instantiated
- */
- private ExceptionHelper() {
- super();
- }
-
- /**
- * Return the messages from
- *
- * @exception and
- * all nested exceptions, in order from outermost to innermost
- */
- public static java.lang.String[] getAllMessages(IWrappedException exception) {
- List messages = new ArrayList(4);
- messages.add(exception.getMessage());
- Exception nested = exception.getNestedException();
- while (nested != null) {
- messages.add(nested.getMessage());
- if (nested instanceof IWrappedException)
- nested = ((IWrappedException) nested).getNestedException();
- else
- nested = null;
- }
- return (String[]) messages.toArray(new String[messages.size()]);
- }
-
- /**
- * Return the messages from
- *
- * @exception and
- * all nested exceptions, in order from outermost to innermost, concatenated as
- * one
- */
- public static String getConcatenatedMessages(IWrappedException exception) {
- String[] messages = getAllMessages(exception);
- StringBuffer sb = new StringBuffer(256);
- for (int i = 0; i < messages.length; i++) {
- sb.append(messages[i]);
- if (i < messages.length - 1)
- sb.append('\n');
- }
- return sb.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ISaveHandler.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ISaveHandler.java
deleted file mode 100644
index 743f026..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ISaveHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * Defines the API for coping with attempts to overwrite read-only files or save failures
- */
-public interface ISaveHandler {
- public void access();
-
- public void handleSaveFailed(SaveFailedException ex, IProgressMonitor monitor);
-
- public void release();
-
- public boolean shouldContinueAndMakeFileEditable(IFile aFile);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IValidationSelectionHandler.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IValidationSelectionHandler.java
deleted file mode 100644
index f5601f9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IValidationSelectionHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created on Nov 23, 2004
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * This is used by extensions to add valid validation types to the validate
- * menu action.
- */
-public interface IValidationSelectionHandler {
-
- /**
- * Return a valid IResource type for the extensible object selection,
- * should be instance of IFolder, IFile, or IProject if this extension knows
- * how to handle the selection, otherwise it should return null
- */
- public IResource getBaseValidationType(Object selection);
-
- /**
- * @return the classname of the validation type to register for validation
- */
- public String getValidationTypeString();
-
- public void setValidationTypeString(String validationType);
-
-}
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IWrappedException.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IWrappedException.java
deleted file mode 100644
index 8fb86d7..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/IWrappedException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-/**
- * Common interface for ArchiveRuntime and ArchiveWrapped exceptions, which can contain nested
- * exceptions
- */
-public interface IWrappedException {
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to innermost
- */
- public String[] getAllMessages();
-
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to
- * innermost, concatenated as one
- */
- public String getConcatenatedMessages();
-
- public Exception getInnerMostNestedException();
-
- public String getMessage();
-
- public java.lang.Exception getNestedException();
-
- public void printStackTrace();
-
- public void printStackTrace(java.io.PrintStream s);
-
- public void printStackTrace(java.io.PrintWriter s);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/Messages.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/Messages.java
deleted file mode 100644
index d8756a9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/Messages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 21, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author DABERG
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public abstract class Messages {
- //Resource bundle.
- protected ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public Messages() {
- initializeBundle();
- }
-
- protected abstract void initializeBundle();
-
- /**
- * Returns the string from the resource bundle, or 'key' if not found.
- */
- protected String doGetResourceString(String key) {
- try {
- return (resourceBundle != null ? resourceBundle.getString(key) : key);
- } catch (MissingResourceException e) {
- return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- protected String doGetResourceString(String key, Object[] args) {
- String pattern = doGetResourceString(key);
- if (pattern != null)
- return MessageFormat.format(pattern, args);
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveFailedException.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveFailedException.java
deleted file mode 100644
index d6d0f48..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveFailedException.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-/**
- * Runtime exception that could get thrown during save of an edit model; clients should use
- * {@link #getConcatenatedMessages}to get all the messages of this and all nested exceptions to
- * report the failure.
- */
-public class SaveFailedException extends WrappedRuntimeException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = -4640018901910731240L;
-
- /**
- * SaveFailedException constructor comment.
- */
- public SaveFailedException() {
- super();
- }
-
- /**
- * SaveFailedException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public SaveFailedException(Exception e) {
- super(e);
- }
-
- /**
- * SaveFailedException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public SaveFailedException(String s) {
- super(s);
- }
-
- /**
- * SaveFailedException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public SaveFailedException(String s, Exception e) {
- super(s, e);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerHeadless.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerHeadless.java
deleted file mode 100644
index b9efa82..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerHeadless.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.frameworks.internal.enablement.nonui.IWFTWrappedException;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * Insert the type's description here. Creation date: (10/19/2001 11:40:59 AM)
- *
- * @author: Administrator
- */
-public class SaveHandlerHeadless implements ISaveHandler {
- /**
- * HeadlessSaveHandler constructor comment.
- */
- public SaveHandlerHeadless() {
- super();
- }
-
- /**
- * access method comment.
- */
- public void access() {
- }
-
- /**
- * handleSaveFailed method comment.
- */
- public void handleSaveFailed(SaveFailedException ex, org.eclipse.core.runtime.IProgressMonitor monitor) {
- throw ex;
- }
-
- public static boolean isFailedWriteFileFailure(IWFTWrappedException ex) {
- Exception nested = ex.getInnerMostNestedException();
- if (nested == null)
- return false;
-
- return isFailedWriteFileFailure(nested);
- }
-
- public static boolean isFailedWriteFileFailure(Exception ex) {
- if (ex instanceof IWFTWrappedException)
- return isFailedWriteFileFailure((IWFTWrappedException) ex);
- else if (ex instanceof CoreException)
- return isFailedWriteFileFailure((CoreException) ex);
- return false;
- }
-
- public static boolean isFailedWriteFileFailure(CoreException ex) {
- org.eclipse.core.runtime.IStatus status = ex.getStatus();
- if (status == null)
- return false;
- Throwable nested = status.getException();
- if (nested instanceof CoreException)
- return isFailedWriteFileFailure((CoreException) nested);
- return status.getCode() == org.eclipse.core.resources.IResourceStatus.FAILED_WRITE_LOCAL;
- }
-
- /**
- * release method comment.
- */
- public void release() {
- }
-
- /**
- * shouldContinueAndMakeFileEditable method comment.
- */
- public boolean shouldContinueAndMakeFileEditable(org.eclipse.core.resources.IFile aFile) {
- if (aFile == null)
- return false;
- String error = WTPResourceHandler.getString("Unable_to_save_read-only_f_ERROR_", new Object[]{aFile.getFullPath()}); //$NON-NLS-1$ = "Unable to save read-only file: "
- Logger.getLogger().logError(error);
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerRegister.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerRegister.java
deleted file mode 100644
index 537f79e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/SaveHandlerRegister.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-import com.ibm.wtp.common.UIContextDetermination;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * A registry for the default ISaveHandler to use when saving edit models
- */
-public class SaveHandlerRegister {
- private static ISaveHandler saveHandler;
-
- /**
- * This is a utility class and should not be instantiated
- */
- protected SaveHandlerRegister() {
- super();
- }
-
- public static ISaveHandler getSaveHandler() {
- if (saveHandler == null)
- saveHandler = (ISaveHandler) UIContextDetermination.createInstance("saveHandler"); //$NON-NLS-1$
- return saveHandler;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ValidationSelectionHandlerRegistryReader.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ValidationSelectionHandlerRegistryReader.java
deleted file mode 100644
index ece8af9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/ValidationSelectionHandlerRegistryReader.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Created on Nov 23, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-
-/**
- * @author jlanuti
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class ValidationSelectionHandlerRegistryReader extends RegistryReader {
-
- public static final String VALIDATION_SELECTION_HANDLER = "validationSelectionHandler"; //$NON-NLS-1$
- static final String ATT_ID = "id"; //$NON-NLS-1$
- static final String ATT_HANDLER_CLASS = "handlerClass"; //$NON-NLS-1$
- static final String ATT_SELECTION_TYPE = "selectionType"; //$NON-NLS-1$
- private static ValidationSelectionHandlerRegistryReader INSTANCE = null;
- private List validationSelectionHandlers = null;
-
- /**
- * Default constructor
- */
- public ValidationSelectionHandlerRegistryReader() {
- super(WTPCommonPlugin.PLUGIN_ID, VALIDATION_SELECTION_HANDLER);
- }
-
- public static ValidationSelectionHandlerRegistryReader getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new ValidationSelectionHandlerRegistryReader();
- INSTANCE.readRegistry();
- }
- return INSTANCE;
- }
-
-
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.common.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- if (!element.getName().equals(VALIDATION_SELECTION_HANDLER))
- return false;
-
- String handlerClass = element.getAttribute(ATT_HANDLER_CLASS);
- String selectionType = element.getAttribute(ATT_SELECTION_TYPE);
-
- IValidationSelectionHandler handler = null;
- try {
- handler = (IValidationSelectionHandler) element.createExecutableExtension(ATT_HANDLER_CLASS);
- handler.setValidationTypeString(selectionType);
- getValidationSelectionHandlers().add(handler);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return false;
- }
-
- private List getValidationSelectionHandlers() {
- if (validationSelectionHandlers == null)
- validationSelectionHandlers = new ArrayList();
- return validationSelectionHandlers;
- }
-
- public Object getExtendedType(Object selection) {
- Object result = null;
- for (int i=0; i<getValidationSelectionHandlers().size(); i++ ) {
- IValidationSelectionHandler handler = (IValidationSelectionHandler) getValidationSelectionHandlers().get(i);
- result = handler.getBaseValidationType(selection);
- if (result != null)
- break;
- }
- return result;
- }
-}
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPPlugin.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPPlugin.java
deleted file mode 100644
index efb11bb..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPPlugin.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Dec 10, 2003
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WorkbenchUtil;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-import com.ibm.wtp.logger.proxyrender.DefaultPluginTraceRenderer;
-import com.ibm.wtp.logger.proxyrender.IMsgLogger;
-
-public abstract class WTPPlugin extends Plugin implements IMsgLogger {
- protected static Logger logger = null;
-
- /**
- * @param descriptor
- */
- public WTPPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- }
-
- public Logger getMsgLogger() {
- if (logger == null) {
- logger = Logger.getLogger(getPluginID());
- setRenderer(logger);
- }
- return logger;
- }
-
- /**
- * @param aLogger
- */
- protected void setRenderer(Logger aLogger) {
- new DefaultPluginTraceRenderer(aLogger);
- }
-
- public Logger getLogger() {
- return getMsgLogger();
- }
-
- public abstract String getPluginID();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#startup()
- */
- public void startup() throws CoreException {
- super.startup();
- WorkbenchUtil.setWorkbenchIsRunning(true);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPProjectUtilities.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPProjectUtilities.java
deleted file mode 100644
index 1e7d519..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPProjectUtilities.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 4, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class WTPProjectUtilities {
-
- /**
- * Adds a old nauture to a project, FIRST, this is used to make project backward compatible
- */
- public static void addOldNatureToProject(IProject proj, String natureId) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
-
- //check if the old nature does not exist
- boolean addNature = true;
- for (int i = 0; i < prevNatures.length; i++) {
- String nature = prevNatures[i];
- if (nature.equals(natureId)) {
- addNature = false;
- break;
- }
- }
- if (addNature) {
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 1, prevNatures.length);
- newNatures[0] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, IResource.AVOID_NATURE_CONFIG, null);
- }
- }
-
- /**
- * Adds a nature in the project in the index specified
- */
- public static void addOldNatureToProject(IProject proj, String natureId, int index) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
-
- //check if the old nature does not exist
- boolean addNature = true;
- for (int i = 0; i < prevNatures.length; i++) {
- String nature = prevNatures[i];
- if (nature.equals(natureId)) {
- addNature = false;
- break;
- }
- }
- if (addNature) {
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, index);
-
- newNatures[index] = natureId;
- System.arraycopy(prevNatures, index, newNatures, index + 1, prevNatures.length - index);
- description.setNatureIds(newNatures);
- proj.setDescription(description, IResource.AVOID_NATURE_CONFIG, null);
- }
- }
-
- /**
- * Adds a nauture to a project, FIRST
- */
- public static void addNatureToProject(IProject proj, String natureId) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 1, prevNatures.length);
- newNatures[0] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, null);
- }
-
- /**
- * Adds a nature to a project, LAST
- */
- public static void addNatureToProjectLast(IProject proj, String natureId) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, null);
- }
-
- /**
- * remove a nature from the project
- */
- public static void removeNatureFromProject(IProject project, String natureId) throws CoreException {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- int size = prevNatures.length;
- int newsize = 0;
- String[] newNatures = new String[size];
- boolean matchfound = false;
- for (int i = 0; i < size; i++) {
- if (prevNatures[i].equals(natureId)) {
- matchfound = true;
- continue;
- }
- newNatures[newsize++] = prevNatures[i];
- }
- if (!matchfound)
- throw new CoreException(new Status(IStatus.ERROR, WTPCommonPlugin.PLUGIN_ID, 0, "The nature id " + natureId + " does not exist on the project " + project.getName(), null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String[] temp = newNatures;
- newNatures = new String[newsize];
- System.arraycopy(temp, 0, newNatures, 0, newsize);
- description.setNatureIds(newNatures);
- project.setDescription(description, null);
- }
-
- public static IProject getProject(Object object) {
- IProject result = null;
-
- if (object instanceof IProject)
- result = (IProject) object;
- else if (object instanceof IResource)
- result = ((IResource) object).getProject();
- else if (object instanceof IAdaptable)
- result = (IProject) ((IAdaptable) object).getAdapter(IProject.class);
-
- return result;
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPResourceHandler.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPResourceHandler.java
deleted file mode 100644
index a2363d2..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WTPResourceHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * @author Administrator
- *
- *
- */
-public class WTPResourceHandler {
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("wtp_common"); //$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!"; //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- return "!" + key + "!"; //$NON-NLS-2$//$NON-NLS-1$
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-
- public static String getString(String key, Object[] args, int x) {
-
- return getString(key);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedException.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedException.java
deleted file mode 100644
index e53c51c..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-
-public class WrappedException extends java.lang.reflect.InvocationTargetException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = -9221925581603648538L;
-
- /**
- * WFTWrappedException constructor comment.
- */
- protected WrappedException() {
- super();
- }
-
- /**
- * WFTWrappedException constructor comment.
- *
- * @param target
- * java.lang.Throwable
- */
- public WrappedException(Throwable target) {
- super(target);
- }
-
- /**
- * WFTWrappedException constructor comment.
- *
- * @param target
- * java.lang.Throwable
- * @param s
- * java.lang.String
- */
- public WrappedException(Throwable target, String s) {
- super(target, s);
- }
-
- /**
- * Print out a stack trace to the system err.
- */
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintStream s) {
- if (getTargetException() != null) {
- s.println(this);
- s.println("Stack trace of nested exception:"); //$NON-NLS-1$
- getTargetException().printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintWriter s) {
- if (getTargetException() != null) {
- s.println(this);
- s.println("Stack trace of nested exception:"); //$NON-NLS-1$
- getTargetException().printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedRuntimeException.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedRuntimeException.java
deleted file mode 100644
index e1f769e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/WrappedRuntimeException.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal;
-
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. US
- * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
- * Schedule Contract with IBM Corp.
- */
-
-
-public class WrappedRuntimeException extends RuntimeException implements IWrappedException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 2684637746275620101L;
- /** The exception which necessitated this runtime exception, if one exists */
- protected Exception nestedException;
-
- public WrappedRuntimeException() {
- super();
- }
-
- public WrappedRuntimeException(Exception e) {
- super();
- setNestedException(e);
- }
-
- public WrappedRuntimeException(String s) {
- super(s);
- }
-
- public WrappedRuntimeException(String s, Exception e) {
- super(s);
- setNestedException(e);
- }
-
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to innermost
- */
- public java.lang.String[] getAllMessages() {
- return ExceptionHelper.getAllMessages(this);
- }
-
- /**
- * Return the messages from this and all nested exceptions, in order from outermost to
- * innermost, concatenated as one
- */
- public java.lang.String getConcatenatedMessages() {
- return ExceptionHelper.getConcatenatedMessages(this);
- }
-
- /**
- * getInnerMostNestedException method comment.
- */
- public java.lang.Exception getInnerMostNestedException() {
- Exception n = getNestedException();
- if (n == null)
- return this;
- else if (n instanceof IWrappedException)
- return ((IWrappedException) n).getInnerMostNestedException();
- else
- return n;
- }
-
- /**
- * @return java.lang.Exception
- */
- public java.lang.Exception getNestedException() {
- return nestedException;
- }
-
- /**
- * Print out a stack trace to the system err.
- */
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintStream s) {
- if (nestedException != null) {
- s.println(this);
- s.println("Stack trace of nested exception:"); //$NON-NLS-1$
- nestedException.printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-
- /**
- * Prints the exception to System.err. If we have a nested exception, print its stack.
- */
- public void printStackTrace(java.io.PrintWriter s) {
- if (nestedException != null) {
- s.println(this);
- s.println("Stack trace of nested exception:"); //$NON-NLS-1$
- nestedException.printStackTrace(s);
- } else {
- super.printStackTrace(s);
- }
- }
-
- /**
- * @param newNestedException
- * java.lang.Exception
- */
- public void setNestedException(java.lang.Exception newNestedException) {
- nestedException = newNestedException;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridge.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridge.java
deleted file mode 100644
index 29484f0..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridge.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.activities;
-
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class WTPActivityBridge {
- private static final String PLUGIN_ID = "org.eclipse.wst.common.frameworks"; //$NON-NLS-1$
- private static final String EXTENSION_POINT = "WTPActivityBridgeHelper"; //$NON-NLS-1$
- private static final String LISTENER_CLASS = "class"; //$NON-NLS-1$
-
- private static WTPActivityBridge INSTANCE = null;
- private WTPActivityBridgeHelper[] listeners;
-
- public static WTPActivityBridge getInstance() {
- if (null == INSTANCE) {
- INSTANCE = new WTPActivityBridge();
- }
- return INSTANCE;
- }
-
- private WTPActivityBridge() {
- loadExtensionPoints();
- }
-
- public void enableActivity(String activityID, boolean enabled) {
- for (int i = 0; i < listeners.length; i++) {
- listeners[i].enableActivity(activityID, enabled);
- }
- }
-
- public Set getEnabledActivityIds() {
- for (int i = 0; i < listeners.length; i++) {
- return listeners[i].getEnabledActivityIds();
- }
- return Collections.EMPTY_SET;
- }
-
- public void setEnabledActivityIds(Set activityIDs) {
- for (int i = 0; i < listeners.length; i++) {
- listeners[i].setEnabledActivityIds(activityIDs);
- }
- }
-
- public Set getActivityIDsFromContribution(String localID, String pluginID) {
- for (int i = 0; i < listeners.length; i++) {
- return listeners[i].getActivityIDsFromContribution(localID, pluginID);
- }
- return Collections.EMPTY_SET;
- }
-
- private void loadExtensionPoints() {
- IExtensionPoint point = Platform.getPluginRegistry().getExtensionPoint(PLUGIN_ID, EXTENSION_POINT);
- if (point == null)
- return;
- IConfigurationElement[] elements = point.getConfigurationElements();
- listeners = new WTPActivityBridgeHelper[elements.length];
- for (int i = 0; i < elements.length; i++) {
- if (null == elements[i].getAttribute(LISTENER_CLASS)) {
- logError(elements[i], "No " + LISTENER_CLASS + " defined."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- try {
- listeners[i] = (WTPActivityBridgeHelper) elements[i].createExecutableExtension(LISTENER_CLASS);
- } catch (CoreException e) {
- logError(elements[i], "Error loading " + LISTENER_CLASS + ":" + elements[i].getAttribute(LISTENER_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- }
- }
-
- public static void logError(IConfigurationElement element, String text) {
- IExtension extension = element.getDeclaringExtension();
- IPluginDescriptor descriptor = extension.getDeclaringPluginDescriptor();
- StringBuffer buf = new StringBuffer();
- buf.append("Plugin " + descriptor.getUniqueIdentifier() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append("\n" + text); //$NON-NLS-1$
- Logger.getLogger().logError(buf.toString());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridgeHelper.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridgeHelper.java
deleted file mode 100644
index 4378df1..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/activities/WTPActivityBridgeHelper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.activities;
-
-import java.util.Set;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public interface WTPActivityBridgeHelper {
-
- public void enableActivity(String activityID, boolean enabled);
-
- public Set getEnabledActivityIds();
-
- public void setEnabledActivityIds(Set activityIDs);
-
- public Set getActivityIDsFromContribution(String localID, String pluginID);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedExtendedOperationHolder.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedExtendedOperationHolder.java
deleted file mode 100644
index 560d5b2..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedExtendedOperationHolder.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.util.ArrayList;
-
-
-
-
-public class ComposedExtendedOperationHolder {
-
- private ArrayList preOps = null;
- private ArrayList postOps = null;
-
- /**
- *
- */
- protected ComposedExtendedOperationHolder() {
- super();
- }
-
- protected void addPreOperation(WTPOperation preOp) {
- if (preOps == null) {
- preOps = new ArrayList();
- }
- preOps.add(preOp);
- }
-
- protected void addPostOperation(WTPOperation postOp) {
- if (postOps == null) {
- postOps = new ArrayList();
- }
- postOps.add(postOp);
- }
-
- public boolean hasPreOps() {
- return preOps != null;
- }
-
- public boolean hasPostOps() {
- return postOps != null;
- }
-
- public ArrayList getPostOps() {
- return postOps;
- }
-
- public ArrayList getPreOps() {
- return preOps;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedOperation.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedOperation.java
deleted file mode 100644
index 5bb08f4..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ComposedOperation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-public class ComposedOperation extends WTPOperation {
-
- protected List fRunnables;
-
- public ComposedOperation() {
- super();
- }
-
- public ComposedOperation(List nestedRunnablesWithProgress) {
- super();
- fRunnables = nestedRunnablesWithProgress;
- }
-
- public boolean addRunnable(WTPOperation nestedOp) {
- return getRunnables().add(nestedOp);
- }
-
- public WTPOperation append(WTPOperation op) {
- this.addRunnable(op);
- return this;
- }
-
- // TODO MDE Make protected
- public List getRunnables() {
- if (fRunnables == null)
- fRunnables = new ArrayList(3);
- return fRunnables;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.j2ee.operations.IHeadlessRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (fRunnables == null || fRunnables.isEmpty())
- return;
- int size = fRunnables.size();
- monitor.beginTask("", size);//$NON-NLS-1$
-
- OperationStatus composedStatus = null;
- try {
- for (int i = 0; i < fRunnables.size(); i++) {
- WTPOperation op = (WTPOperation) fRunnables.get(i);
- op.run(new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- if (composedStatus == null)
- composedStatus = new OperationStatus(new IStatus[]{op.getStatus()});
- else
- composedStatus.add(op.getStatus());
- }
- } finally {
- if (composedStatus != null)
- addStatus(composedStatus);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/FailSafeComposedOperation.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/FailSafeComposedOperation.java
deleted file mode 100644
index 5dabd92..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/FailSafeComposedOperation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 21, 2004
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code Generation - Code and
- * Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author jsholl
- *
- * Same as ComposedOperation except the first Operation must run; all others can fail without
- * effecting the ComposedOperation or any other operation following them in the Composed Operation's
- * list.
- */
-public class FailSafeComposedOperation extends ComposedOperation {
-
- public FailSafeComposedOperation() {
- super();
- }
-
- public FailSafeComposedOperation(List nestedRunnablesWithProgress) {
- super(nestedRunnablesWithProgress);
- }
-
- public void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- int size = fRunnables.size();
- monitor.beginTask("", size); //$NON-NLS-1$
- for (int i = 0; i < fRunnables.size(); i++) {
- WTPOperation op = (WTPOperation) fRunnables.get(i);
- if (i == 0) { //The first one must pass; all others can fail
- op.run(new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- } else {
- try {
- op.run(new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- } catch (InterruptedException e) {
- throw e;
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- }
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IHeadlessRunnableWithProgress.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IHeadlessRunnableWithProgress.java
deleted file mode 100644
index 74c9b92..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IHeadlessRunnableWithProgress.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * Insert the type's description here. Creation date: (5/8/2001 1:14:41 PM)
- *
- * @author: Administrator
- */
-public interface IHeadlessRunnableWithProgress {
- /**
- * Runs this operation without forcing a UI dependency.
- *
- * @param monitor
- * the progress monitor to use to display progress and receive requests for
- * cancelation
- * @exception InvocationTargetException
- * if the run method must propagate a checked exception, it should wrap it inside
- * an <code>InvocationTargetException</code>; runtime exceptions are
- * automatically wrapped in an <code>InvocationTargetException</code> by the
- * calling context
- * @exception InterruptedException
- * if the operation detects a request to cancel, using
- * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing
- * <code>InterruptedException</code>
- *
- * @see IRunnableWithProgress
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IOperationHandler.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IOperationHandler.java
deleted file mode 100644
index 3399b62..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/IOperationHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * Passed to complex methods that may require reporting of messages, or interactions from the user;
- * Defined as an interface because the actions may run in headless environments
- */
-public interface IOperationHandler {
- int YES = 0;
- int YES_TO_ALL = 1;
- int NO = 2;
- int CANCEL = 3;
-
- /**
- * A decision needs to made as to whether an action/operation can continue
- */
- public boolean canContinue(String message);
-
- /**
- * A decision needs to made as to whether an action/operation can continue. <code>items</code>
- * is an array of details that accompany the <code>message</code>.
- */
- public boolean canContinue(String message, String[] items);
-
- /**
- * A decision needs to made as to whether an action/operation can continue. The boolean array
- * will return two booleans. The first indicates their response to the original question and the
- * second indicates if they selected the apply to all check box.
- *
- * Return the return code for the dialog. 0 = Yes, 1 = Yes to all, 2 = No
- */
- int canContinueWithAllCheck(String message);
-
- int canContinueWithAllCheckAllowCancel(String message);
-
- /**
- * An error has occurred
- */
- public void error(String message);
-
- /**
- * An informational message needs to be presented
- */
- public void inform(String message);
-
- public Object getContext();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NonConflictingRule.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NonConflictingRule.java
deleted file mode 100644
index a715b4a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NonConflictingRule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 29, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class NonConflictingRule implements ISchedulingRule {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean contains(ISchedulingRule rule) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean isConflicting(ISchedulingRule rule) {
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NullOperationHandler.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NullOperationHandler.java
deleted file mode 100644
index a068da5..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/NullOperationHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * Simple implementer that ignores messages and always allows actions to continue
- */
-public class NullOperationHandler implements IOperationHandler {
- /**
- * NullOperationHandler constructor comment.
- */
- public NullOperationHandler() {
- super();
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue
- */
- public boolean canContinue(String message) {
- return true;
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue
- */
- public boolean canContinue(String message, String[] items) {
- return true;
- }
-
- /**
- * A decision needs to made as to whether an action/operation can continue. The boolean array
- * will return two booleans. The first indicates their response to the original question and the
- * second indicates if they selected the apply to all check box.
- *
- * Return the return code for the dialog. 0 = Yes, 1 = Yes to all, 2 = No
- */
- public int canContinueWithAllCheck(java.lang.String message) {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.j2ee.operations.IOperationHandler#canContinueWithAllCheckAllowCancel(java.lang.String)
- */
- public int canContinueWithAllCheckAllowCancel(String message) {
- return 0;
- }
-
- /**
- * An error has occurred
- */
- public void error(String message) {
- System.err.println(message);
- }
-
- /**
- * An informational message needs to be presented
- */
- public void inform(String message) {
- }
-
- /**
- * @see com.ibm.etools.j2ee.operations.IOperationHandler#getContext()
- */
- public Object getContext() {
- return null;
- }
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensibilityReader.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensibilityReader.java
deleted file mode 100644
index 1a2b6c1..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensibilityReader.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Nov 3, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-
-
-public class OperationExtensibilityReader extends RegistryReader {
- static final String ELEMENT_J2EEOPEXT = "extendableOperation"; //$NON-NLS-1$
- static final String OPERATION_ATTRIBUTE = "class"; //$NON-NLS-1$
- static final String OPERATION_ID = "id"; //$NON-NLS-1$
- protected static HashMap extensibleOperations = null;
-
- public OperationExtensibilityReader() {
- super(WTPCommonPlugin.PLUGIN_ID, "ExtendableOperation"); //$NON-NLS-1$
- }
-
- /**
- * readElement() - parse and deal with an extension like: <extendableOperation class =
- * "com.ibm.etools.foo.Operation" id ' "" />
- */
- public boolean readElement(IConfigurationElement element) {
- if (!element.getName().equals(ELEMENT_J2EEOPEXT))
- return false;
- String op = element.getAttribute(OPERATION_ATTRIBUTE);
- String id = element.getAttribute(OPERATION_ID);
- addExtendableOperation(op, id);
- return true;
- }
-
- /**
- * Sets the Extendable Operation
- *
- * @param op
- * @param id
- */
- private static void addExtendableOperation(String op, String id) {
- if (extensibleOperations == null)
- extensibleOperations = new HashMap();
- extensibleOperations.put(op, id);
- }
-
- protected static HashMap getExtendableOperations() {
- return extensibleOperations;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtension.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtension.java
deleted file mode 100644
index 3bdf85d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtension.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-public class OperationExtension {
-
- String opID = null;
-
- IConfigurationElement baseElement = null;
-
- String preOperationClass = null;
-
- WTPOperation preOperation = null;
-
- String postOperationClass = null;
-
- WTPOperation postOperation = null;
-
- private String extensionId;
-
- public OperationExtension(IConfigurationElement element, String id, String preOp, String postOp) {
- super();
- baseElement = element;
- setUpExtension(id, preOp, postOp);
- }
-
- private void setUpExtension(String id, String preOp, String postOp) {
- opID = id;
- preOperationClass = preOp;
- postOperationClass = postOp;
- this.extensionId = baseElement.getDeclaringExtension().getUniqueIdentifier();
- if (this.extensionId == null)
- this.extensionId = baseElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier();
- }
-
- public String getOpID() {
- return opID;
- }
-
- public String getPostOperationClass() {
- return postOperationClass;
- }
-
- public String getPreOperationClass() {
- return preOperationClass;
- }
-
- public WTPOperation getPostOperation() throws CoreException {
- if (postOperationClass == null)
- return null;
- WTPOperation op = (WTPOperation) baseElement.createExecutableExtension(OperationExtensionReader.ATT_POST_OP);
- if (op != null)
- op.setID(getExtensionId());
- return op;
- }
-
- public WTPOperation getPreOperation() throws CoreException {
- if (preOperationClass == null)
- return null;
- WTPOperation op = (WTPOperation) baseElement.createExecutableExtension(OperationExtensionReader.ATT_PRE_OP);
- if (op != null)
- op.setID(getExtensionId());
- return op;
-
- }
-
- /**
- * @return Returns the extensionId.
- */
- public String getExtensionId() {
- return extensionId;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionReader.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionReader.java
deleted file mode 100644
index 535f16b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionReader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Nov 3, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-
-public class OperationExtensionReader extends RegistryReader {
- protected static HashMap opExtensions = null;
-
- static final String ELEMENT_J2EEOPEXT = "operationExtension"; //$NON-NLS-1$
- static final String ATT_ID = "id"; //$NON-NLS-1$
- //static final String ATT_OP_TYPE = "operationType"; //$NON-NLS-1$
- static final String ATT_PRE_OP = "preOperationClass"; //$NON-NLS-1$
- static final String ATT_POST_OP = "postOperationClass"; //$NON-NLS-1$
-
- public OperationExtensionReader() {
- super(WTPCommonPlugin.PLUGIN_ID, "OperationExtension"); //$NON-NLS-1$
- }
-
- /**
- * readElement() - parse and deal with an extension like: <operationExtension
- * preOperationClass="com.ibm.etools....PreDeleteOperation"
- * postOperationClass="com.ibm.etools....PostDeleteOperation"> </operationExtension>
- */
-
- public boolean readElement(IConfigurationElement element) {
- if (!element.getName().equals(ELEMENT_J2EEOPEXT))
- return false;
- String id = element.getAttribute(ATT_ID);
- String preOp = element.getAttribute(ATT_PRE_OP);
- String postOp = element.getAttribute(ATT_POST_OP);
- OperationExtension extension = new OperationExtension(element, id, preOp, postOp);
- addExtensionPoint(extension);
- return true;
-
- }
-
- /**
- * Sets the extension point.
- *
- * @param extensions
- * The extensions to set
- */
- private static void addExtensionPoint(OperationExtension newExtension) {
- if (opExtensions == null)
- opExtensions = new HashMap();
- Collection temp = null;
- Object holder = opExtensions.get(newExtension.getOpID());
- if (holder == null) {
- temp = new ArrayList();
- temp.add(newExtension);
- opExtensions.put(newExtension.getOpID(), temp);
- } else {
- temp = (Collection) holder;
- temp.add(newExtension);
- }
- }
-
- protected static HashMap getExtensionPoints() {
- return opExtensions;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionRegistry.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionRegistry.java
deleted file mode 100644
index a08fab7..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationExtensionRegistry.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Oct 1, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclispe.wst.common.frameworks.internal.enablement.EnablementManager;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-public class OperationExtensionRegistry {
-
- protected static boolean canExtHasRead = false;
-
- protected static boolean extPointHasRead = false;
-
- protected static OperationExtensionRegistry instance = null;
-
- protected static HashMap extensibleOperations = null;
-
- protected static HashMap opExtensions = null;
-
- protected static OperationExtensibilityReader opExtensibilityReader = null;
-
- protected static OperationExtensionReader opExtensionReader = null;
-
- public static String[] getRegisteredOperations(String className) {
- extensibleOperations = getExtensibility();
- if (extensibleOperations != null) {
- String id = (String) extensibleOperations.get(className);
- if (id == null)
- return null;
- if (opExtensions == null)
- opExtensions = getExtensionPoints();
- if (opExtensions != null) {
- Collection ext = (Collection) opExtensions.get(id);
- if (ext != null)
- return getClassNames(ext.toArray());
- }
- }
- return null;
- }
-
- private static String[] getClassNames(Object[] opExt) {
- ArrayList classNames = new ArrayList();
- OperationExtension currentExt = null;
- for (int i = 0; i < opExt.length; i++) {
- currentExt = (OperationExtension) opExt[i];
- /* Only allow extensions which enabled (null project indicates enabled by activity only) */
- if (EnablementManager.INSTANCE.getIdentifier(currentExt.getExtensionId(), null).isEnabled()) {
- String className = currentExt.getPreOperationClass();
- if (null != className) {
- classNames.add(className);
- }
- className = currentExt.getPostOperationClass();
- if (null != className) {
- classNames.add(className);
- }
- }
- }
- String[] array = new String[classNames.size()];
- classNames.toArray(array);
- return array;
- }
-
- public static ComposedExtendedOperationHolder getExtensions(String className) {
- extensibleOperations = getExtensibility();
- if (extensibleOperations != null) {
- String id = (String) extensibleOperations.get(className);
- if (id == null)
- return null;
- if (opExtensions == null)
- opExtensions = getExtensionPoints();
- if (opExtensions != null) {
- Collection ext = (Collection) opExtensions.get(id);
- if (ext != null) {
- try {
- return calculateOperationHolder(ext);
- } catch (CoreException ex) {
- Logger.getLogger().logError(ex);
- }
- }
- }
- }
- return null;
- }
-
- public static ComposedExtendedOperationHolder getExtensions(WTPOperation op) {
- return getExtensions(op.getClass().getName());
- }
-
- protected String getExtendableOperationId(WTPOperation op) {
- return (String) extensibleOperations.get(op.getClass().getName());
- }
-
- private static ComposedExtendedOperationHolder calculateOperationHolder(Collection ext) throws CoreException {
- Object[] opExt = ext.toArray();
- ComposedExtendedOperationHolder extOperationHolder = new ComposedExtendedOperationHolder();
- WTPOperation preOp = null;
- WTPOperation postOp = null;
- OperationExtension currentExt = null;
- for (int i = 0; i < opExt.length; i++) {
- currentExt = (OperationExtension) opExt[i];
- /* Only allow extensions which enabled (null project indicates enabled by activity only) */
- if (EnablementManager.INSTANCE.getIdentifier(currentExt.getExtensionId(), null).isEnabled()) {
- preOp = currentExt.getPreOperation();
- if (preOp != null) {
- extOperationHolder.addPreOperation(preOp);
- }
- postOp = currentExt.getPostOperation();
- if (postOp != null) {
- extOperationHolder.addPostOperation(postOp);
- }
- }
- }
- return extOperationHolder;
- }
-
- private static HashMap getExtensibility() {
- if (!canExtHasRead) {
- opExtensibilityReader = new OperationExtensibilityReader();
- opExtensibilityReader.readRegistry();
- canExtHasRead = true;
- }
- if (opExtensibilityReader == null)
- return null;
- return OperationExtensibilityReader.getExtendableOperations();
- }
-
- private static HashMap getExtensionPoints() {
- if (!extPointHasRead) {
- opExtensionReader = new OperationExtensionReader();
- opExtensionReader.readRegistry();
- extPointHasRead = true;
- }
- if (opExtensionReader == null)
- return null;
- return OperationExtensionReader.getExtensionPoints();
- }
-
- /**
- * Gets the instance.
- *
- * @return Returns a EjbPageExtensionRegistry
- */
- public static OperationExtensionRegistry getInstance() {
- if (instance == null)
- instance = new OperationExtensionRegistry();
- return instance;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationStatus.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationStatus.java
deleted file mode 100644
index 7e0b50b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/OperationStatus.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 29, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class OperationStatus extends MultiStatus {
-
-
- public OperationStatus(String message, Throwable e) {
- super(WTPCommonPlugin.PLUGIN_ID, 0, new IStatus[]{}, message, e);
- }
-
- public OperationStatus(IStatus[] children) {
- this(WTPCommonPlugin.PLUGIN_ID, 0, children, "", null); //$NON-NLS-1$
- }
-
- /**
- * @param pluginId
- * @param code
- * @param children
- * @param message
- * @param exception
- */
- public OperationStatus(String pluginId, int code, IStatus[] children, String message, Throwable exception) {
- super(pluginId, code, children, message, exception);
- }
-
- public void addExtendedStatus(IStatus status) {
- int oldSeverity = getSeverity();
- super.add(status);
- if (oldSeverity != IStatus.ERROR && getSeverity() == IStatus.ERROR) {
- setSeverity(IStatus.WARNING);
- }
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Status#setCode(int)
- */
- public void setCode(int code) {
- super.setCode(code);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Status#setException(java.lang.Throwable)
- */
- public void setException(Throwable exception) {
- super.setException(exception);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Status#setMessage(java.lang.String)
- */
- public void setMessage(String message) {
- super.setMessage(message);
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Status#setSeverity(int)
- */
- public void setSeverity(int severity) {
- super.setSeverity(severity);
- }
-
- public void add(IStatus status) {
- int newSev = status.getSeverity();
- if (newSev > getSeverity()) {
- setMessage(status.getMessage());
- setException(status.getException());
- }
- super.add(status);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationDataModel.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationDataModel.java
deleted file mode 100644
index 324cac0..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationDataModel.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Oct 27, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.io.File;
-
-import org.eclipse.core.internal.localstore.CoreFileSystemLibrary;
-import org.eclipse.core.internal.resources.Project;
-import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonMessages;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-public class ProjectCreationDataModel extends WTPOperationDataModel {
- /**
- * A required dataModel propertyName for a <code>java.lang.String</code> type. This is used to
- * specify the project name.
- */
- public static final String PROJECT_NAME = "ProjectCreationDataModel.PROJECT_NAME"; //$NON-NLS-1$
-
- /**
- * An optonal dataModel propertyName for a <code>java.lang.String</code> type. Sets the local
- * file system location for the described project. The path must be either an absolute file
- * system path, or a relative path whose first segment is the name of a defined workspace path
- * variable. The default value is the workspace's default location.
- */
- public static final String PROJECT_LOCATION = "ProjectCreationDataModel.PROJECT_LOCATION"; //$NON-NLS-1$
-
- /**
- * An optional dataModel propertyName for a <code>java.lang.String[]</code> type. This is a
- * list of all natures to add to the project. There is no default value.
- */
- public static final String PROJECT_NATURES = "ProjectCreationDataModel.PROJECT_NATURES"; //$NON-NLS-1$
-
- public static ProjectCreationDataModel createProjectCreationDataModel(String projectName) {
- ProjectCreationDataModel dataModel = new ProjectCreationDataModel();
- dataModel.setProperty(PROJECT_NAME, projectName);
- return dataModel;
- }
-
- public WTPOperation getDefaultOperation() {
- return new ProjectCreationOperation(this);
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(PROJECT_NAME);
- addValidBaseProperty(PROJECT_LOCATION);
- addValidBaseProperty(PROJECT_NATURES);
- }
-
- protected Object getDefaultProperty(String propertyName) {
- if (PROJECT_LOCATION.equals(propertyName)) {
- return getDefaultLocation();
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected boolean doSetProperty(String propertyName, Object propertyValue) {
- if (propertyValue != null && propertyName.equals(PROJECT_LOCATION)) {
- IPath path = getRootLocation();
- if (path.equals(new Path((String) propertyValue))) {
- setProperty(propertyName, null);
- return false;
- }
- }
- Object oldValue = null;
- if (propertyName.equals(PROJECT_NAME)) {
- oldValue = getProperty(PROJECT_NAME);
- }
- boolean notify = super.doSetProperty(propertyName, propertyValue);
- if (propertyName.equals(PROJECT_NAME) && !isSet(PROJECT_LOCATION)) {
- notifyListeners(PROJECT_NAME, oldValue, propertyValue);
- notifyListeners(PROJECT_LOCATION, null, null);
- return false;
- }
- return notify;
- }
-
- private String getDefaultLocation() {
- IPath path = getRootLocation();
- String projectName = (String) getProperty(PROJECT_NAME);
- if (projectName != null)
- path = path.append(projectName);
- return path.toOSString();
- }
-
- private IPath getRootLocation() {
- return ResourcesPlugin.getWorkspace().getRoot().getLocation();
- }
-
- public IProjectDescription getProjectDescription() {
- String projectName = (String) getProperty(PROJECT_NAME);
- IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
- if (isSet(PROJECT_LOCATION)) {
- String projectLocation = (String) getProperty(ProjectCreationDataModel.PROJECT_LOCATION);
- desc.setLocation(new Path(projectLocation));
- }
- return desc;
- }
-
- public IProject getProject() {
- String projectName = (String) getProperty(PROJECT_NAME);
- return (null != projectName && projectName.length() > 0) ? ResourcesPlugin.getWorkspace().getRoot().getProject(projectName) : null;
- }
-
- protected IStatus doValidateProperty(String propertyName) {
-
- if (propertyName.equals(PROJECT_NAME)) {
- IStatus status = validateName();
- if (!status.isOK())
- return status;
- }
- if (propertyName.equals(PROJECT_LOCATION)) {
- IStatus status = validateLocation();
- if (!status.isOK())
- return status;
- }
- if (propertyName.equals(PROJECT_LOCATION) || propertyName.equals(PROJECT_NAME)) {
- String projectName = getStringProperty(PROJECT_NAME);
- String projectLoc = getStringProperty(PROJECT_LOCATION);
- return validateExisting(projectName, projectLoc);
- }
- return super.doValidateProperty(propertyName);
- }
-
- /**
- * @param projectName
- * @param projectLoc
- * @todo Generated comment
- */
- private IStatus validateExisting(String projectName, String projectLoc) {
- if (projectName != null && !projectName.equals("")) {//$NON-NLS-1$
- File file = new File(projectLoc);
- if (file.exists()) {
- if (file.isDirectory()) {
- File dotProject = new File(file, ".project");//$NON-NLS-1$
- if (dotProject.exists()) {
- return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.PROJECT_EXISTS_AT_LOCATION_ERROR, new Object[]{file.toString()}));
- }
- }
- }
- }
- return OK_STATUS;
- }
-
- private IStatus validateName() {
- String name = getStringProperty(PROJECT_NAME);
- IStatus status = validateProjectName(name);
- if (!status.isOK())
- return status;
- if (getProject().exists())
- return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.PROJECT_EXISTS_ERROR, new Object[]{name}));
-
- if (!CoreFileSystemLibrary.isCaseSensitive()) {
- //now look for a matching case variant in the tree
- IResource variant = ((Project) getProject()).findExistingResourceVariant(getProject().getFullPath());
- if (variant != null)
- return WTPCommonPlugin.createErrorStatus(Policy.bind("resources.existsDifferentCase", variant.getFullPath().toString())); //$NON-NLS-1$
- }
-
- return OK_STATUS;
- }
-
- private IStatus validateLocation() {
- if (isSet(PROJECT_LOCATION)) {
- String loc = (String) getProperty(PROJECT_LOCATION);
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IPath path = new Path(loc);
- return workspace.validateProjectLocation(getProject(), path);
- }
- return OK_STATUS;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationOperation.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationOperation.java
deleted file mode 100644
index 1d43166..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/ProjectCreationOperation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 27, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ProjectCreationOperation extends WTPOperation {
-
- public ProjectCreationOperation(ProjectCreationDataModel dataModel) {
- super(dataModel);
- }
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
- try {
- ProjectCreationDataModel dataModel = (ProjectCreationDataModel) operationDataModel;
-
- IProjectDescription desc = dataModel.getProjectDescription();
- IProject project = dataModel.getProject();
- if (!project.exists()) {
- project.create(desc, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- }
-
- if (monitor.isCanceled())
- throw new OperationCanceledException();
- project.open(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
-
- String[] natureIds = (String[]) dataModel.getProperty(ProjectCreationDataModel.PROJECT_NATURES);
- if (null != natureIds) {
- desc = project.getDescription();
- desc.setNatureIds(natureIds);
- project.setDescription(desc, monitor);
- }
- } finally {
- monitor.done();
- }
- if (monitor.isCanceled())
- throw new OperationCanceledException();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperation.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperation.java
deleted file mode 100644
index 0ac0a18..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperation.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.eclipse.core.internal.runtime.Assert;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException;
-import org.eclispe.wst.common.frameworks.internal.enablement.IEnablementIdentifier;
-import org.eclispe.wst.common.frameworks.internal.enablement.IEnablementManager;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-
-/**
- * An operation which potentially makes changes to the workspace. All resource modification should
- * be performed using this operation. The primary consequence of using this operation is that events
- * which typically occur as a result of workspace changes (such as the firing of resource deltas,
- * performance of autobuilds, etc.) are deferred until the outermost operation has successfully
- * completed.
- * <p>
- * Subclasses must implement <code>execute</code> to do the work of the operation.
- * </p>
- */
-public abstract class WTPOperation implements IHeadlessRunnableWithProgress {
-
- protected WTPOperationDataModel operationDataModel;
-
- private OperationStatus opStatus;
-
- private String id;
-
- public WTPOperation(WTPOperationDataModel operationDataModel) {
- setOperationDataModel(operationDataModel);
- }
-
- public WTPOperation() {
- }
-
- /**
- * If the operationId is already set, setOperationId() will do nothing
- *
- * @param value
- */
- public final void setID(String value) {
- Assert.isTrue(this.id == null, WTPResourceHandler.getString("22")); //$NON-NLS-1$
- Assert.isNotNull(value, WTPResourceHandler.getString("23")); //$NON-NLS-1$
- this.id = value;
- }
-
- public final String getID() {
- return this.id;
- }
-
- public final void setOperationDataModel(WTPOperationDataModel operationDataModel) {
- this.operationDataModel = operationDataModel;
- }
-
- public final WTPOperationDataModel getOperationDataModel() {
- return operationDataModel;
- }
-
- public IStatus getStatus() {
- if (null == opStatus)
- return WTPCommonPlugin.OK_STATUS;
- return opStatus;
- }
-
- /**
- * Performs the steps that are to be treated as a single logical workspace change.
- * <p>
- * Subclasses must implement this method.
- * </p>
- *
- * @param monitor
- * the progress monitor to use to display progress and field user requests to cancel
- * @exception CoreException
- * if the operation fails due to a CoreException
- * @exception InvocationTargetException
- * if the operation fails due to an exception other than CoreException
- * @exception InterruptedException
- * if the operation detects a request to cancel, using
- * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing
- * <code>InterruptedException</code>
- */
- protected abstract void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException;
-
- protected void initilize(IProgressMonitor monitor) {
- //Making sure the status objects are initialized
- // status = null;
- opStatus = null;
- }
-
- private ComposedExtendedOperationHolder initializeExtensionOperations() {
- return OperationExtensionRegistry.getExtensions(this);
- }
-
- protected void dispose(IProgressMonitor pm) {
- }
-
- protected IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public WTPOperation append(WTPOperation op) {
- ComposedOperation composedOp = new ComposedOperation();
- composedOp.addRunnable(this);
- composedOp.addRunnable(op);
- return composedOp;
- }
-
- /**
- * Initiates a batch of changes, by invoking the execute() method as a workspace runnable.
- *
- * @param monitor
- * the progress monitor to use to display progress
- * @exception InvocationTargetException
- * wraps any CoreException, runtime exception or error thrown by the execute()
- * method
- * @see WorkspaceModifyOperation - this class was directly copied from it
- */
- public synchronized final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- final InvocationTargetException[] iteHolder = new InvocationTargetException[1];
- try {
-
- IWorkspaceRunnable workspaceRunnable = new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor pm) throws CoreException {
- try {
- doRun(pm);
- if (opStatus != null && !opStatus.isOK()) {
- //TODO do something with the status
- System.out.println(opStatus.getMessage());
- }
- } catch (InvocationTargetException e) {
- // Pass it outside the workspace runnable
- iteHolder[0] = e;
- } catch (InterruptedException e) {
- // Re-throw as OperationCanceledException, which will
- // be
- // caught and re-thrown as InterruptedException below.
- throw new OperationCanceledException(e.getMessage());
- }
- }
- };
- ISchedulingRule rule = getSchedulingRule();
- if (rule == null)
- ResourcesPlugin.getWorkspace().run(workspaceRunnable, monitor);
- else
- ResourcesPlugin.getWorkspace().run(workspaceRunnable, rule, 0, monitor);
- } catch (CoreException e) {
- if (e.getStatus().getCode() == IResourceStatus.OPERATION_FAILED)
- throw new WFTWrappedException(e.getStatus().getException(), e.getMessage());
- throw new WFTWrappedException(e);
- } catch (OperationCanceledException e) {
- throw new InterruptedException(e.getMessage());
- }
- // Re-throw the InvocationTargetException, if any occurred
- if (iteHolder[0] != null) {
- throw new WFTWrappedException(iteHolder[0].getTargetException(), iteHolder[0].getMessage());
- }
- }
-
- /**
- * @return
- */
- protected ISchedulingRule getSchedulingRule() {
- return null;
- }
-
- public final void doRun(IProgressMonitor pm) throws CoreException, InvocationTargetException, InterruptedException {
- boolean alreadyLocked = operationDataModel == null ? true : operationDataModel.isLocked();
- boolean operationValidationEnabled = operationDataModel == null ? false : operationDataModel.isOperationValidationEnabled();
- try {
- if (!alreadyLocked) {
- operationDataModel.setLocked(true);
- }
- if (operationValidationEnabled) {
- operationDataModel.setOperationValidationEnabled(false);
- IStatus status = operationDataModel.validateDataModel();
- if (!status.isOK()) {
- //TODO display something to user and remove System.out
- System.out.println(WTPResourceHandler.getString("24", new Object[]{status.getMessage()})); //$NON-NLS-1$
- Thread.dumpStack();
- return;
- }
- }
- initilize(pm);
-
- if (!validateEdit())
- return;
- //if (getStatus().isOK()) {
- ComposedExtendedOperationHolder extOpHolder = initializeExtensionOperations();
- IStatus preOpStatus = runPreOps(pm, extOpHolder);
- execute(pm);
- IStatus postOpStatus = runPostOps(pm, extOpHolder);
- if (null != preOpStatus)
- addExtendedStatus(preOpStatus);
- if (null != postOpStatus)
- addExtendedStatus(postOpStatus);
- //}
- } finally {
- dispose(pm);
-
- if (!alreadyLocked) {
- operationDataModel.setLocked(false);
- }
- if (operationValidationEnabled) {
- operationDataModel.setOperationValidationEnabled(true);
- }
-
- }
- // CoreException and OperationCanceledException are propagated
- }
-
- // Subclasses should override as they need to
- protected boolean validateEdit() {
- return true;
- }
-
- /**
- * This is to track the status of the main flow of operations (extended operation stati are
- * added through addExtendedStatus) execute() should call this method as necessary.
- *
- * @param aStatus
- */
- protected final void addStatus(IStatus aStatus) {
- if (opStatus == null) {
- opStatus = new OperationStatus(aStatus.getMessage(), aStatus.getException());
- opStatus.setSeverity(aStatus.getSeverity());
- opStatus.add(aStatus);
- } else {
- opStatus.add(aStatus);
- }
- }
-
- /**
- * This is to keep track of extended operation stati. If the main status is WARNING, an extended
- * status of ERROR will not make the main status ERROR. If the main status is OK, an extended
- * status of ERROR or WARNING will make the main status WARNING.
- *
- * @param aStatus
- */
- private void addExtendedStatus(IStatus aStatus) {
- if (opStatus == null) {
- opStatus = new OperationStatus(new IStatus[]{WTPCommonPlugin.OK_STATUS});
- }
- opStatus.addExtendedStatus(aStatus);
- }
-
- private IStatus runPostOps(IProgressMonitor pm, ComposedExtendedOperationHolder extOpHolder) {
- IStatus postOpStatus = null;
- if ((extOpHolder != null) && extOpHolder.hasPostOps()) {
- postOpStatus = runExtendedOps(extOpHolder.getPostOps(), pm);
- }
-
- return postOpStatus;
- }
-
- private IStatus runPreOps(IProgressMonitor pm, ComposedExtendedOperationHolder extOpHolder) {
- IStatus preOpStatus = null;
- if ((extOpHolder != null) && extOpHolder.hasPreOps()) {
- preOpStatus = runExtendedOps(extOpHolder.getPreOps(), pm);
- }
- return preOpStatus;
- }
-
- private IStatus runExtendedOps(List opList, IProgressMonitor pm) {
- WTPOperation op = null;
- OperationStatus returnStatus = null;
- IStatus localStatus;
- String opId = null;
- IEnablementIdentifier enablementIdentifer = null;
- for (int i = 0; i < opList.size(); i++) {
- op = (WTPOperation) opList.get(i);
- try {
- opId = op.getID();
- enablementIdentifer = IEnablementManager.INSTANCE.getIdentifier(opId, operationDataModel.getTargetProject());
- if (enablementIdentifer.isEnabled()) {
- op.setOperationDataModel(operationDataModel);
- op.doRun(new SubProgressMonitor(pm, IProgressMonitor.UNKNOWN));
- localStatus = op.getStatus();
- } else
- localStatus = null;
- } catch (Exception e) {
- localStatus = new Status(IStatus.ERROR, WTPCommonPlugin.PLUGIN_ID, 0, WTPResourceHandler.getString("25", new Object[]{op.getClass().getName()}), e); //$NON-NLS-1$
- }
- if (localStatus != null) {
- if (returnStatus == null) {
- returnStatus = new OperationStatus(new IStatus[]{localStatus});
- } else {
- returnStatus.add(localStatus);
- }
- }
- }
- return returnStatus;
- }
-
- // protected WTPOperation getRootExtendedOperation() {
- // if (this.getRootExtendedOperation() == null)
- // return this;
- // return this.getRootExtendedOperation();
- // }
-
- protected static final void runNestedDefaultOperation(WTPOperationDataModel model, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- WTPOperation op = model.getDefaultOperation();
- if (op != null)
- op.run(monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModel.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModel.java
deleted file mode 100644
index 218689a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModel.java
+++ /dev/null
@@ -1,865 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Oct 28, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-public abstract class WTPOperationDataModel implements WTPOperationDataModelListener {
- /**
- * An unsettable property used soley to trip validation for nested models. Clients only use this
- * property for validation purposes and never get or set its value. Subclasses can override
- * nested model validation by checking for this property in the doValidate method and not
- * calling super with it.
- */
- public static final String NESTED_MODEL_VALIDATION_HOOK = "WTPOperationDataModel.NESTED_MODEL_VALIDATION_HOOK"; //$NON-NLS-1$
- /**
- * Optional, type boolean This boolean was added for users who wish to delay the operation from
- * being run on a "finish". The operation will be cached in the CACHED_DELAYED_OPERATION which
- * then leaves the user responsible for running this operation when they see fit.
- */
- public static final String RUN_OPERATION = "WTPOperationDataModel.RUN_OPERATION"; //$NON-NLS-1$
- /**
- * Internal, type WTPOperation
- */
- public static final String CACHED_DELAYED_OPERATION = "WTPOperationDataModel.CACHED_DELAYED_OPERATION"; //$NON-NLS-1$
- /**
- * Optional Operation handler to allow user to prompt on save defaults to NullOperationHandler()
- * set to UIOperationHanlder() to add prompt
- */
-
- public static final String UI_OPERATION_HANLDER = "WTPOperationDataModel.UI_OPERATION_HANLDER"; //$NON-NLS-1$
-
- private static final String PROPERTY_NOT_LOCATED_ = WTPResourceHandler.getString("20"); //$NON-NLS-1$
- private static final String NESTED_MODEL_NOT_LOCATED = WTPResourceHandler.getString("21"); //$NON-NLS-1$
- public static IStatus OK_STATUS = new Status(IStatus.OK, "org.eclipse.wst.common.frameworks.internal", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
- private Set validProperties = new HashSet();
- private Set validBaseProperties = new HashSet();
- private Map propertyValues = new Hashtable();
- private Map nestedModels;
- private List listeners;
- private boolean ignorePropertyChanges = false;
- private boolean notificationEnabled = true;
- private boolean locked = false;
- private boolean operationValidationEnabled = false;
- private boolean hasBeenExecutedAgainst = false;
- private boolean suspendValidation = false;
- private WTPOperationDataModel extendedRoot;
-
- public WTPOperationDataModel() {
- init_internal();
- }
-
- public abstract WTPOperation getDefaultOperation();
-
- private final void init_internal() {
- initValidBaseProperties();
- initNestedModels();
- init();
- }
-
- /**
- * This is for subclasses to perform any required initialization other than
- * initValidBaseProperties() and initNestedModels() both which will be called first
- * @see initValidBaseProperties()
- * @see initNestedModels()
- */
- protected void init() {
- }
-
- /**
- * This is for subclasses to override to initialize any nested DataModels. This will be called
- * before init() and after initValidBaseProperties()
- * @see init()
- * @see initValidBaseProperties();
- */
- protected void initNestedModels() {
- }
-
- protected void addValidBaseProperty(String propertyName) {
- validBaseProperties.add(propertyName);
- validProperties.add(propertyName);
- }
-
- /**
- *
- */
- protected void initValidBaseProperties() {
- addValidBaseProperty(RUN_OPERATION);
- addValidBaseProperty(CACHED_DELAYED_OPERATION);
- addValidBaseProperty(UI_OPERATION_HANLDER);
- }
-
- public void addNestedModel(String modelName, WTPOperationDataModel dataModel) {
- if (dataModel == null)
- return;
- if (null == nestedModels) {
- validBaseProperties.add(NESTED_MODEL_VALIDATION_HOOK);
- validProperties.add(NESTED_MODEL_VALIDATION_HOOK);
- nestedModels = new Hashtable();
- }
- nestedModels.put(modelName, dataModel);
- validProperties.addAll(dataModel.validProperties);
- dataModel.addListener(this);
- WTPOperationDataModelListener extendedListener = dataModel.getExtendedSynchronizer();
- if (extendedListener != null) {
- if (this.extendedRoot == null)
- dataModel.extendedRoot = this;
- else
- dataModel.extendedRoot = this.extendedRoot;
- this.addListener(extendedListener);
- }
- }
-
- /**
- * @return
- */
- protected WTPOperationDataModelListener getExtendedSynchronizer() {
- return null;
- }
-
- public WTPOperationDataModel removeNestedModel(String modelName) {
- if (modelName == null || nestedModels == null)
- return null;
- WTPOperationDataModel model = (WTPOperationDataModel) nestedModels.remove(modelName);
- validProperties.removeAll(model.validProperties);
- model.removeListener(this);
- if (nestedModels.isEmpty()) {
- nestedModels = null;
- validBaseProperties.remove(NESTED_MODEL_VALIDATION_HOOK);
- validProperties.remove(NESTED_MODEL_VALIDATION_HOOK);
- }
- return model;
- }
-
- public final WTPOperationDataModel getNestedModel(String modelName) {
- WTPOperationDataModel dataModel = (WTPOperationDataModel) nestedModels.get(modelName);
- if (null == dataModel) {
- throw new RuntimeException(NESTED_MODEL_NOT_LOCATED + modelName);
- }
- return dataModel;
- }
-
- public final Object getProperty(String propertyName) {
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return doGetProperty(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.getProperty(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- /**
- * Subclasses can override this method to determine if a given propertyName should be enabled
- * for edit. Returning null indicates that there is no precedence on the enablement. Note that
- * you can override this in an outer model since enablement may be different in the outer model.
- *
- * @param propertyName
- * @return
- */
- public final Boolean isEnabled(String propertyName) {
- checkValidPropertyName(propertyName);
- return basicIsEnabled(propertyName);
- }
-
- /**
- * Subclasses can override this method to determine if a given propertyName should be enabled
- * for edit. Returning null indicates that there is no precedence on the enablement. Note that
- * you can override this in an outer model since enablement may be different in the outer model.
- *
- * @param propertyName
- * @return
- */
- protected Boolean basicIsEnabled(String propertyName) {
- if (isBaseProperty(propertyName)) {
- return null;
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.isEnabled(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- /**
- * @deprecated use getValidPropertyDescriptors(String)
- * @param propertyName
- * @return
- */
- public final Object[] getValidPropertyValues(String propertyName) {
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return doGetValidPropertyValues(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.getValidPropertyValues(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- /**
- * @deprecated use getValidPropertyDescriptors(String)
- * @param propertyName
- * @return
- */
- public final String[] getValidStringPropertyValues(String propertyName) {
- Object[] values = getValidPropertyValues(propertyName);
- if (values != null)
- return (String[]) values;
- return new String[0];
- }
-
- /**
- * Subclasses may override to provide specific valid property values for the given propertyName.
- *
- * @deprecated use doGetValidPropertyDescriptors(String)
- * @param propertyName
- * @return
- */
- protected Object[] doGetValidPropertyValues(String propertyName) {
- return null;
- }
-
- public final WTPPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return doGetValidPropertyDescriptors(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.getValidPropertyDescriptors(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- /**
- * Subclasses may override to provide specific valid property values for the given propertyName.
- *
- * @param propertyName
- * @return
- */
- protected WTPPropertyDescriptor[] doGetValidPropertyDescriptors(String propertyName) {
- return new WTPPropertyDescriptor[0];
- }
-
- public final WTPPropertyDescriptor getPropertyDescriptor(String propertyName) {
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return doGetPropertyDescriptor(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.doGetPropertyDescriptor(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- protected WTPPropertyDescriptor doGetPropertyDescriptor(String propertyName) {
- return new WTPPropertyDescriptor(getProperty(propertyName));
- }
-
- /**
- * Return a property of type String. If the property value is null, an empty String will be
- * returned.
- *
- * @param propertyName
- * @return
- */
- public final String getStringProperty(String propertyName) {
- Object prop = getProperty(propertyName);
- if (prop == null)
- return ""; //$NON-NLS-1$
- return (String) prop;
- }
-
- /**
- * Return IProject which is a handle to a project in the workspace which has the same name as
- * that which is returned from the String property <code>projectNameProperty</code>.
- *
- * @param projectNameProperty
- * @return
- */
- public IProject getProjectHandle(String projectNameProperty) {
- String projectName = (String) getProperty(projectNameProperty);
- return getProjectHandleFromName(projectName);
- }
-
- public IProject getProjectHandleFromName(String projectName) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus status = workspace.validateName(projectName, IResource.PROJECT);
- return (null != projectName && projectName.length() > 0 && status.isOK()) ? ResourcesPlugin.getWorkspace().getRoot().getProject(projectName) : null;
- }
-
- public IProject getTargetProject() {
- return null;
- }
-
- /**
- * Return a property of type boolean. If the property value is null, an false will be returned.
- *
- * @param propertyName
- * @return
- */
- public final boolean getBooleanProperty(String propertyName) {
- Object prop = getProperty(propertyName);
- if (prop == null)
- return false;
- return ((Boolean) prop).booleanValue();
- }
-
- /**
- * Return a property of type int. If the property value is null, a -1 will be returned.
- *
- * @param propertyName
- * @return
- */
- public final int getIntProperty(String propertyName) {
- Object prop = getProperty(propertyName);
- if (prop == null)
- return -1;
- return ((Integer) prop).intValue();
- }
-
- public final void setBooleanProperty(String propertyName, boolean value) {
- Boolean b = getBoolean(value);
- setProperty(propertyName, b);
- }
-
- protected Boolean getBoolean(boolean b) {
- if (b)
- return Boolean.TRUE;
- return Boolean.FALSE;
- }
-
- public void setIntProperty(String propertyName, int value) {
- Integer i = new Integer(value);
- setProperty(propertyName, i);
- }
-
- protected Object doGetProperty(String propertyName) {
- if (propertyValues.containsKey(propertyName)) {
- return propertyValues.get(propertyName);
- }
- return getDefaultProperty(propertyName);
- }
-
- /**
- * Override this method to compute default property values
- *
- * @param propertyName
- * @return
- */
- protected Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(RUN_OPERATION)) {
- return Boolean.TRUE;
- }
- if (propertyName.equals(UI_OPERATION_HANLDER)) {
- return new NullOperationHandler();
- }
- return null;
- }
-
- /*
- * This assumes that checkValidPropertyName(String) has already been called.
- */
- private boolean isBaseProperty(String propertyName) {
- if (validBaseProperties != null)
- return validBaseProperties.contains(propertyName);
- return true;
- }
-
- public boolean isProperty(String propertyName) {
- return validProperties.contains(propertyName);
- }
-
- protected void checkValidPropertyName(String propertyName) {
- if (!validProperties.contains(propertyName)) {
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
- }
-
- /**
- * unset a property by passing null for the value
- *
- * @param propertyName
- * @param propertyValue
- */
- public final void setProperty(String propertyName, Object propertyValue) {
- if (isLocked() && !isResultProperty(propertyName))
- throw new IllegalStateException(WTPResourceHandler.getString("18", new Object[]{getClass().getName()})); //$NON-NLS-1$
- if (ignorePropertyChanges)
- return; // ignoring property changes
- checkValidPropertyName(propertyName);
- boolean nestedFound = false;
- if (isBaseProperty(propertyName)) {
- internalSetProperty(propertyName, propertyValue);
- return;
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- nestedFound = true;
- dataModel.setProperty(propertyName, propertyValue);
- }
- }
- }
- if (!nestedFound) {
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
- }
-
- private final void internalSetProperty(String propertyName, Object propertyValue) {
- Object oldValue = propertyValues.get(propertyName);
- if (valueChanged(propertyValue, oldValue)) {
- doSetProperty(propertyName, oldValue, propertyValue);
- }
- }
-
- private void doSetProperty(String propertyName, Object oldValue, Object newValue) {
- if (doSetProperty(propertyName, newValue))
- notifyListeners(propertyName, oldValue, newValue);
- }
-
- /*
- * Return true to notify listeners.
- */
- protected boolean doSetProperty(String propertyName, Object propertyValue) {
- if (null != propertyValue)
- propertyValues.put(propertyName, propertyValue);
- else if (propertyValues.containsKey(propertyName))
- propertyValues.remove(propertyName);
- return true;
- }
-
- /**
- * @param propertyValue
- * @param oldValue
- * @return
- */
- private boolean valueChanged(Object o1, Object o2) {
- return o1 != o2 && ((o1 != null && !o1.equals(o2)) || !o2.equals(o1));
- }
-
- /**
- * @param oldValue
- * @param propertyValue
- */
- public void notifyListeners(String propertyName, Object oldValue, Object propertyValue) {
- notifyListeners(propertyName, PROPERTY_CHG, oldValue, propertyValue);
- }
-
- /**
- * @param oldValue
- * @param propertyValue
- */
- protected void notifyListeners(String propertyName, int flag, Object oldValue, Object propertyValue) {
- notifyListeners(new WTPOperationDataModelEvent(this, propertyName, oldValue, propertyValue, flag));
- }
-
- protected void notifyListeners(WTPOperationDataModelEvent event) {
- if (notificationEnabled && listeners != null && !listeners.isEmpty()) {
- WTPOperationDataModelListener listener;
- for (int i = 0; i < listeners.size(); i++) {
- listener = (WTPOperationDataModelListener) listeners.get(i);
- listener.propertyChanged(event);
- }
- }
- }
-
- public void propertyChanged(WTPOperationDataModelEvent event) {
- notifyListeners(event);
- }
-
- public boolean isSet(String propertyName) {
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return propertyValues.containsKey(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- return dataModel.isSet(propertyName);
- }
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- public final IStatus validateDataModel() {
- return validateDataModel(false);
- }
-
- public final IStatus validateDataModel(boolean stopOnFirstFailure) {
- if (suspendValidation)
- return OK_STATUS;
- IStatus status = null;
- if (validBaseProperties != null && !validBaseProperties.isEmpty()) {
- IStatus propStatus;
- String propName;
- Iterator it = validBaseProperties.iterator();
- while (it.hasNext()) {
- propName = (String) it.next();
- propStatus = validateProperty(propName);
- if (status == null || status.isOK())
- status = propStatus;
- else {
- if (status.isMultiStatus())
- ((MultiStatus) status).merge(propStatus);
- else {
- MultiStatus multi = new MultiStatus("org.eclipse.wst.common.frameworks.internal", 0, "", null); //$NON-NLS-1$ //$NON-NLS-2$
- multi.merge(status);
- multi.merge(propStatus);
- status = multi;
- }
- }
- if (stopOnFirstFailure && status != null && !status.isOK() && status.getSeverity() == IStatus.ERROR)
- return status;
- }
- }
- if (status == null)
- return OK_STATUS;
- return status;
- }
-
- public void addListener(WTPOperationDataModelListener listener) {
- if (listener != null) {
- if (listeners == null) {
- listeners = new ArrayList();
- listeners.add(listener);
- } else if (!listeners.contains(listener))
- listeners.add(listener);
- }
- }
-
- public void removeListener(WTPOperationDataModelListener listener) {
- if (listeners != null && listener != null)
- listeners.remove(listener);
- }
-
- /**
- * Return true if the model doesn't have any errors.
- *
- * @return boolean
- */
- public boolean isValid() {
- IStatus status = validateDataModel(true);
- if (status.isOK())
- return true;
- if (status.getSeverity() == IStatus.ERROR)
- return false;
- return true;
- }
-
- /**
- * Use this method when the model should ignore any property set calls. Remember to always reset
- * the value in a finally block.
- *
- * @param aBoolean
- */
- public void setIgnorePropertyChanges(boolean aBoolean) {
- ignorePropertyChanges = aBoolean;
- }
-
- /**
- * Return the status for the validation of a particular property. Subclasses should override
- * when a specific validation is required.
- *
- * @param propertyName
- * @return
- */
- protected IStatus doValidateProperty(String propertyName) {
- if (NESTED_MODEL_VALIDATION_HOOK.equals(propertyName)) {
- if (nestedModels != null && !nestedModels.isEmpty()) {
- IStatus modelStatus;
- WTPOperationDataModel dataModel;
- Iterator it = nestedModels.values().iterator();
- while (it.hasNext()) {
- dataModel = (WTPOperationDataModel) it.next();
- modelStatus = dataModel.validateDataModel(true);
- if (!modelStatus.isOK()) {
- return modelStatus;
- }
- }
- }
- }
- return OK_STATUS;
- }
-
- public final IStatus validateProperty(String propertyName) {
- if (suspendValidation)
- return OK_STATUS;
- checkValidPropertyName(propertyName);
- if (isBaseProperty(propertyName)) {
- return doValidateProperty(propertyName);
- } else if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- boolean propertyFound = false;
- IStatus status = null;
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- if (dataModel.isProperty(propertyName)) {
- propertyFound = true;
- status = dataModel.validateProperty(propertyName);
- if (!status.isOK()) {
- return status;
- }
- }
- }
- if (propertyFound) {
- return OK_STATUS;
- }
- }
- throw new RuntimeException(PROPERTY_NOT_LOCATED_ + propertyName);
- }
-
- // handles for validation enablement for model and nested children
- protected void enableValidation() {
- suspendValidation = false;
- if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- dataModel.enableValidation();
- }
- }
- }
-
- // handles for validation disablement for model and nested children
- protected void disableValidation() {
- suspendValidation = true;
- if (nestedModels != null) {
- WTPOperationDataModel dataModel = null;
- Object[] keys = nestedModels.keySet().toArray();
- for (int i = 0; i < keys.length; i++) {
- dataModel = (WTPOperationDataModel) nestedModels.get(keys[i]);
- dataModel.disableValidation();
- }
- }
- }
-
- /**
- * This method should be called from doSetProperty(String, Object) when a change to a
- * propertyName will cause default values within the model to change. The passed propertyName is
- * another property that may need to have its default value recomputed. This allows for UIs to
- * refresh.
- *
- * @param propertyName
- */
- public void notifyDefaultChange(String propertyName) {
- if (!isSet(propertyName))
- notifyListeners(propertyName, null, null);
- }
-
- /**
- * This method should be called when the valid values for the given propertyName may need to be
- * recaculated. This allows for UIs to refresh.
- *
- * @param propertyName
- */
- public void notifyValidValuesChange(String propertyName) {
- notifyListeners(propertyName, WTPOperationDataModelListener.VALID_VALUES_CHG, null, null);
- }
-
- protected void notifyEnablementChange(String propertyName) {
- Boolean enable = isEnabled(propertyName);
- if (enable != null)
- notifyListeners(propertyName, ENABLE_CHG, null, enable);
- }
-
- public void dispose() {
- }
-
- protected boolean isNotificationEnabled() {
- return notificationEnabled;
- }
-
- protected void setNotificationEnabled(boolean notificationEnabled) {
- this.notificationEnabled = notificationEnabled;
- }
-
- /**
- * @return Returns the locked.
- */
- protected boolean isLocked() {
- return locked;
- }
-
- /**
- * @param locked
- * The locked to set.
- */
- protected void setLocked(boolean locked) {
- this.locked = locked;
- if (locked)
- hasBeenExecutedAgainst = true;
- }
-
- /**
- * By Overwriting this method, you can change the model when its executing. This is only
- * recommened when you need to set the result of the operation in the model.
- *
- * @param propertyName
- * @return
- */
- protected boolean isResultProperty(String propertyName) {
- return false;
- }
-
-
- public final boolean isOperationValidationEnabled() {
- return operationValidationEnabled;
- }
-
- public final void setOperationValidationEnabled(boolean operationValidationEnabled) {
- this.operationValidationEnabled = operationValidationEnabled;
- }
-
- /**
- * Use this method to set the property values from this model onto the otherModel for those that
- * are valid for the otherModel.
- *
- * @param otherModel
- */
- public void synchronizeValidPropertyValues(WTPOperationDataModel otherModel, String[] properties) {
- if (otherModel == null || properties == null || properties.length == 0)
- return;
- for (int i = 0; i < properties.length; i++) {
- if (isSet(properties[i]))
- otherModel.setProperty(properties[i], getProperty(properties[i]));
- }
- }
-
- /**
- * Remove all propertyValues.
- *
- */
- public void clearAllValues() {
- if (propertyValues != null)
- propertyValues.clear();
- if (nestedModels != null) {
- Iterator it = nestedModels.values().iterator();
- while (it.hasNext())
- ((WTPOperationDataModel) it.next()).clearAllValues();
- }
- }
-
- /**
- * Use this method to determine if an operation has been run using this data model.
- *
- * @return
- */
- public boolean hasBeenExecutedAgainst() {
- return hasBeenExecutedAgainst;
- }
-
- private final void assertModelIsExtended() {
- if (extendedRoot == null)
- throw new IllegalStateException(WTPResourceHandler.getString("19")); //$NON-NLS-1$
- }
-
- protected final Object getParentProperty(String propertyName) {
- assertModelIsExtended();
- return extendedRoot.getProperty(propertyName);
- }
-
- protected final int getParentIntProperty(String propertyName) {
- assertModelIsExtended();
- return extendedRoot.getIntProperty(propertyName);
- }
-
- protected final boolean getParentBooleanProperty(String propertyName) {
- assertModelIsExtended();
- return extendedRoot.getBooleanProperty(propertyName);
- }
-
- protected final String getParentStringProperty(String propertyName) {
- assertModelIsExtended();
- return extendedRoot.getStringProperty(propertyName);
- }
-
- protected IStatus validateStringValue(String propertyName, String errorMessage) {
- String name = getStringProperty(propertyName);
- if (name == "" || name == null || name.trim().length() == 0) { //$NON-NLS-1$
- return WTPCommonPlugin.createErrorStatus(errorMessage);
- }
- return OK_STATUS;
- }
-
- protected IStatus validateObjectArrayValue(String propertyName, String errorMessage) {
- Object[] objects = (Object[]) getProperty(propertyName);
- if (objects == null || objects.length == 0) {
- return WTPCommonPlugin.createErrorStatus(errorMessage);
- }
- return OK_STATUS;
- }
-
- protected static IStatus validateProjectName(String projectName) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus status = workspace.validateName(projectName, IResource.PROJECT);
- if (!status.isOK())
- return status;
- return OK_STATUS;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelEvent.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelEvent.java
deleted file mode 100644
index 411d5ca..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelEvent.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 6, 2004
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code Generation - Code and
- * Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public class WTPOperationDataModelEvent {
-
- /**
- * Flags associated with the propertyChanged event. <code>PROPERTY_CHG</code>= A simple
- * property change. <code>VALID_VALUES_CHG</code>= The valid values for the given property
- * have changed. <code>ENABLE_CHG</code>= The enablement for the given property has changed.
- */
- public static final int PROPERTY_CHG = 1;
- public static final int VALID_VALUES_CHG = 2;
- public static final int ENABLE_CHG = 3;
-
- private WTPOperationDataModel dataModel;
- private String propertyName;
- private Object oldValue;
- private Object newValue;
- private int flag;
-
- public WTPOperationDataModelEvent(WTPOperationDataModel dataModel, String propertyName, Object oldValue, Object newValue) {
- this(dataModel, propertyName, oldValue, newValue, PROPERTY_CHG);
- }
-
- public WTPOperationDataModelEvent(WTPOperationDataModel dataModel, String propertyName, Object oldValue, Object newValue, int flag) {
- this.dataModel = dataModel;
- this.propertyName = propertyName;
- this.oldValue = oldValue;
- this.newValue = newValue;
- this.flag = flag;
- }
-
- public WTPOperationDataModel getDataModel() {
- return dataModel;
- }
-
- public int getFlag() {
- return flag;
- }
-
- public Object getNewValue() {
- return newValue;
- }
-
- public Object getOldValue() {
- return oldValue;
- }
-
- public String getPropertyName() {
- return propertyName;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelListener.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelListener.java
deleted file mode 100644
index 80221db..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationDataModelListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-public interface WTPOperationDataModelListener {
- /**
- * Flags associated with the propertyChanged event. <code>PROPERTY_CHG</code>= A simple
- * property change. <code>VALID_VALUES_CHG</code>= The valid values for the given property
- * have changed. <code>ENABLE_CHG</code>= The enablement for the given property has changed.
- */
- final int PROPERTY_CHG = WTPOperationDataModelEvent.PROPERTY_CHG;
- final int VALID_VALUES_CHG = WTPOperationDataModelEvent.VALID_VALUES_CHG;
- final int ENABLE_CHG = WTPOperationDataModelEvent.ENABLE_CHG;
-
- /**
- * A property has changed on the model with the given propertyName. Use the flag to detect the
- * type of change.
- *
- * @param propertyName
- * @param flag
- * @param oldValue
- * @param newValue
- *
- * @see WTPOperationDataModelListener#PROPERTY_CHG
- * @see WTPOperationDataModelListener#VALID_VALUES_CHG
- */
- void propertyChanged(WTPOperationDataModelEvent event);
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationJobAdapter.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationJobAdapter.java
deleted file mode 100644
index b7a0456..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPOperationJobAdapter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-/*
- * Created on Jan 20, 2004
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-
-public class WTPOperationJobAdapter extends Job {
-
- private WTPOperation operation = null;
-
- public WTPOperationJobAdapter(WTPOperation operation) {
- super(operation.toString());
- this.operation = operation;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- IStatus result = null;
- try {
- operation.run(monitor);
- result = operation.getStatus(); //new Status(IStatus.OK, WTPCommonPlugin.PLUGIN_ID,
- // IStatus.OK, WTPResourceHandler.getString("26"),
- // null); //$NON-NLS-1$
- } catch (Exception e) {
- operation.addStatus(new Status(IStatus.ERROR, WTPCommonPlugin.PLUGIN_ID, IStatus.ERROR, WTPResourceHandler.getString("27"), e)); //$NON-NLS-1$
- result = operation.getStatus();
- Logger.getLogger().logError(e);
- }
- return result;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPPropertyDescriptor.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPPropertyDescriptor.java
deleted file mode 100644
index adcf631..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclipse/wst/common/frameworks/internal/operations/WTPPropertyDescriptor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Created on Nov 18, 2004
- * @author jsholl
- */
-package org.eclipse.wst.common.frameworks.internal.operations;
-
-/**
- * @author jsholl
- */
-public class WTPPropertyDescriptor {
-
- public static WTPPropertyDescriptor[] createDescriptors(Object[] values) {
- if (null == values) {
- return new WTPPropertyDescriptor[0];
- }
- WTPPropertyDescriptor[] descriptors = new WTPPropertyDescriptor[values.length];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new WTPPropertyDescriptor(values[i]);
- }
- return descriptors;
- }
-
- public static WTPPropertyDescriptor[] createDescriptors(Object[] values, String[] descriptions) {
- if (null == values) {
- return new WTPPropertyDescriptor[0];
- }
- WTPPropertyDescriptor[] descriptors = new WTPPropertyDescriptor[values.length];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new WTPPropertyDescriptor(values[i], descriptions[i]);
- }
- return descriptors;
-
- }
-
- private Object propertyValue;
- private String propertyDescription;
-
- public WTPPropertyDescriptor(Object propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- public WTPPropertyDescriptor(Object propertyValue, String propertyDescription) {
- this.propertyValue = propertyValue;
- this.propertyDescription = propertyDescription;
- }
-
- public Object getPropertyValue() {
- return propertyValue;
- }
-
- public String getPropertyDescription() {
- if (null != propertyDescription) {
- return propertyDescription;
- }
- String str = (null != propertyValue) ? propertyValue.toString() : null;
- return (null != str) ? str : ""; //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/AscendingGroupComparator.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/AscendingGroupComparator.java
deleted file mode 100644
index 5228373..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/AscendingGroupComparator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Comparator;
-
-/**
- * @author blancett
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class AscendingGroupComparator implements Comparator {
- private static AscendingGroupComparator singleton;
-
- public int compare(Object o1, Object o2) {
- if (o2 == null && o1 != null)
- return -1;
- if (o1 == null && o2 != null)
- return 1;
- if (o1 == null && o2 == null)
- return 0;
-
- FunctionGroup group1 = (FunctionGroup) o1;
- FunctionGroup group2 = (FunctionGroup) o2;
-
- if (group1.getPriority() > group2.getPriority())
- return 1;
- if (group1.getPriority() == group2.getPriority())
- return 0;
- if (group1.getPriority() < group2.getPriority())
- return -1;
- return 0;
- }
-
- public static Comparator singleton() {
- if (singleton == null)
- singleton = new AscendingGroupComparator();
- return singleton;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/DescendingGroupComparator.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/DescendingGroupComparator.java
deleted file mode 100644
index eb170a0..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/DescendingGroupComparator.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Comparator;
-
-/**
- * @author blancett
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class DescendingGroupComparator implements Comparator {
-
- private static DescendingGroupComparator singleton;
-
- public int compare(Object o1, Object o2) {
- if (o1 == null && o2 != null)
- return -1;
- if (o2 == null && o1 != null)
- return 1;
- if (o1 == null && o2 == null)
- return 0;
-
- FunctionGroup group1 = (FunctionGroup) o1;
- FunctionGroup group2 = (FunctionGroup) o2;
-
- if (group1.getPriority() > group2.getPriority())
- return -1;
- if (group1.getPriority() == group2.getPriority())
- return 0;
- if (group1.getPriority() < group2.getPriority())
- return 1;
- return 0;
-
- }
-
- public static Comparator singleton() {
- if (singleton == null)
- singleton = new DescendingGroupComparator();
- return singleton;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifier.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifier.java
deleted file mode 100644
index 6907aab..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifier.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class EnablementIdentifier implements IEnablementIdentifier {
-
- private final static int HASH_FACTOR = 89;
-
- private final static int HASH_INITIAL = EnablementIdentifier.class.getName().hashCode();
-
- private final static Set strongReferences = new HashSet();
-
- private Set functionGroupIds;
-
- private transient String[] functionGroupIdsAsArray;
-
- private boolean enabled;
-
- private transient int hashCode;
-
- private transient boolean hashCodeComputed;
-
- private String id;
-
- private List identifierListeners;
-
- private transient String string;
-
- private IProject project;
-
- protected EnablementIdentifier(String id) {
- this(id, null);
- }
-
- protected EnablementIdentifier(String id, IProject project) {
- if (id == null)
- throw new NullPointerException();
- this.id = id;
- this.project = project;
- }
-
- public void addIdentifierListener(IEnablementIdentifierListener identifierListener) {
- if (identifierListener == null)
- throw new NullPointerException();
-
- if (identifierListeners == null)
- identifierListeners = new ArrayList();
-
- if (!identifierListeners.contains(identifierListener))
- identifierListeners.add(identifierListener);
-
- strongReferences.add(this);
- }
-
- public int compareTo(Object object) {
- EnablementIdentifier castedObject = (EnablementIdentifier) object;
- return Util.compare(id, castedObject.id);
-
- }
-
- public boolean equals(Object object) {
- if (!(object instanceof EnablementIdentifier))
- return false;
-
- EnablementIdentifier castedObject = (EnablementIdentifier) object;
- boolean equals = Util.equals(id, castedObject.id);
- return equals;
- }
-
- protected void fireIdentifierChanged(EnablementIdentifierEvent functionIdentifierEvent) {
- if (functionIdentifierEvent == null)
- throw new NullPointerException();
-
- if (identifierListeners != null) {
- synchronized (identifierListeners) {
- for (int i = 0; i < identifierListeners.size(); i++)
- ((IEnablementIdentifierListener) identifierListeners.get(i)).identifierChanged(functionIdentifierEvent);
- }
- }
- }
-
- public Set getFunctionGroupIds() {
- return functionGroupIds;
- }
-
- public String getId() {
- return id;
- }
-
- public int hashCode() {
- if (!hashCodeComputed) {
- hashCode = HASH_INITIAL;
- hashCode = hashCode * HASH_FACTOR + Util.hashCode(id);
- hashCodeComputed = true;
- }
-
- return hashCode;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void removeIdentifierListener(IEnablementIdentifierListener identifierListener) {
- if (identifierListener == null)
- throw new NullPointerException();
-
- if (identifierListeners != null)
- identifierListeners.remove(identifierListener);
-
- if (identifierListeners.isEmpty())
- strongReferences.remove(this);
- }
-
- protected boolean setFunctionGroupIds(Set functionGroupIds) {
- functionGroupIds = Util.safeCopy(functionGroupIds, String.class);
-
- if (!Util.equals(functionGroupIds, this.functionGroupIds)) {
- this.functionGroupIds = functionGroupIds;
- this.functionGroupIdsAsArray = (String[]) this.functionGroupIds.toArray(new String[this.functionGroupIds.size()]);
-
- hashCodeComputed = false;
- hashCode = 0;
- string = null;
- return true;
- }
-
- return false;
- }
-
- protected boolean setEnabled(boolean enabled) {
- if (enabled != this.enabled) {
- this.enabled = enabled;
- hashCodeComputed = false;
- hashCode = 0;
- string = null;
- return true;
- }
-
- return false;
- }
-
- /**
- * Recompute the enabled state and return whether the state changed
- */
- protected boolean resetEnabled() {
- return setEnabled(getNewEnabled());
- }
-
- protected boolean getNewEnabled() {
- if (project == null)
- return true;
- if (functionGroupIdsAsArray.length == 0)
- return true;
- for (int i = 0; i < functionGroupIdsAsArray.length; i++) {
- FunctionGroup group = FunctionGroupRegistry.getInstance().getGroupByID(functionGroupIdsAsArray[i]);
- if (group != null && group.isEnabled(project))
- return true;
- }
- return false;
- }
-
- public String toString() {
- if (string == null) {
- final StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append('[');
- stringBuffer.append(functionGroupIds);
- stringBuffer.append(',');
- stringBuffer.append(enabled);
- stringBuffer.append(',');
- stringBuffer.append(id);
- stringBuffer.append(']');
- string = stringBuffer.toString();
- }
-
- return string;
- }
-
- /**
- * The associated Project may be null
- *
- * @return Returns the project.
- */
- public IProject getProject() {
- return project;
- }
-
- public String getPrimaryFunctionGroupId() {
- int selectedPriority = Integer.MAX_VALUE;
- int priority = 0;
- String selectedFunctionGroupId = null;
- String functionGroupId = null;
- for (Iterator iterator = getFunctionGroupIds().iterator(); iterator.hasNext();) {
- functionGroupId = iterator.next().toString();
- priority = FunctionGroupRegistry.getInstance().getGroupPriority(functionGroupId);
- if (priority < selectedPriority)
- selectedFunctionGroupId = functionGroupId;
- if (priority == 0)
- return selectedFunctionGroupId;
- }
- return selectedFunctionGroupId;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifierEvent.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifierEvent.java
deleted file mode 100644
index 48acbbf..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementIdentifierEvent.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class EnablementIdentifierEvent {
-
- private boolean functionGroupIdsChanged;
- private boolean enabledChanged;
- private IEnablementIdentifier identifier;
-
- public EnablementIdentifierEvent(IEnablementIdentifier identifier, boolean functionGroupIdsChanged, boolean enabledChanged) {
- if (identifier == null)
- throw new NullPointerException();
-
- this.identifier = identifier;
- this.functionGroupIdsChanged = functionGroupIdsChanged;
- this.enabledChanged = enabledChanged;
- }
-
- /**
- * Returns the instance of the interface that changed.
- *
- * @return the instance of the interface that changed. Guaranteed not to be <code>null</code>.
- */
- public IEnablementIdentifier getIdentifier() {
- return identifier;
- }
-
- /**
- * Returns whether or not the functionGroupIds property changed.
- *
- * @return true, iff the functionGroupIds property changed.
- */
- public boolean hasFunctionGroupIdsChanged() {
- return functionGroupIdsChanged;
- }
-
- /**
- * Returns whether or not the enabled property changed.
- *
- * @return true, iff the enabled property changed.
- */
- public boolean hasEnabledChanged() {
- return enabledChanged;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "EnablementIdentifierEvent [identifier=" + identifier.toString() + ", functionGroupIdsChanged=" + hasFunctionGroupIdsChanged() + ", enabledChanged=" + hasEnabledChanged() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementManager.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementManager.java
deleted file mode 100644
index 8514889..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/EnablementManager.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 3, 2004
- *
- * To change the template for this generated file go to Window - Preferences -
- * Java - Code Generation - Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonMessages;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * @author mdelder
- */
-public class EnablementManager implements IEnablementManager {
-
- public static final IEnablementManager INSTANCE = new EnablementManager();
-
- private static Map identifiersByProject = new WeakHashMap();
-
- public EnablementManager() {
- }
-
- /**
- * Returns a Map in which the keys are ids and the values are the identifiers
- *
- * @param project
- * @return
- */
- protected Map getIdentifiersById(IProject project) {
- Map aMap = (Map) identifiersByProject.get(project);
- if (aMap == null) {
- aMap = new WeakHashMap();
- identifiersByProject.put(project, aMap);
- }
- return aMap;
- }
-
- public IEnablementIdentifier getIdentifier(String identifierId, IProject project) {
- if (identifierId == null) throw new NullPointerException();
- if (project != null && !project.isAccessible()) project = null;
-
- EnablementIdentifier identifier = null;
- synchronized(this) {
- Map identifiersById = getIdentifiersById(project);
-
- identifier = (EnablementIdentifier) identifiersById.get(identifierId);
-
- if (identifier == null) {
- identifier = createIdentifier(identifierId, project);
- updateIdentifier(identifier);
- identifiersById.put(identifierId, identifier);
- }
- }
-
- return identifier;
- }
-
- protected EnablementIdentifier createIdentifier(String identifierId, IProject project) {
- return new EnablementIdentifier(identifierId, project);
- }
-
- private EnablementIdentifierEvent updateIdentifier(EnablementIdentifier identifier) {
- String id = identifier.getId();
- Set functionGroupIds = new HashSet();
-
- List groups = FunctionGroupRegistry.getInstance().getKnownGroups();
- for (Iterator iterator = groups.iterator(); iterator.hasNext();) {
- FunctionGroup group = (FunctionGroup) iterator.next();
-
- if (group == null)
- throw new IllegalStateException();
- if (group.isMatch(id))
- functionGroupIds.add(group.getGroupID());
- }
-
- boolean functionGroupsChanged = identifier.setFunctionGroupIds(functionGroupIds);
- boolean enabledChanged = identifier.resetEnabled();
-
- if (functionGroupsChanged || enabledChanged)
- return new EnablementIdentifierEvent(identifier, functionGroupsChanged, enabledChanged);
- return null;
- }
-
- /**
- * Notify all identifier listeners that the state of a project has changed that affects the
- * enablement of a group for a project. This method is fail safe, in that if one listener throws
- * an exception while being notified, it will not stop the notification of other listeners.
- *
- * @param evt
- * @throws CoreException
- * if exceptions were caught notifying any of the listeners. Check the status of the
- * core exception for the nested exceptions.
- */
- public final void notifyFunctionGroupChanged(String groupID, IProject project) throws CoreException {
-
- Map identifiers = getIdentifiersById(project);
-
- if (identifiers == null)
- return;
-
- EnablementIdentifier identifier = null;
- Iterator iter = identifiers.values().iterator();
- IStatus errorStatus = null;
- IStatus nextStatus = null;
-
- while (iter.hasNext()) {
- identifier = (EnablementIdentifier) iter.next();
-
- EnablementIdentifierEvent evt = updateIdentifier(identifier);
- try {
- if (evt != null)
- identifier.fireIdentifierChanged(evt);
- } catch (Exception ex) {
- //Defer the exception so others can handle it.
- nextStatus = WTPCommonPlugin.createErrorStatus(WTPCommonMessages.INTERNAL_ERROR, ex);
- Logger.getLogger().logError(ex);
- if (errorStatus == null)
- errorStatus = nextStatus;
- else if (errorStatus.isMultiStatus())
- ((MultiStatus) errorStatus).add(nextStatus);
- else {
- IStatus[] children = {errorStatus, nextStatus};
- errorStatus = new MultiStatus(errorStatus.getPlugin(), errorStatus.getCode(), children, WTPCommonMessages.INTERNAL_ERROR, null);
- }
- }
-
- }
- if (errorStatus != null)
- throw new CoreException(errorStatus);
-
- }
-
- /**
- * Utility method for clients to dispose of listeners
- *
- * @param enablementIdentifiers
- * @param listener
- */
- public void removeEnablementIdentifierListener(Collection enablementIdentifiers, IEnablementIdentifierListener listener) {
- Iterator iter = enablementIdentifiers.iterator();
- while (iter.hasNext()) {
- IEnablementIdentifier identifier = (IEnablementIdentifier) iter.next();
- identifier.removeIdentifierListener(listener);
- }
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroup.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroup.java
deleted file mode 100644
index 16c9d9e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroup.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-/**
- * @author mdelder/blancett
- */
-public class FunctionGroup implements Comparable {
-
- public static final String GROUP_NAME_ATTR = "name"; //$NON-NLS-1$
- public static final String GROUP_DESC_ATTR = "description"; //$NON-NLS-1$
- public static final String GROUP_ENABLED_BY_DEFAULT_ATTR = "enabledByDefault"; //$NON-NLS-1$
- public static final String GROUP_PRIORITY_ATTR = "priority"; //$NON-NLS-1$
- public static final String GROUP_INTIALIZER_CLASS_ATTR = "initializerClassName"; //$NON-NLS-1$
- private static final int NEGATIVE_PRIORITY = -1;
-
- private String groupID;
- private String name;
- private String description;
- private String intializerClassName;
- private String declaringExtension;
- private int priority = NEGATIVE_PRIORITY;
- private IConfigurationElement element;
- private IGroupInitializer groupInterface;
- private Set functionGroupPatternBindings;
- private transient FunctionGroupPatternBinding[] functionGroupPatternBindingsAsArray;
- private boolean errorReported = false;
-
- public FunctionGroup(String groupID, IConfigurationElement element) {
- this.groupID = groupID;
- this.element = element;
- }
-
- public String getDescription() {
- if (description == null)
- description = element.getAttribute(GROUP_DESC_ATTR);
- return description;
- }
-
- String getInitalizerClassName() {
- if (intializerClassName == null)
- intializerClassName = element.getAttribute(GROUP_INTIALIZER_CLASS_ATTR);
- return intializerClassName;
- }
-
- public String getName() {
- if (name == null)
- name = element.getAttribute(GROUP_NAME_ATTR);
- return name;
- }
-
- private String getDeclaringExtensionName() {
- if (declaringExtension == null) {
- if (element.getDeclaringExtension() == null)
- return ""; //$NON-NLS-1$
- declaringExtension = element.getDeclaringExtension().toString();
- }
- return declaringExtension;
- }
-
- public String getGroupID() {
- return groupID;
- }
-
- IGroupInitializer getInitializerClass() {
- if (groupInterface == null)
- try {
- groupInterface = (IGroupInitializer) element.createExecutableExtension(GROUP_INTIALIZER_CLASS_ATTR);
- } catch (CoreException e) {
- Logger.getLogger().logError(WTPResourceHandler.getString("29", new Object[]{GROUP_INTIALIZER_CLASS_ATTR, getInitalizerClassName(), getDeclaringExtensionName()}) + "\r\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-4$
- Logger.getLogger().logError(e);
- }
- return groupInterface;
- }
-
- public String toString() {
- return "\"" + getName() + "\" (" + getGroupID() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public int getPriority() {
- if (priority == NEGATIVE_PRIORITY)
- priority = Integer.parseInt(element.getAttribute(GROUP_PRIORITY_ATTR));
- return priority;
- }
-
- public boolean isEnabled(IProject project) {
- if (getInitializerClass() != null)
- return getInitializerClass().isGroupEnabled(project);
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object o) {
- if (this.equals(o))
- return 0;
- else if (!(o instanceof FunctionGroup))
- return 1;
-
- FunctionGroup group = (FunctionGroup) o;
- if (getPriority() == group.getPriority())
- return getGroupID().compareTo(group.getGroupID());
-
- else if (getPriority() < group.getPriority())
- return -1;
- else
- return 1;
- }
-
- public boolean isMatch(String string) {
- if (functionGroupPatternBindings == null) {
- if (!errorReported) {
- Logger.getLogger().logError(WTPResourceHandler.getString("30", new Object[]{getGroupID()})); //$NON-NLS-1$
- errorReported = true;
- }
- return false;
- }
- for (Iterator iterator = functionGroupPatternBindings.iterator(); iterator.hasNext();) {
- FunctionGroupPatternBinding functionGroupPatternBinding = (FunctionGroupPatternBinding) iterator.next();
-
- if (functionGroupPatternBinding.getPattern().matcher(string).matches())
- return true;
- }
-
- return false;
- }
-
- boolean setFunctionGroupPatternBindings(Set functionGroupPatternBindings) {
- functionGroupPatternBindings = Util.safeCopy(functionGroupPatternBindings, FunctionGroupPatternBinding.class);
-
- if (!Util.equals(functionGroupPatternBindings, this.functionGroupPatternBindings)) {
- this.functionGroupPatternBindings = functionGroupPatternBindings;
- this.functionGroupPatternBindingsAsArray = (FunctionGroupPatternBinding[]) this.functionGroupPatternBindings.toArray(new FunctionGroupPatternBinding[this.functionGroupPatternBindings.size()]);
-
- return true;
- }
-
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupPatternBinding.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupPatternBinding.java
deleted file mode 100644
index 1d10895..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupPatternBinding.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.regex.Pattern;
-
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class FunctionGroupPatternBinding {
-
- private final static int HASH_FACTOR = 89;
- private final static int HASH_INITIAL = FunctionGroupPatternBinding.class.getName().hashCode();
- private String functionGroupId;
- private transient int hashCode;
- private transient boolean hashCodeComputed;
- private Pattern pattern;
- private transient String string;
-
- /**
- *
- */
- public FunctionGroupPatternBinding(String functionGroupId, Pattern pattern) {
- if (pattern == null)
- throw new NullPointerException();
-
- this.functionGroupId = functionGroupId;
- this.pattern = pattern;
- }
-
- public int compareTo(Object object) {
- FunctionGroupPatternBinding castedObject = (FunctionGroupPatternBinding) object;
- int compareTo = Util.compare(functionGroupId, castedObject.functionGroupId);
-
- if (compareTo == 0)
- compareTo = Util.compare(pattern.pattern(), castedObject.pattern.pattern());
-
- return compareTo;
- }
-
- public boolean equals(Object object) {
- if (!(object instanceof FunctionGroupPatternBinding))
- return false;
-
- FunctionGroupPatternBinding castedObject = (FunctionGroupPatternBinding) object;
- boolean equals = true;
- equals &= Util.equals(functionGroupId, castedObject.functionGroupId);
- equals &= Util.equals(pattern, castedObject.pattern);
- return equals;
- }
-
- public String getActivityId() {
- return functionGroupId;
- }
-
- public Pattern getPattern() {
- return pattern;
- }
-
- public int hashCode() {
- if (!hashCodeComputed) {
- hashCode = HASH_INITIAL;
- hashCode = hashCode * HASH_FACTOR + Util.hashCode(functionGroupId);
- hashCode = hashCode * HASH_FACTOR + Util.hashCode(pattern);
- hashCodeComputed = true;
- }
-
- return hashCode;
- }
-
- public String toString() {
- if (string == null) {
- final StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append('[').append(functionGroupId).append(",pattern=\"").append(pattern.pattern()).append("\"]"); //$NON-NLS-1$ //$NON-NLS-2$
- string = stringBuffer.toString();
- }
-
- return string;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupRegistry.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupRegistry.java
deleted file mode 100644
index e97458e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/FunctionGroupRegistry.java
+++ /dev/null
@@ -1,251 +0,0 @@
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-/*
- * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001, 2002 - All
- * Rights Reserved. US Government Users Restricted Rights - Use, duplication or
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-import com.ibm.wtp.common.RegistryReader;
-import com.ibm.wtp.common.logger.proxy.Logger;
-
-/**
- * The FunctionGroupRegistry will consume Configuration elements conforming to the FunctionGroup
- * Extension Point schema.
- *
- * @author mdelder/blancett
- */
-public class FunctionGroupRegistry extends RegistryReader {
-
- private static FunctionGroupRegistry INSTANCE = null;
-
- public static final String GROUP_ELEMENT = "functionGroup"; //$NON-NLS-1$
- public static final String GROUP_ID_ATTR = "functionGroupID"; //$NON-NLS-1$
- public static final String FUNCTION_GROUP_PATTERN_BINDING_ELMT = "functionGroupPatternBinding"; //$NON-NLS-1$
- public static final String PATTERN_ATTR = "pattern"; //$NON-NLS-1$
-
- private Map groupMapById;
- private List knownGroups;
- private Map patternBindingsByGroupId;
-
- private FunctionGroupRegistry() {
- super(WTPCommonPlugin.PLUGIN_ID, WTPCommonPlugin.GROUP_REGISTRY_EXTENSION_POINT);
- patternBindingsByGroupId = new HashMap();
-
- }
-
- public static FunctionGroupRegistry getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new FunctionGroupRegistry();
- INSTANCE.readRegistry();
- }
- return INSTANCE;
- }
-
- /*
- * (non-Javadoc) Read all the elements first, then set the pattern bindings on the function
- * groups
- */
- public void readRegistry() {
- super.readRegistry();
- setPatternBindings();
- }
-
- private void setPatternBindings() {
- Iterator iter = patternBindingsByGroupId.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Entry) iter.next();
- String groupId = (String) entry.getKey();
- Set value = (Set) entry.getValue();
- FunctionGroup aGroup = getGroupByID(groupId);
- if (aGroup != null)
- aGroup.setFunctionGroupPatternBindings(value);
- }
-
- }
-
- public boolean readElement(IConfigurationElement element) {
- if (element.getName().equals(GROUP_ELEMENT)) {
- readGroup(element);
- return true;
- } else if (element.getName().equals(FUNCTION_GROUP_PATTERN_BINDING_ELMT)) {
- readPatternBinding(element);
- return true;
- }
- return false;
- }
-
- /**
- * @param element
- */
- private void readPatternBinding(IConfigurationElement element) {
- String groupID = element.getAttribute(GROUP_ID_ATTR);
- String pattern = element.getAttribute(PATTERN_ATTR);
- if (!isNullOrEmpty(groupID) && !isNullOrEmpty(pattern)) {
- Pattern aPattern = Pattern.compile(pattern);
- FunctionGroupPatternBinding binding = new FunctionGroupPatternBinding(groupID, aPattern);
- addPatternBinding(groupID, binding);
- }
-
- }
-
- /**
- * @param binding
- */
- private void addPatternBinding(String groupID, FunctionGroupPatternBinding binding) {
- Set bindings = (Set) patternBindingsByGroupId.get(groupID);
- if (bindings == null) {
- bindings = new HashSet();
- patternBindingsByGroupId.put(groupID, bindings);
- }
- bindings.add(binding);
- }
-
- private boolean isNullOrEmpty(String aString) {
- return aString == null || aString.length() == 0;
- }
-
- private void readGroup(IConfigurationElement element) {
- String groupID = element.getAttribute(GROUP_ID_ATTR);
- if (!isNullOrEmpty(groupID)) {
- FunctionGroup group = new FunctionGroup(groupID, element);
- getGroupMapById().put(groupID, group);
- getKnownGroups().add(group);
- }
- }
-
- private List getAscendingSortedGroups(IProject project) {
- Comparator ascendingGrpComparator = AscendingGroupComparator.singleton();
- List groupList = getKnownGroups(project);
- Collections.sort(groupList, ascendingGrpComparator);
- return groupList;
- }
-
- private List getDescendingSortedGroups(IProject project) {
- Comparator descendingGrpComparator = DescendingGroupComparator.singleton();
- List groupList = getKnownGroups(project);
- Collections.sort(groupList, descendingGrpComparator);
- return groupList;
- }
-
- public List getKnownGroups(IProject project) {
- ArrayList groupByProjectList = new ArrayList(getKnownGroups().size());
- List groupList = getKnownGroups();
- for (int i = 0; i < groupList.size(); i++) {
- FunctionGroup group = (FunctionGroup) groupList.get(i);
- if (group.isEnabled(project))
- groupByProjectList.add(group);
- }
- return groupByProjectList;
- }
-
- public List getAscendingPriorityGroupNames(IProject project) {
- List sortedGroup = getAscendingSortedGroups(project);
- return getGroupListNames(sortedGroup, new ArrayList(sortedGroup.size()));
-
- }
-
- public List getDescendingPriorityGroupNames(IProject project) {
- List sortedGroup = getDescendingSortedGroups(project);
- return getGroupListNames(sortedGroup, new ArrayList(sortedGroup.size()));
- }
-
- private List getGroupListNames(List sortedGroup, List sortedGroupNames) {
- for (int i = 0; i < sortedGroup.size(); i++) {
- FunctionGroup grp = (FunctionGroup) sortedGroup.get(i);
- sortedGroupNames.add(grp.getGroupID());
- }
- return sortedGroupNames;
- }
-
- public Iterator getGroupIDs() {
- return getGroupMapById().keySet().iterator();
- }
-
- public FunctionGroup getGroupByID(String groupID) {
- return (FunctionGroup) getGroupMapById().get(groupID);
- }
-
- public boolean isGroupEnabled(IProject project, String groupID) {
- FunctionGroup group = getGroupByID(groupID);
- if (group != null)
- return group.isEnabled(project);
- return false;
- }
-
- public List getKnownGroups() {
- if (knownGroups == null)
- knownGroups = new ArrayList();
- return knownGroups;
- }
-
- /**
- * @return Returns the groupMapById.
- */
- protected Map getGroupMapById() {
- if (groupMapById == null)
- groupMapById = new HashMap();
- return groupMapById;
- }
-
- /**
- * Check the priority of the two groups referenced by
- *
- * @groupID1 and
- * @groupID2
- *
- * @param groupID1
- * @param groupID2
- * @return 0 if the two groups are equal, 1 if
- * @groupID1 has a higher precedence, otherwise -1
- */
- public int compare(String groupID1, String groupID2) {
- FunctionGroup group1 = getGroupByID(groupID1);
- FunctionGroup group2 = getGroupByID(groupID2);
- if (group1 == null) {
- Logger.getLogger().logError(new IllegalArgumentException(WTPResourceHandler.getString("28", new Object[]{groupID1}))); //$NON-NLS-1$
- return -1;
- }
- if (group2 == null) {
- Logger.getLogger().logError(new IllegalArgumentException(WTPResourceHandler.getString("28", new Object[]{groupID2}))); //$NON-NLS-1$
- return 1;
- }
-
- return group1.compareTo(group2);
- }
-
- public int getGroupPriority(String grpId) {
- FunctionGroup group = getGroupByID(grpId);
- return (group != null) ? group.getPriority() : -1;
- }
-
- public int getFunctionPriority(String enablementID) {
- int priority = Integer.MAX_VALUE;
- Iterator iter = getKnownGroups().iterator();
- while (iter.hasNext()) {
- FunctionGroup group = (FunctionGroup) iter.next();
- if (group.isMatch(enablementID))
- priority = Math.min(priority, group.getPriority());
- }
- return priority;
-
- }
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifier.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifier.java
deleted file mode 100644
index 101a5cf..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifier.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Set;
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public interface IEnablementIdentifier {
-
-
- /**
- * Registers an instance of <code>IIdentifierListener</code> to listen for changes to
- * properties of this instance.
- *
- * @param identifierListener
- * the instance to register. Must not be <code>null</code>. If an attempt is made
- * to register an instance which is already registered with this instance, no
- * operation is performed.
- */
- void addIdentifierListener(IEnablementIdentifierListener identifierListener);
-
- /**
- * Returns the set of function group ids that this instance matches.
- * <p>
- * Notification is sent to all registered listeners if this property changes.
- * </p>
- *
- * @return the set of activity ids that this instance matches. This set may be empty, but is
- * guaranteed not to be <code>null</code>. If this set is not empty, it is guaranteed
- * to only contain instances of <code>String</code>.
- */
- Set getFunctionGroupIds();
-
- /**
- * Returns the identifier of this instance.
- *
- * @return the identifier of this instance. Guaranteed not to be <code>null</code>.
- */
- String getId();
-
- /**
- * Returns whether or not this instance is enabled.
- * <p>
- * Notification is sent to all registered listeners if this property changes.
- * </p>
- *
- * @return true, iff this instance is enabled.
- */
- boolean isEnabled();
-
- /**
- * Unregisters an instance of <code>IEnablementIdentifierListener</code> listening for changes
- * to properties of this instance.
- *
- * @param identifierListener
- * the instance to unregister. Must not be <code>null</code>. If an attempt is
- * made to unregister an instance which is not already registered with this instance,
- * no operation is performed.
- */
- void removeIdentifierListener(IEnablementIdentifierListener identifierListener);
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifierListener.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifierListener.java
deleted file mode 100644
index 38a617b..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementIdentifierListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public interface IEnablementIdentifierListener {
- /**
- * Notifies that one or more properties of an instance of <code>IIdentifier</code> have
- * changed. Specific details are described in the <code>IdentifierEvent</code>.
- *
- * @param identifierEvent
- * the identifier event. Guaranteed not to be <code>null</code>.
- */
- void identifierChanged(EnablementIdentifierEvent identifierEvent);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementManager.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementManager.java
deleted file mode 100644
index 24b1736..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IEnablementManager.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 12, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-
-import com.ibm.wtp.common.UIContextDetermination;
-
-/**
- * @author schacher
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public interface IEnablementManager {
- String INTERNAL_ENABLEMENT_DETERMINATION_ID = "org.eclipse.wst.common.frameworks.internal.EnablementDetermination"; //$NON-NLS-1$
-
- IEnablementManager INSTANCE = (IEnablementManager) UIContextDetermination.createInstance(INTERNAL_ENABLEMENT_DETERMINATION_ID);
-
- IEnablementIdentifier getIdentifier(String identifierId, IProject project);
-
- /**
- * Notify all identifier listeners that the state of a project has changed that affects the
- * enablement of a group for a project. This method is fail safe, in that if one listener throws
- * an exception while being notified, it will not stop the notification of other listeners.
- *
- * @param evt
- * @throws CoreException
- * if exceptions were caught notifying any of the listeners. Check the status of the
- * core exception for the nested exceptions.
- */
- void notifyFunctionGroupChanged(String groupID, IProject project) throws CoreException;
-
- /**
- * Utility method for clients to dispose of listeners
- *
- * @param enablementIdentifiers
- * @param listener
- */
- void removeEnablementIdentifierListener(Collection enablementIdentifiers, IEnablementIdentifierListener listener);
-
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IGroupInitializer.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IGroupInitializer.java
deleted file mode 100644
index fd2884d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IGroupInitializer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * @author blancett
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public interface IGroupInitializer {
-
- public boolean isGroupEnabled(IProject project);
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Identifiable.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Identifiable.java
deleted file mode 100644
index c529b05..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Identifiable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-
-/**
- * @author mdelder
- *
- */
-public interface Identifiable {
-
- /**
- * return id that uniquely identifies this instance of an extension point. It is up to each
- * individual extension point provider to decide what that might be (e.g., "editorID", "pageID",
- * etc.
- */
- String getID();
-
- /**
- *
- * @return the order the Identifiable element was loaded
- */
- int getLoadOrder();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IdentifiableComparator.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IdentifiableComparator.java
deleted file mode 100644
index f0673a9..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/IdentifiableComparator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-
-/**
- * @author mdelder
- *
- */
-public class IdentifiableComparator implements java.util.Comparator {
-
- protected static final int GREATER_THAN = 1;
-
- protected static final int LESS_THAN = -1;
-
- protected static final int EQUAL = 0;
-
- protected static final IdentifiableComparator instance = new IdentifiableComparator();
-
- private static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
-
- public static IdentifiableComparator getInstance() {
- return instance;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- Identifiable lvalue = null;
- Identifiable rvalue = null;
- if (o1 instanceof Identifiable)
- lvalue = (Identifiable) o1;
- if (o2 instanceof Identifiable)
- rvalue = (Identifiable) o2;
-
- if (rvalue == null)
- return GREATER_THAN;
- if (lvalue == null)
- return LESS_THAN;
-
- if ((lvalue.getID() == null && rvalue.getID() == null) || (getPriority(lvalue) == getPriority(rvalue)))
- return compareLoadOrder(lvalue, rvalue);
- /* R - L implies 0 is the highest priority */
- return getPriority(lvalue) - getPriority(rvalue);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.Comparator#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return obj instanceof IdentifiableComparator;
- }
-
- private int compareLoadOrder(Identifiable lvalue, Identifiable rvalue) {
- /* R - L implies 0 is the highest priority */
- return lvalue.getLoadOrder() - rvalue.getLoadOrder();
- }
-
- public int getPriority(Identifiable identifiable) {
- if (identifiable.getID() != null && identifiable.getID().length() > 0)
- return FunctionGroupRegistry.getInstance().getFunctionPriority(identifiable.getID());
- return DEFAULT_PRIORITY;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Util.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Util.java
deleted file mode 100644
index 709d9ab..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/enablement/Util.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. 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: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclispe.wst.common.frameworks.internal.enablement;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.SortedSet;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/*
- * Rename this class to EnablementsUtil
- */
-
-public final class Util {
- public final static SortedMap EMPTY_SORTED_MAP = Collections.unmodifiableSortedMap(new TreeMap());
- public final static SortedSet EMPTY_SORTED_SET = Collections.unmodifiableSortedSet(new TreeSet());
- public final static String ZERO_LENGTH_STRING = ""; //$NON-NLS-1$
-
- public static void assertInstance(Object object, Class c) {
- assertInstance(object, c, false);
- }
-
- public static void assertInstance(Object object, Class c, boolean allowNull) {
- if (object == null && allowNull)
- return;
-
- if (object == null || c == null)
- throw new NullPointerException();
- else if (!c.isInstance(object))
- throw new IllegalArgumentException();
- }
-
- public static int compare(boolean left, boolean right) {
- return left == false ? (right == true ? -1 : 0) : 1;
- }
-
- public static int compare(Comparable left, Comparable right) {
- if (left == null && right == null)
- return 0;
- else if (left == null)
- return -1;
- else if (right == null)
- return 1;
- else
- return left.compareTo(right);
- }
-
- public static int compare(Comparable[] left, Comparable[] right) {
- if (left == null && right == null)
- return 0;
- else if (left == null)
- return -1;
- else if (right == null)
- return 1;
- else {
- int l = left.length;
- int r = right.length;
-
- if (l != r)
- return l - r;
- for (int i = 0; i < l; i++) {
- int compareTo = compare(left[i], right[i]);
-
- if (compareTo != 0)
- return compareTo;
- }
- return 0;
- }
- }
-
- public static int compare(int left, int right) {
- return left - right;
- }
-
- public static int compare(List left, List right) {
- if (left == null && right == null)
- return 0;
- else if (left == null)
- return -1;
- else if (right == null)
- return 1;
- else {
- int l = left.size();
- int r = right.size();
-
- if (l != r)
- return l - r;
- for (int i = 0; i < l; i++) {
- int compareTo = compare((Comparable) left.get(i), (Comparable) right.get(i));
-
- if (compareTo != 0)
- return compareTo;
- }
- return 0;
- }
- }
-
- public static void diff(Map left, Map right, Set leftOnly, Set different, Set rightOnly) {
- if (left == null || right == null || leftOnly == null || different == null || rightOnly == null)
- throw new NullPointerException();
-
- Iterator iterator = left.keySet().iterator();
-
- while (iterator.hasNext()) {
- Object key = iterator.next();
-
- if (!right.containsKey(key))
- leftOnly.add(key);
- else if (!Util.equals(left.get(key), right.get(key)))
- different.add(key);
- }
-
- iterator = right.keySet().iterator();
-
- while (iterator.hasNext()) {
- Object key = iterator.next();
-
- if (!left.containsKey(key))
- rightOnly.add(key);
- }
- }
-
- public static void diff(Set left, Set right, Set leftOnly, Set rightOnly) {
- if (left == null || right == null || leftOnly == null || rightOnly == null)
- throw new NullPointerException();
-
- Iterator iterator = left.iterator();
-
- while (iterator.hasNext()) {
- Object object = iterator.next();
-
- if (!right.contains(object))
- leftOnly.add(object);
- }
-
- iterator = right.iterator();
-
- while (iterator.hasNext()) {
- Object object = iterator.next();
-
- if (!left.contains(object))
- rightOnly.add(object);
- }
- }
-
- public static boolean endsWith(List left, List right, boolean equals) {
- if (left == null || right == null)
- return false;
- int l = left.size();
- int r = right.size();
- if (r > l || !equals && r == l)
- return false;
-
- for (int i = 0; i < r; i++)
- if (!equals(left.get(l - i - 1), right.get(r - i - 1)))
- return false;
- return true;
- }
-
- public static boolean endsWith(Object[] left, Object[] right, boolean equals) {
- if (left == null || right == null)
- return false;
- int l = left.length;
- int r = right.length;
- if (r > l || !equals && r == l)
- return false;
- for (int i = 0; i < r; i++)
- if (!equals(left[l - i - 1], right[r - i - 1]))
- return false;
- return true;
- }
-
- public static boolean equals(boolean left, boolean right) {
- return left == right;
- }
-
- public static boolean equals(int left, int right) {
- return left == right;
- }
-
- public static boolean equals(Object left, Object right) {
- return left == null ? right == null : left.equals(right);
- }
-
- public static int hashCode(boolean b) {
- return b ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode();
- }
-
- public static int hashCode(int i) {
- return i;
- }
-
- public static int hashCode(Object object) {
- return object != null ? object.hashCode() : 0;
- }
-
- public static List safeCopy(List list, Class c) {
- return safeCopy(list, c, false);
- }
-
- public static List safeCopy(List list, Class c, boolean allowNullElements) {
- if (list == null || c == null)
- throw new NullPointerException();
-
- list = Collections.unmodifiableList(new ArrayList(list));
- Iterator iterator = list.iterator();
-
- while (iterator.hasNext())
- assertInstance(iterator.next(), c, allowNullElements);
-
- return list;
- }
-
- public static Map safeCopy(Map map, Class keyClass, Class valueClass) {
- return safeCopy(map, keyClass, valueClass, false, false);
- }
-
- public static Map safeCopy(Map map, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) {
- if (map == null || keyClass == null || valueClass == null)
- throw new NullPointerException();
-
- map = Collections.unmodifiableMap(new HashMap(map));
- Iterator iterator = map.entrySet().iterator();
-
- while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry) iterator.next();
- assertInstance(entry.getKey(), keyClass, allowNullKeys);
- assertInstance(entry.getValue(), valueClass, allowNullValues);
- }
-
- return map;
- }
-
- public static Set safeCopy(Set set, Class c) {
- return safeCopy(set, c, false);
- }
-
- public static Set safeCopy(Set set, Class c, boolean allowNullElements) {
- if (set == null || c == null)
- throw new NullPointerException();
-
- set = Collections.unmodifiableSet(new HashSet(set));
- Iterator iterator = set.iterator();
-
- while (iterator.hasNext())
- assertInstance(iterator.next(), c, allowNullElements);
-
- return set;
- }
-
- public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass) {
- return safeCopy(sortedMap, keyClass, valueClass, false, false);
- }
-
- public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) {
- if (sortedMap == null || keyClass == null || valueClass == null)
- throw new NullPointerException();
-
- sortedMap = Collections.unmodifiableSortedMap(new TreeMap(sortedMap));
- Iterator iterator = sortedMap.entrySet().iterator();
-
- while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry) iterator.next();
- assertInstance(entry.getKey(), keyClass, allowNullKeys);
- assertInstance(entry.getValue(), valueClass, allowNullValues);
- }
-
- return sortedMap;
- }
-
- public static SortedSet safeCopy(SortedSet sortedSet, Class c) {
- return safeCopy(sortedSet, c, false);
- }
-
- public static SortedSet safeCopy(SortedSet sortedSet, Class c, boolean allowNullElements) {
- if (sortedSet == null || c == null)
- throw new NullPointerException();
-
- sortedSet = Collections.unmodifiableSortedSet(new TreeSet(sortedSet));
- Iterator iterator = sortedSet.iterator();
-
- while (iterator.hasNext())
- assertInstance(iterator.next(), c, allowNullElements);
-
- return sortedSet;
- }
-
- public static boolean startsWith(List left, List right, boolean equals) {
- if (left == null || right == null)
- return false;
- int l = left.size();
- int r = right.size();
- if (r > l || !equals && r == l)
- return false;
- for (int i = 0; i < r; i++)
- if (!equals(left.get(i), right.get(i)))
- return false;
- return true;
- }
-
- public static boolean startsWith(Object[] left, Object[] right, boolean equals) {
- if (left == null || right == null)
- return false;
- int l = left.length;
- int r = right.length;
- if (r > l || !equals && r == l)
- return false;
-
- for (int i = 0; i < r; i++)
- if (!equals(left[i], right[i]))
- return false;
- return true;
- }
-
- public static String translateString(ResourceBundle resourceBundle, String key) {
- return Util.translateString(resourceBundle, key, key, true, true);
- }
-
- public static String translateString(ResourceBundle resourceBundle, String key, String string, boolean signal, boolean trim) {
- if (resourceBundle != null && key != null)
- try {
- final String translatedString = resourceBundle.getString(key);
-
- if (translatedString != null)
- return trim ? translatedString.trim() : translatedString;
- } catch (MissingResourceException eMissingResource) {
- if (signal)
- System.err.println(eMissingResource);
- }
-
- return trim ? string.trim() : string;
- }
-
- private Util() {
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonMessages.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonMessages.java
deleted file mode 100644
index 03cb432..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonMessages.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 5, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.plugin;
-
-/**
- * @author DABERG
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class WTPCommonMessages {
- public static final String PROJECT_EXISTS_ERROR = "1"; //$NON-NLS-1$
- public static final String PROJECT_NOT_EAR = "2"; //$NON-NLS-1$
- public static final String INCOMPATABLE_J2EE_VERSIONS = "3"; //$NON-NLS-1$
- public static final String SAME_MODULE_AND_EAR_NAME = "4"; //$NON-NLS-1$
- public static final String ARCHIVE_FILE_NAME_EMPTY_ERROR = "5"; //$NON-NLS-1$
- public static final String FILE_DOES_NOT_EXIST_ERROR = "6"; //$NON-NLS-1$
- public static final String INTERNAL_ERROR = "7"; //$NON-NLS-1$
- public static final String PROJECT_NAME_INVALID = "8"; //$NON-NLS-1$
- public static final String DESTINATION_ARCHIVE_SHOULD_END_WITH = "9"; //$NON-NLS-1$
- public static final String DESTINATION_INVALID = "10"; //$NON-NLS-1$
- public static final String IS_READ_ONLY = "11"; //$NON-NLS-1$
- public static final String RESOURCE_EXISTS_ERROR = "12"; //$NON-NLS-1$
- public static final String PROJECT_NOT_EXISTS_ERROR = "13"; //$NON-NLS-1$
- public static final String J2EE_SPEC_LEVEL_NOT_FOUND = "14"; //$NON-NLS-1$
- public static final String PROJECT_NAME_EMPTY = "15"; //$NON-NLS-1$
- public static final String PROJECT_ClOSED = "31"; //$NON-NLS-1$
- public static final String PROJECT_EXISTS_AT_LOCATION_ERROR = "32"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonPlugin.java b/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonPlugin.java
deleted file mode 100644
index b0c092d..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/org/eclispe/wst/common/frameworks/internal/plugin/WTPCommonPlugin.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 29, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclispe.wst.common.frameworks.internal.plugin;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.internal.WTPPlugin;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class WTPCommonPlugin extends WTPPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.wst.common.frameworks"; //$NON-NLS-1$
- public static final String GROUP_REGISTRY_EXTENSION_POINT = "functionGroup"; //$NON-NLS-1$
- public static final IStatus OK_STATUS = new Status(IStatus.OK, PLUGIN_ID, 0, "OK", null); //$NON-NLS-1$
-
- // The shared instance.
- private static WTPCommonPlugin plugin;
-
- // Resource bundle.
- private ResourceBundle resourceBundle;
-
- public WTPCommonPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("wtp_common"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- public static WTPCommonPlugin getDefault() {
- return plugin;
- }
-
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createErrorStatus(String message) {
- return createErrorStatus(message, null);
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createWarningStatus(String message) {
- return createWarningStatus(message, null);
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createWarningStatus(String message, Throwable exception) {
- return new Status(IStatus.WARNING, PLUGIN_ID, -1, message, exception);
- }
-
- /**
- * @param string
- * @return
- */
- public static IStatus createErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, PLUGIN_ID, -1, message, exception);
- }
-
- /**
- * Returns the string from the plugin's resource bundle, or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = WTPCommonPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null ? bundle.getString(key) : key);
- } catch (MissingResourceException e) {
- return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public static String getResourceString(String key, Object[] args) {
- String pattern = getResourceString(key);
- if (pattern != null)
- return MessageFormat.format(pattern, args);
- return null;
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.WTPPlugin#getPluginID()
- */
- public String getPluginID() {
- return PLUGIN_ID;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common.properties
deleted file mode 100644
index 5dd688a..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=A project already exists with this name and location.
-2=The specified EAR project "{0}" is not an EAR project.
-3=The EAR project "{0}" has a J2EEVersion of {1} which is not compatable with the specified module version.
-4=The EAR project name, "{0}", can not be the same as the project name.
-5={0} file name must be entered.
-6=The {0} does not exist.
-7=An internal error occurred. View log files for details.
-8=Project name is invalid.
-9=Destination archive should end with {0}.
-10=Destination archive is invalid.
-11=Destination location is read only.
-12=Resource {0} already exists. If you wish to overwrite select the "Overwrite Existing file" option.
-13=Project {0} does not exist.
-14=Connector project is not supported for selected J2EE preference. Check the global J2EE preference.
-15=Enter a project name.
-16=Save problems
-17=Save could not be completed. Some related files may have already been saved.\n\nReason
-18={0} has been locked. Please ensure the operation is not currently executing.
-19=The extendedRoot is null. Make sure that isExtended() returns true.
-20=Property not located:
-21=Nested model not located:
-22=Cannot modify id once it has been set.
-23=The id cannot be null.
-24=ERROR:
-25=Extended Operation failure: {0}
-26=The Job completed successfully
-27=Exception occurred running job.
-28=Group cannot be resolved:
-29=Class not found for attribute {0} : {1}, Declaring plugin extension: {2}
-30=Function group {0} contains no pattern bindings
-31=Project {0} is closed.
-32=A project already exists on the file system at this location: {0}. Either use "Import Existing Projects into Workspace" to create a project at this location or delete the contents of {0} from the file system.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_de.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_de.properties
deleted file mode 100644
index 49572af..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_de.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=Ein Projekt mit diesem Namen und dieser Position ist bereits vorhanden.
-2=Das angegebene Projekt "{0}" ist kein EAR-Projekt.
-3=Das EAR-Projekt "{0}" hat die J2EEVersion {1}, die nicht mit der angegebenen Version des Moduls kompatibel ist.
-4=Der Name des EAR-Projekts, "{0}", darf nicht mit dem Projektnamen identisch sein.
-5={0} Dateiname muss eingegeben werden.
-6={0} ist nicht vorhanden.
-7=Ein interner Fehler ist aufgetreten. Weitere Details finden Sie in den Protokolldateien.
-8=Der Projektname ist ung\u00fcltig.
-9=Zielarchiv sollte auf {0} enden.
-10=Zielarchiv ist ung\u00fcltig.
-11=Zielposition ist schreibgesch\u00fctzt.
-12=Die Ressource {0} ist bereits vorhanden. Wenn Sie sie \u00fcberschreiben wollen, w\u00e4hlen Sie die Option "Vorhandene Datei \u00fcberschreiben" aus.
-13=Projekt {0} ist nicht vorhanden.
-14=Connectorprojekt wird f\u00fcr die ausgew\u00e4hlte J2EE-Benutzervorgabe nicht unterst\u00fctzt. \u00dcberpr\u00fcfen Sie die globale J2EE-Einstellung.
-15=Geben Sie einen Projektnamen ein.
-16=Fehler beim Speichern
-17=Der Speichervorgang konnte nicht abgeschlossen werden. M\u00f6glicherweise wurden bereits einige zugeh\u00f6rige Dateien gespeichert.\n\nUrsache
-18={0} wurde gesperrt. Bitte stellen Sie sicher, dass die Operation zurzeit nicht ausgef\u00fchrt wird.
-19=extendedRoot ist Null. Stellen Sie sicher, dass isExtended() "true" zur\u00fcckgibt.
-20=Eigenschaft nicht gefunden:
-21=Verschachteltes Modell nicht gefunden:
-22=ID kann nach dem Festlegen nicht mehr ge\u00e4ndert werden.
-23=Die ID darf nicht Null sein.
-24=FEHLER:
-25=Erweiterte Operation ist fehlgeschlagen: {0}
-26=Der Job wurde erfolgreich beendet.
-27=Beim Ausf\u00fchren des Jobs ist eine Ausnahmebedingung aufgetreten.
-28=Gruppe kann nicht aufgel\u00f6st werden:
-29=Klasse nicht gefunden f\u00fcr Attribut {0} : {1}, Plug-in-Erweiterung wird deklariert: {2}
-30=Funktionsgruppe {0} enth\u00e4lt keine Musterbindings.
-31=Das Projekt {0} ist geschlossen.
-32=Im Dateisystem besteht bereits ein Projekt an dieser Position: {0}. Verwenden Sie entweder "Bestehende Projekte in den Arbeitsbereich importieren", um ein Projekt an dieser Stelle zu erstellen, oder l\u00f6schen Sie den Inhalt von{0} im Dateisystem.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_es.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_es.properties
deleted file mode 100644
index 1fda654..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_es.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=Ya existe un proyecto con este nombre y ubicaci\u00f3n.
-2=El proyecto EAR especificado "{0}" no es un proyecto EAR.
-3=El proyecto EAR "{0}" tiene una J2EEVersion de {1} que no es compatible con la versi\u00f3n del m\u00f3dulo especificado.
-4=El nombre de proyecto EAR, "{0}", no puede ser igual que el nombre del proyecto.
-5=Debe especificarse el nombre del archivo {0}.
-6={0} no existe.
-7=Se ha producido un error interno. Vea los archivos de anotaciones para conocer los detalles.
-8=El nombre del proyecto no es v\u00e1lido.
-9=El archivador de destino debe finalizar con {0}.
-10=El archivador de destino no es v\u00e1lido.
-11=La ubicaci\u00f3n de destino es solo de lectura.
-12=El recurso {0} ya existe. Si desea sobrescribir, seleccione la opci\u00f3n "Sobrescribir archivo existente".
-13=El proyecto {0} no existe.
-14=El proyecto de conector no est\u00e1 soportado para la preferencia J2EE seleccionada. Compruebe la preferencia J2EE global.
-15=Especifique un nombre de proyecto.
-16=Problemas de operaci\u00f3n de guardar
-17=La operaci\u00f3n de guardar no ha podido realizarse. Puede que algunos archivos relacionados ya se hayan guardado.\n\nRaz\u00f3n
-18={0} se ha bloqueado. Aseg\u00farese de que la operaci\u00f3n no se est\u00e1 ejecutando actualmente.
-19=extendedRoot es nulo. Aseg\u00farese de que isExtended() devuelve true.
-20=No se ha ubicado la propiedad:
-21=No se ha ubicado el modelo anidado:
-22=No se puede modificar el ID una vez establecido.
-23=El ID no puede ser nulo.
-24=ERROR:
-25=Anomal\u00eda de operaci\u00f3n ampliada: {0}
-26=El trabajo se ha realizado satisfactoriamente
-27=Se ha producido una excepci\u00f3n al ejecutar el trabajo.
-28=No se ha podido resolver el grupo:
-29=No se ha encontrado la clase para el atributo {0} : {1}, declarando extensi\u00f3n de conector: {2}
-30=El grupo de funciones {0} no contiene enlaces de patr\u00f3n
-31=El proyecto {0} est\u00e1 cerrado.
-32=Ya existe un proyecto en la siguiente ubicaci\u00f3n del sistema de archivos: {0}. Puede utilizar "Importar proyectos existentes en el espacio de trabajo" para crear el proyecto en esta ubicaci\u00f3n o suprimir el contenido en el sistema de archivos de {0}.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_fr.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_fr.properties
deleted file mode 100644
index faff472..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_fr.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=Il existe d\u00e9j\u00e0 un projet avec ce nom et cet emplacement.
-2=Le projet EAR "{0}" sp\u00e9cifi\u00e9 ne correspond pas \u00e0 un projet EAR.
-3=La version J2EE du projet EAR "{0}" est {1} ; cette version n''est pas compatible avec la version de module sp\u00e9cifi\u00e9e.
-4=Le nom de projet EAR "{0}" ne peut pas \u00eatre identique au nom du projet.
-5=Vous devez entrer le nom de fichier {0}.
-6={0} n''existe pas.
-7=Une erreur interne s'est produite. Consultez les fichiers journaux pour plus de d\u00e9tails.
-8=Nom de projet non valide.
-9=L''archive de destination doit se terminer par {0}.
-10=Archive de destination non valide.
-11=Emplacement de destination en lecture seule.
-12=La ressource {0} existe d\u00e9j\u00e0. Pour la remplacer, s\u00e9lectionnez l'option "Remplacer le fichier existant".
-13=Projet {0} inexistant.
-14=Le projet de connecteur n'est pas pris en charge pour la pr\u00e9f\u00e9rence J2EE s\u00e9lectionn\u00e9e. V\u00e9rifiez la pr\u00e9f\u00e9rence J2EE globale.
-15=Entrez un nom de projet.
-16=Erreurs de sauvegarde
-17=La sauvegarde n'a pas pu \u00eatre effectu\u00e9e. Certains fichiers associ\u00e9s ont peut-\u00eatre \u00e9t\u00e9 d\u00e9j\u00e0 sauvegard\u00e9s.\n\nMotif
-18={0} a \u00e9t\u00e9 verrouill\u00e9. V\u00e9rifiez que l''op\u00e9ration n''est pas en cours d''ex\u00e9cution.
-19=ExtendedRoot est NULL. V\u00e9rifiez que l'indicateur isExtended() renvoie la valeur true.
-20=Propri\u00e9t\u00e9 introuvable :
-21=Mod\u00e8le imbriqu\u00e9 introuvable :
-22=Impossible de modifier l'ID une fois qu'il a \u00e9t\u00e9 d\u00e9fini.
-23=L'ID ne pas \u00eatre NULL
-24=ERREUR :
-25=Echec de l''op\u00e9ration \u00e9tendue : {0}
-26=Travail termin\u00e9
-27=Exception lors de l'ex\u00e9cution du travail.
-28=Le groupe ne peut pas \u00eatre r\u00e9solu :
-29=Classe introuvable pour l''attribut {0} : {1}, D\u00e9claration de l''extension du plug-in : {2}
-30=Le groupe de fonctions {0} ne contient pas de liaisons de mod\u00e8le
-31=Le projet {0} est ferm\u00e9.
-32=Un projet existe d\u00e9j\u00e0 dans le syst\u00e8me de fichiers \u00e0 l''emplacement : {0}. Utilisez l''option d''importation des projets existants dans l''espace de travail pour cr\u00e9er un projet \u00e0 cet emplacement ou supprimez le contenu de {0} du syst\u00e8me de fichiers.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_it.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_it.properties
deleted file mode 100644
index ddffb67..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_it.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=Un progetto con questo nome e questo percorso esiste gi\u00e0.
-2=Il progetto EAR specificato "{0}" non \u00e8 un progetto EAR.
-3=Il progetto EAR "{0}" dispone di una versione J2EE di {1} non compatibile con la versione del modulo specificata.
-4=Il nome del progetto EAR, "{0}", non pu\u00f2 essere uguale al nome del progetto.
-5=\u00c8 necessario immettere il nome file {0}.
-6={0} non esiste.
-7=Si \u00e8 verificato un errore interno. Per i dettagli, fare riferimento ai file di log.
-8=Il nome del progetto non \u00e8 valido.
-9=L''archivio di destinazione deve terminare con {0}.
-10=L'archivio di destinazione non \u00e8 valido.
-11=Il percorso di destinazione \u00e8 di sola lettura.
-12=La risorsa {0} esiste gi\u00e0. Per sovrascriverla, selezionare l''opzione "Sovrascrivi file esistente".
-13=Il progetto {0} non esiste.
-14=Il progetto del connettore non \u00e8 supportato per la preferenza J2EE selezionata. Verificare la preferenza J2EE globale.
-15=Immettere un nome per il progetto.
-16=Problemi di salvataggio
-17=Impossibile completare il salvataggio. Alcuni file correlati potrebbero gi\u00e0 essere stati salvati.\n\nMotivo
-18={0} \u00e8 stato bloccato. Assicurarsi che l''operazione non sia attualmente in esecuzione.
-19=extendedRoot \u00e8 null. Verificare che isExtended() restituisca true.
-20=Propriet\u00e0 non individuata:
-21=Modello nidificato non individuato:
-22=Impossibile modificare l'id una volta impostato.
-23=L'id non pu\u00f2 essere null.
-24=ERRORE:
-25=Errore di operazione estesa: {0}
-26=Lavoro completato correttamente
-27=Si \u00e8 verificata un'eccezione durante l'esecuzione del lavoro.
-28=Impossibile risolvere il gruppo:
-29=Classe non trovata per l''attributo {0} : {1}, Dichiarazione estensione plugin: {2}
-30=Il gruppo di funzioni {0} non contiene binding di modello
-31=Il progetto {0} \u00e8 chiuso.
-32=Un progetto esiste gi\u00e0 nel file system in: {0}. Utilizzare "Importazione progetti esistenti nello spazio di lavoro" per creare un progetto in tale ubicazione oppure eliminare il contenuto di {0} dal file system.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ja.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ja.properties
deleted file mode 100644
index 637760e..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ja.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=\u3053\u306e\u540d\u524d\u304a\u3088\u3073\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3059\u3067\u306b\u5b58\u5728\u3057\u307e\u3059\u3002
-2=\u6307\u5b9a\u3057\u305f EAR \u30d7\u30ed\u30b8\u30a7\u30af\u30c8 "{0}" \u306f EAR \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
-3=EAR \u30d7\u30ed\u30b8\u30a7\u30af\u30c8 "{0}" \u306f\u3001\u6307\u5b9a\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u306e\u4e92\u63db\u6027\u304c\u306a\u3044 J2EE \u306e\u30d0\u30fc\u30b8\u30e7\u30f3 {1} \u3067\u3059\u3002
-4=EAR \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d "{0}" \u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3068\u540c\u3058\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002
-5={0} \u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5165\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
-6={0} \u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002
-7=\u5185\u90e8\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002 \u8a73\u3057\u304f\u306f\u3001\u30ed\u30b0\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u8abf\u3079\u3066\u304f\u3060\u3055\u3044\u3002
-8=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u304c\u7121\u52b9\u3067\u3059\u3002
-9=\u5b9b\u5148\u30a2\u30fc\u30ab\u30a4\u30d6\u306f {0} \u3067\u7d42\u308f\u3063\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
-10=\u5b9b\u5148\u30a2\u30fc\u30ab\u30a4\u30d6\u304c\u7121\u52b9\u3067\u3059\u3002
-11=\u5b9b\u5148\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u3059\u3002
-12=\u30ea\u30bd\u30fc\u30b9 {0} \u306f\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002 \u4e0a\u66f8\u304d\u3057\u305f\u3044\u5834\u5408\u3001\u300c\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u306e\u4e0a\u66f8\u304d\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002
-13=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 {0} \u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002
-14=\u9078\u629e\u3057\u305f J2EE \u8a2d\u5b9a\u3067\u306f\u3001\u30b3\u30cd\u30af\u30bf\u30fc\u30fb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 \u30b0\u30ed\u30fc\u30d0\u30eb J2EE \u8a2d\u5b9a\u3092\u8abf\u3079\u3066\u304f\u3060\u3055\u3044\u3002
-15=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
-16=\u4fdd\u7ba1\u306e\u554f\u984c
-17=\u4fdd\u7ba1\u3092\u5b8c\u4e86\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u4e00\u90e8\u306e\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3067\u306b\u4fdd\u7ba1\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n\n\u7406\u7531
-18={0} \u306f\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u64cd\u4f5c\u304c\u73fe\u5728\u5b9f\u884c\u4e2d\u3067\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
-19=extendedRoot \u304c NULL \u3067\u3059\u3002 isExtended() \u304c true \u3092\u623b\u3059\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
-20=\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093:
-21=\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30e2\u30c7\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093:
-22=\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b ID \u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002
-23=ID \u3092 NULL \u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002
-24=\u30a8\u30e9\u30fc:
-25=\u62e1\u5f35\u6f14\u7b97\u5931\u6557: {0}
-26=\u30b8\u30e7\u30d6\u304c\u6b63\u5e38\u306b\u5b8c\u4e86\u3057\u307e\u3057\u305f
-27=\u30b8\u30e7\u30d6\u306e\u5b9f\u884c\u4e2d\u306b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002
-28=\u30b0\u30eb\u30fc\u30d7\u3092\u89e3\u6c7a\u3067\u304d\u307e\u305b\u3093:
-29=\u5c5e\u6027 {0} \u7528\u306e\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: {1}\u3002\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u62e1\u5f35\u6a5f\u80fd: {2}
-30=\u95a2\u6570\u30b0\u30eb\u30fc\u30d7 {0} \u306b\u306f\u30d1\u30bf\u30fc\u30f3\u30fb\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u304c\u3042\u308a\u307e\u305b\u3093
-31=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 {0} \u304c\u30af\u30ed\u30fc\u30ba\u3055\u308c\u3066\u3044\u307e\u3059\u3002
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ko.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ko.properties
deleted file mode 100644
index a5c40ab..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_ko.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=\ud574\ub2f9 \uc774\ub984\uacfc \uc704\uce58\ub97c \uac00\uc9c0\ub294 \ud504\ub85c\uc81d\ud2b8\uac00 \uc774\ubbf8 \uc788\uc2b5\ub2c8\ub2e4.
-2=\uc9c0\uc815\ub41c EAR \ud504\ub85c\uc81d\ud2b8 "{0}"\uc740(\ub294) EAR \ud504\ub85c\uc81d\ud2b8\uac00 \uc544\ub2d9\ub2c8\ub2e4.
-3=EAR \ud504\ub85c\uc81d\ud2b8 "{0}"\uc740(\ub294) \uc9c0\uc815\ub41c \ubaa8\ub4c8 \ubc84\uc804\uacfc \ud638\ud658 \uac00\ub2a5\ud558\uc9c0 \uc54a\uc740 {1}\uc758 J2EEVersion\uc744 \uac16\uc2b5\ub2c8\ub2e4.
-4=EAR \ud504\ub85c\uc81d\ud2b8 \uc774\ub984 "{0}"\uc740(\ub294) \ud504\ub85c\uc81d\ud2b8 \uc774\ub984\uacfc \ub3d9\uc77c\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
-5={0} \ud30c\uc77c \uc774\ub984\uc744 \uc785\ub825\ud574\uc57c \ud569\ub2c8\ub2e4.
-6={0}\uc774(\uac00) \uc874\uc7ac\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
-7=\ub0b4\ubd80 \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \ub85c\uadf8 \ud30c\uc77c\uc744 \ucc38\uc870\ud558\uc2ed\uc2dc\uc624.
-8=\ud504\ub85c\uc81d\ud2b8 \uc774\ub984\uc774 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
-9=\ub300\uc0c1 \uc544\uce74\uc774\ube0c\ub294 {0}(\uc73c)\ub85c \ub05d\ub098\uc57c \ud569\ub2c8\ub2e4.
-10=\ub300\uc0c1 \uc544\uce74\uc774\ube0c\uac00 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
-11=\ub300\uc0c1 \uc704\uce58\ub294 \uc77d\uae30 \uc804\uc6a9\uc785\ub2c8\ub2e4.
-12=\uc790\uc6d0 {0}\uc774(\uac00) \uc774\ubbf8 \uc788\uc2b5\ub2c8\ub2e4. \uacb9\uccd0\uc4f0\ub824\ub294 \uacbd\uc6b0 "\uae30\uc874 \ud30c\uc77c \uacb9\uccd0\uc4f0\uae30" \uc635\uc158\uc744 \uc120\ud0dd\ud558\uc2ed\uc2dc\uc624.
-13={0} \ud504\ub85c\uc81d\ud2b8\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
-14=\uc120\ud0dd\ub41c J2EE \ud658\uacbd \uc124\uc815\uc758 \ucee4\ub125\ud130 \ud504\ub85c\uc81d\ud2b8\ub294 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uae00\ub85c\ubc8c J2EE \ud658\uacbd \uc124\uc815\uc744 \ud655\uc778\ud558\uc2ed\uc2dc\uc624.
-15=\ud504\ub85c\uc81d\ud2b8 \uc774\ub984\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624.
-16=\ubb38\uc81c\uc810 \uc800\uc7a5
-17=\uc800\uc7a5\uc744 \uc644\ub8cc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc77c\ubd80 \uad00\ub828\ub41c \ud30c\uc77c\uc740 \uc774\ubbf8 \uc800\uc7a5\ub418\uc5c8\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n\n\uc774\uc720
-18={0}\uc774(\uac00) \uc7a0\uacbc\uc2b5\ub2c8\ub2e4. \uc870\uc791\uc744 \ud604\uc7ac \uc2e4\ud589 \uc911\uc774\uc9c0 \uc54a\uc740\uc9c0 \ud655\uc778\ud558\uc2ed\uc2dc\uc624.
-19=extendedRoot\uac00 \ub110(null)\uc785\ub2c8\ub2e4. isExtended()\uac00 true\ub97c \ub9ac\ud134\ud558\ub294\uc9c0 \ud655\uc778\ud558\uc2ed\uc2dc\uc624.
-20=\ud2b9\uc131\uc744 \ucc3e\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4:
-21=\uc911\ucca9\ub41c \ubaa8\ub378\uc744 \ucc3e\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4:
-22=id\uac00 \uc124\uc815\ub41c \uacbd\uc6b0 \uc218\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
-23=id\ub294 \ub110(null)\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
-24=\uc624\ub958:
-25=\ud655\uc7a5 \uc870\uc791 \uc2e4\ud328: {0}
-26=\uc791\uc5c5\uc744 \uc644\ub8cc\ud588\uc2b5\ub2c8\ub2e4.
-27=\uc791\uc5c5 \uc2e4\ud589 \uc911 \uc608\uc678\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4.
-28=\uadf8\ub8f9\uc744 \ubd84\uc11d\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4:
-29={0} \uc18d\uc131\uc758 \ud074\ub798\uc2a4\ub97c \ucc3e\uc9c0 \ubabb\ud568 : {1}, \ud50c\ub7ec\uadf8\uc778 \ud655\uc7a5 \uc120\uc5b8: {2}
-30=\uae30\ub2a5 \uadf8\ub8f9 {0}\uc5d0\ub294 \ud328\ud134 \ubc14\uc778\ub529\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.
-31={0} \ud504\ub85c\uc81d\ud2b8\uac00 \ucc98\ub9ac\uc644\ub8cc\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
-32=\ud504\ub85c\uc81d\ud2b8\uac00 \uc774\ubbf8 \ud30c\uc77c \uc2dc\uc2a4\ud15c\uc758 \ub2e4\uc74c \uc704\uce58\uc5d0 \uc788\uc2b5\ub2c8\ub2e4: {0}. "\uae30\uc874 \ud504\ub85c\uc81d\ud2b8\ub97c \uc791\uc5c5\uacf5\uac04\uc73c\ub85c \uac00\uc838\uc624\uae30"\ub97c \uc120\ud0dd\ud558\uc5ec \uc774 \uc704\uce58\uc5d0 \uc0c8 \ud504\ub85c\uc81d\ud2b8\ub97c \uc791\uc131\ud558\uac70\ub098, \ud30c\uc77c \uc2dc\uc2a4\ud15c\uc5d0\uc11c {0}\uc758 \ucee8\ud150\uce20\ub97c \uc0ad\uc81c\ud558\uc2ed\uc2dc\uc624.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_pt_BR.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_pt_BR.properties
deleted file mode 100644
index 752f2a1..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_pt_BR.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=Um projeto j\u00e1 existe com este nome e local.
-2=O projeto EAR especificado "{0}" n\u00e3o \u00e9 um projeto EAR.
-3=O projeto EAR "{0}" possui uma J2EEVersion de {1} que n\u00e3o \u00e9 compat\u00edvel com a vers\u00e3o do m\u00f3dulo especificado.
-4=O nome do projeto EAR, "{0}", n\u00e3o pode ser o mesmo que o nome do projeto.
-5=O nome do arquivo {0} deve ser digitado.
-6=O arquivo {0} n\u00e3o existe.
-7=Ocorreu um erro interno. Visualize os arquivos de log para obter detalhes.
-8=O nome do projeto \u00e9 inv\u00e1lido.
-9=O arquivo de destino deve finalizar com {0}.
-10=O arquivo de destino \u00e9 inv\u00e1lido.
-11=O local de destino \u00e9 somente para leitura.
-12=O recurso {0} j\u00e1 existe. Se voc\u00ea desejar sobrescrever, selecione a op\u00e7\u00e3o "Sobrescrever Arquivo Existente".
-13=O projeto {0} n\u00e3o existe.
-14=O projeto do conector n\u00e3o \u00e9 suportado para prefer\u00eancia J2EE selecionada. Verifique a prefer\u00eancia global J2EE.
-15=Digite um nome de projeto.
-16=Salvar problemas
-17=Salvamento n\u00e3o p\u00f4de ser conclu\u00eddo. Alguns arquivos relacionados podem j\u00e1 ter sido salvos.\n\n Motivo
-18={0} foi bloqueado. Verifique se a opera\u00e7\u00e3o n\u00e3o est\u00e1 executando no momento.
-19=O extendedRoot \u00e9 nulo. Verifique se o isExtended() retorna verdadeiro.
-20=Propriedade n\u00e3o localizada:
-21=Modelo aninhado n\u00e3o localizado:
-22=N\u00e3o \u00e9 poss\u00edvel modificar o id uma vez que j\u00e1 foi configurado.
-23=O id n\u00e3o pode ser nulo.
-24=ERRO:
-25=Falha na opera\u00e7\u00e3o estendida: {0}
-26=O Trabalho foi conclu\u00eddo com sucesso
-27=Ocorreu uma exce\u00e7\u00e3o ao executar o trabalho.
-28=O grupo n\u00e3o pode ser resolvido:
-29=A classe n\u00e3o foi localizada para o atributo {0} : {1}, Declarando extens\u00e3o de plug-in: {2}
-30=O grupo de fun\u00e7\u00e3o {0} n\u00e3o cont\u00e9m nenhuma liga\u00e7\u00e3o padr\u00e3o
-31=O projeto {0} est\u00e1 fechado.
-32=Um projeto j\u00e1 existe no sistema de arquivos neste local: {0}. Use "Importar Projetos Existentes no Espa\u00e7o de Trabalho" para criar um projeto neste local ou exclua o conte\u00fado de {0} do sistema de arquivos.
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_CN.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_CN.properties
deleted file mode 100644
index f4bf118..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_CN.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=\u5177\u6709\u6b64\u540d\u79f0\u548c\u4f4d\u7f6e\u7684\u9879\u76ee\u5df2\u5b58\u5728\u3002
-2=\u6307\u5b9a\u7684 EAR \u9879\u76ee\u201c{0}\u201d\u4e0d\u662f EAR \u9879\u76ee\u3002
-3=EAR \u9879\u76ee\u201c{0}\u201d\u5177\u6709 {1}\uff08\u5b83\u4e0e\u6307\u5b9a\u7684\u6a21\u5757\u7248\u672c\u4e0d\u517c\u5bb9\uff09\u7684 J2EE \u7248\u672c\u3002
-4=EAR \u9879\u76ee\u540d\u79f0\u201c{0}\u201d\u4e0d\u80fd\u4e0e\u8be5\u9879\u76ee\u540d\u79f0\u76f8\u540c\u3002
-5=\u5fc5\u987b\u8f93\u5165 {0} \u6587\u4ef6\u540d\u3002
-6={0} \u4e0d\u5b58\u5728\u3002
-7=\u53d1\u751f\u4e86\u5185\u90e8\u9519\u8bef\u3002\u8bf7\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u4ee5\u83b7\u53d6\u8be6\u7ec6\u4fe1\u606f\u3002
-8=\u9879\u76ee\u540d\u79f0\u65e0\u6548\u3002
-9=\u76ee\u6807\u5f52\u6863\u5e94\u8be5\u4ee5 {0} \u7ed3\u5c3e\u3002
-10=\u76ee\u6807\u5f52\u6863\u65e0\u6548\u3002
-11=\u76ee\u6807\u4f4d\u7f6e\u662f\u53ea\u8bfb\u7684\u3002
-12=\u8d44\u6e90 {0} \u5df2\u5b58\u5728\u3002\u5982\u679c\u60a8\u60f3\u8986\u76d6\uff0c\u8bf7\u9009\u62e9\u201c\u8986\u76d6\u73b0\u6709\u6587\u4ef6\u201d\u9009\u9879\u3002
-13=\u9879\u76ee {0} \u4e0d\u5b58\u5728\u3002
-14=\u8fde\u63a5\u5668\u9879\u76ee\u5bf9\u4e8e\u9009\u62e9\u7684 J2EE \u9996\u9009\u9879\u4e0d\u53d7\u652f\u6301\u3002\u8bf7\u68c0\u67e5\u5168\u5c40 J2EE \u9996\u9009\u9879\u3002
-15=\u8f93\u5165\u9879\u76ee\u540d\u79f0\u3002
-16=\u4fdd\u5b58\u95ee\u9898
-17=\u4fdd\u5b58\u4e0d\u80fd\u5b8c\u6210\u3002\u53ef\u80fd\u5df2\u7ecf\u4fdd\u5b58\u4e86\u67d0\u4e9b\u76f8\u5173\u6587\u4ef6\u3002\n\n\u539f\u56e0
-18={0} \u5df2\u9501\u5b9a\u3002\u8bf7\u786e\u4fdd\u5f53\u524d\u672a\u6267\u884c\u8be5\u64cd\u4f5c\u3002
-19=extendedRoot \u662f\u7a7a\u7684\u3002\u8bf7\u786e\u4fdd isExtended() \u8fd4\u56de true\u3002
-20=\u5c5e\u6027\u672a\u627e\u5230\uff1a
-21=\u5d4c\u5957\u7684\u6a21\u578b\u672a\u627e\u5230\uff1a
-22=\u4e00\u65e6\u8bbe\u7f6e\u4e86\u6807\u8bc6\u5c31\u4e0d\u80fd\u518d\u4fee\u6539\u5b83\u3002
-23=\u8be5\u6807\u8bc6\u4e0d\u80fd\u4e3a\u7a7a\u3002
-24=\u9519\u8bef\uff1a
-25=\u6269\u5c55\u7684\u64cd\u4f5c\u5931\u8d25\uff1a{0}
-26=\u4f5c\u4e1a\u6210\u529f\u5b8c\u6210
-27=\u8fd0\u884c\u4f5c\u4e1a\u65f6\u53d1\u751f\u5f02\u5e38\u3002
-28=\u4e0d\u80fd\u89e3\u6790\u7ec4\uff1a
-29=\u672a\u627e\u5230\u5c5e\u6027 {0} \u7684\u7c7b\uff1a{1}\uff0c\u58f0\u660e\u63d2\u4ef6\u6269\u5c55\uff1a{2}
-30=\u51fd\u6570\u7ec4 {0} \u672a\u5305\u542b\u6a21\u5f0f\u7ed1\u5b9a
-31=\u5173\u95ed\u4e86\u9879\u76ee {0}\u3002
-32=\u6587\u4ef6\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u6709\u4e00\u4e2a\u9879\u76ee\u5b58\u5728\u4e8e\u6b64\u4f4d\u7f6e\uff1a{0}\u3002\u4f7f\u7528\u201c\u5bfc\u5165\u73b0\u6709\u9879\u76ee\u5230\u5de5\u4f5c\u7a7a\u95f4\u4e2d\u201d\u6765\u5728\u6b64\u4f4d\u7f6e\u521b\u5efa\u9879\u76ee\uff0c\u6216\u8005\u4ece\u6587\u4ef6\u7cfb\u7edf\u4e2d\u5220\u9664 {0} \u7684\u5185\u5bb9\u3002
diff --git a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_TW.properties b/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_TW.properties
deleted file mode 100644
index fcde968..0000000
--- a/plugins/org.eclipse.wst.common.frameworks/src/wtp_common_zh_TW.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-1=\u5df2\u6709\u9019\u500b\u540d\u7a31\u548c\u4f4d\u7f6e\u7684\u5c08\u6848\u5b58\u5728\u3002
-2=\u6307\u5b9a\u7684 EAR \u5c08\u6848 "{0}" \u4e0d\u662f EAR \u5c08\u6848\u3002
-3=EAR \u5c08\u6848 "{0}" \u7684 J2EE \u7248\u672c\u662f {1}\uff0c\u8207\u6307\u5b9a\u7684\u6a21\u7d44\u7248\u672c\u4e0d\u76f8\u5bb9\u3002
-4=EAR \u5c08\u6848\u540d\u7a31 "{0}" \u7121\u6cd5\u8207\u9019\u500b\u5c08\u6848\u540d\u7a31\u76f8\u540c\u3002
-5=\u5fc5\u9808\u8f38\u5165 {0} \u6a94\u540d\u7a31\u3002
-6={0} \u4e0d\u5b58\u5728\u3002
-7=\u767c\u751f\u5167\u90e8\u932f\u8aa4\u3002 \u8acb\u53c3\u95b1\u65e5\u8a8c\u6a94\uff0c\u4ee5\u53d6\u5f97\u8a73\u7d30\u8cc7\u6599\u3002
-8=\u5c08\u6848\u540d\u7a31\u7121\u6548\u3002
-9=\u76ee\u7684\u5730\u4fdd\u5b58\u6a94\u7684\u7d50\u5c3e\u61c9\u8a72\u662f {0}\u3002
-10=\u76ee\u7684\u5730\u4fdd\u5b58\u6a94\u7121\u6548\u3002
-11=\u76ee\u7684\u5730\u4f4d\u7f6e\u552f\u8b80\u3002
-12=\u8cc7\u6e90 {0} \u5df2\u5b58\u5728\u3002\u5982\u679c\u8981\u6539\u5beb\uff0c\u8acb\u9078\u53d6\u300c\u6539\u5beb\u73fe\u6709\u7684\u6a94\u6848\u300d\u9078\u9805\u3002
-13={0} \u5c08\u6848\u4e0d\u5b58\u5728\u3002
-14=\u4e0d\u652f\u63f4\u9023\u63a5\u5668\u5c08\u6848\u4f7f\u7528\u9078\u53d6\u7684 J2EE \u559c\u597d\u8a2d\u5b9a\u3002\u8acb\u6aa2\u67e5\u5ee3\u57df J2EE \u559c\u597d\u8a2d\u5b9a\u3002
-15=\u8acb\u8f38\u5165\u5c08\u6848\u540d\u7a31\u3002
-16=\u5132\u5b58\u554f\u984c
-17=\u5132\u5b58\u7121\u6cd5\u5b8c\u6210\u3002\u53ef\u80fd\u5df2\u5132\u5b58\u67d0\u4e9b\u76f8\u95dc\u7684\u6a94\u6848\u3002\n\n\u539f\u56e0
-18={0} \u5df2\u9396\u5b9a\u3002\u8acb\u78ba\u5b9a\u4f5c\u696d\u76ee\u524d\u4e0d\u5728\u57f7\u884c\u4e2d\u3002
-19=extendedRoot \u662f\u7a7a\u503c\u3002\u8acb\u78ba\u5b9a isExtended() \u50b3\u56de true\u3002
-20=\u627e\u4e0d\u5230\u5167\u5bb9\uff1a
-21=\u627e\u4e0d\u5230\u5de2\u72c0\u6a21\u578b\uff1a
-22=\u8a2d\u5b9a\u597d ID \u4e4b\u5f8c\uff0c\u5c31\u7121\u6cd5\u4fee\u6539 ID\u3002
-23=ID \u4e0d\u80fd\u662f\u7a7a\u503c\u3002
-24=\u932f\u8aa4\uff1a
-25=\u5ef6\u4f38\u7684\u4f5c\u696d\u5931\u6557\uff1a{0}
-26=\u5de5\u4f5c\u9806\u5229\u5b8c\u6210
-27=\u57f7\u884c\u5de5\u4f5c\u6642\uff0c\u767c\u751f\u7570\u5e38\u72c0\u6cc1\u3002
-28=\u7121\u6cd5\u89e3\u6790\u7fa4\u7d44\uff1a
-29=\u627e\u4e0d\u5230 {0} \u5c6c\u6027\u7684\u985e\u5225\uff1a{1}\uff0c\u5ba3\u544a\u5916\u639b\u7a0b\u5f0f\u5ef6\u4f38\uff1a{2}
-30=\u51fd\u6578\u7fa4\u7d44 {0} \u6c92\u6709\u5305\u542b\u4efb\u4f55\u578b\u6a23\u9023\u7d50
-31={0} \u5c08\u6848\u5df2\u95dc\u9589\u3002
-32=\u5c08\u6848\u5df2\u7d93\u5b58\u5728\u6a94\u6848\u7cfb\u7d71\u7684 {0} \u4f4d\u7f6e\u4e2d\u3002\u5229\u7528\u300c\u5c07\u73fe\u6709\u7684\u5c08\u6848\u653e\u5165\u5de5\u4f5c\u5340\u300d\u5728\u9019\u500b\u4f4d\u7f6e\u5efa\u7acb\u5c08\u6848\uff0c\u6216\u5f9e\u6a94\u6848\u7cfb\u7d71\u4e2d\u522a\u9664 {0} \u7684\u5167\u5bb9\u3002
diff --git a/plugins/org.eclipse.wst.common.ui/component.xml b/plugins/org.eclipse.wst.common.ui/component.xml
new file mode 100644
index 0000000..dbce81a
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.ui/component.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component xmlns="http://eclipse.org/wtp/releng/tools/component-model"
+ name="org.eclipse.wst.common">
+ <component-depends unrestricted="true"></component-depends>
+ <plugin id="org.eclipse.wst.common.ui" fragment="false" />
+ <plugin id="org.eclipse.wst.common.ui.properties" fragment="false" />
+ <plugin id="org.eclipse.wst.common.uriresolver" fragment="false" />
+
+<!-- <package name="org.eclipse.wst.common.ui.viewers"> -->
+<!-- <type name="SelectSingleFileView" /> --> <!-- ?, does eclipse provide better support? -->
+<!-- <type name="ResourceFilter" /> -->
+<!-- <type name="SelectMultiFilePage" /> -->
+<!-- <type name="SelectSingleFilePage" /> -->
+<!-- <type name="TableNavigator" /> --> <!-- No, should be in eclipse base -->
+<!-- <type name="NavigableTableViewer" /> --> <!-- No, should be in eclipse base -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.actionhandler.action"> -->
+<!-- <type name="CutAction" /> --> <!-- No to these four, should be removed? -->
+<!-- <type name="PasteAction" /> -->
+<!-- <type name="CopyAction" /> -->
+<!-- <type name="EditAction" /> -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui"> -->
+<!-- <type name="UIPlugin" /> --> <!-- No, delete this -->
+<!-- <type name="OverlayIconManager" /> --> <!-- No -->
+<!-- <type name="WindowUtility" /> --> <!-- Remove class, clean up xsd.ui -->
+<!-- <type name="ImageFactory" /> --> <!-- No -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.wizards"> -->
+<!-- <type name="ExampleProjectCreationOperation" /> --> <!-- referenced externally only within package (ExampleProjectCreationWizardPage -->
+<!-- <type name="ExampleProjectCreationWizardPage" /> --> <!-- referenced externally only within package (ExampleProjectCreationWizard, and Operation -->
+<!-- <type name="ExampleProjectCreationWizard" /> --> <!-- referenced by XMLExampleProjectCreationWizard, which is deprecated and going to be removed in M4 -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.dnd"> -->
+<!-- <type name="ViewerDropAdapter" /> -->
+<!-- <type name="DragAndDropCommand" /> --> <!-- referenced externally only within package -->
+<!-- <type name="DragAndDropManager" /> --> <!-- -->
+<!-- <type name="ObjectTransfer" /> -->
+<!-- <type name="DefaultDragAndDropCommand" /> -->
+<!-- <type name="ViewerDragAdapter" /> -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.resource"> -->
+<!-- <type name="ResourceDeleteListener" /> --> <!-- no references -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.dialogs"> -->
+<!-- <type name="SelectSingleFileDialog" /> --> <!-- No, should look into base for support? -->
+<!-- </package> -->
+<!-- <package name="org.eclipse.wst.common.ui.actionhandler">
+ <type name="ActionHandlerListener" />
+ </package>
+-->
+<!-- provisional APIs -->
+<!--
+ <package name="org.eclipse.wst.common.uriresolver">
+ <type name="URIResolverPlugin" />
+ <type name="URIResolver" />
+ <type name="URIResolverExtension" />
+ </package>
+-->
+</component>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.uriresolver/.classpath b/plugins/org.eclipse.wst.common.uriresolver/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.common.uriresolver/.cvsignore b/plugins/org.eclipse.wst.common.uriresolver/.cvsignore
deleted file mode 100644
index 5b853a4..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-uriresolver.jar
-build.xml
-temp.folder
-org.eclipse.wst.common.uriresolver_1.0.0.jar
diff --git a/plugins/org.eclipse.wst.common.uriresolver/.project b/plugins/org.eclipse.wst.common.uriresolver/.project
deleted file mode 100644
index e19b693..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.uriresolver</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.common.uriresolver/README.txt b/plugins/org.eclipse.wst.common.uriresolver/README.txt
deleted file mode 100644
index acaf514..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-API for an URI resolver.
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.uriresolver/build.properties b/plugins/org.eclipse.wst.common.uriresolver/build.properties
deleted file mode 100644
index 08364ab..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = plugin.xml,\
- uriresolver.jar
-jars.compile.order = uriresolver.jar
-source.uriresolver.jar = src/
-output.uriresolver.jar = bin/
diff --git a/plugins/org.eclipse.wst.common.uriresolver/plugin.xml b/plugins/org.eclipse.wst.common.uriresolver/plugin.xml
deleted file mode 100644
index 820fba0..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.common.uriresolver"
- name="org.eclipse.wst.common.uriresolver"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.wst.common.uriresolver.URIResolverPlugin">
-
- <runtime>
- <library name="uriresolver.jar">
- <export name="*" />
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- </requires>
-
-
- <extension-point id="resolverExtensions" name="URI Resolver Extension"/>
-
-</plugin>
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolver.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolver.java
deleted file mode 100644
index 88451b2..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolver.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver;
-
-/**
- * A URIResolver is used to resolve URI references to resources.
- *
- */
-public interface URIResolver {
-
- /**
- * @param baseLocation - the location of the resource that contains the uri
- * @param publicId - an optional public identifier (i.e. namespace name), or null if none
- * @param systemId - an absolute or relative URI, or null if none
- * @return an absolute URI
- */
- public String resolve(String baseLocation, String publicId, String systemId);
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverExtension.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverExtension.java
deleted file mode 100644
index 377a144..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverExtension.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * An extension to augment the behaviour of a URIResolver. Extensions are project aware
- * so that they can apply specialized project specific resolving rules.
- */
-public interface URIResolverExtension {
- public String resolve(IProject project, String baseLocation, String publicId, String systemId);
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverPlugin.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverPlugin.java
deleted file mode 100644
index e652718..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/URIResolverPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.common.uriresolver.internal.ExtensibleURIResolver;
-import org.eclipse.wst.common.uriresolver.internal.URIResolverExtensionRegistry;
-import org.eclipse.wst.common.uriresolver.internal.URIResolverExtensionRegistryReader;
-
-
-public class URIResolverPlugin extends Plugin {
- protected static URIResolverPlugin instance;
- protected URIResolverExtensionRegistry xmlResolverExtensionRegistry;
-
- public static URIResolverPlugin getInstance()
- {
- return instance;
- }
-
- public URIResolverPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
- }
-
-
- public static URIResolver createResolver()
- {
- return createResolver(null);
- }
-
- public static URIResolver createResolver(Map properties)
- {
- // TODO... utilize properties
- return new ExtensibleURIResolver();
- }
-
- //public static URIResolver createResolver(IProject project)
- //{
- // return new ExtensibleURIResolver(project);
- //}
-
- public URIResolverExtensionRegistry getXMLResolverExtensionRegistry()
- {
- if (xmlResolverExtensionRegistry == null)
- {
- xmlResolverExtensionRegistry = new URIResolverExtensionRegistry();
- new URIResolverExtensionRegistryReader(xmlResolverExtensionRegistry).readRegistry();
- }
- return xmlResolverExtensionRegistry;
- }
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/ExtensibleURIResolver.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/ExtensibleURIResolver.java
deleted file mode 100644
index a16713a..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/ExtensibleURIResolver.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.uriresolver.URIResolver;
-import org.eclipse.wst.common.uriresolver.URIResolverExtension;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-
-
-/**
- * @author csalter
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ExtensibleURIResolver implements URIResolver
-{
-
- //protected IProject project;
-
- //TODO... consider ctor that takes a project arg
- //public ExtensibleURIResolver(IProject project)
- //{
- // this.project = project;
- //}
-
- public ExtensibleURIResolver()
- {
- }
-
- public String resolve(String baseLocation, String publicId, String systemId)
- {
- String result = systemId;
-
- // compute the project that holds the resource
- //
- IProject project = computeProject(baseLocation);
- String fileName = null; // todo.. get the file name for systemId
-
- URIResolverExtensionRegistry resolverRegistry = URIResolverPlugin.getInstance().getXMLResolverExtensionRegistry();
- List list = resolverRegistry.getExtensionDescriptors(project);
-
- // get the list of applicable pre-normalized resolvers from the
- // extension registry
- //
- for (Iterator i = resolverRegistry.getMatchingURIResolvers(list, URIResolverExtensionRegistry.STAGE_PRENORMALIZATION).iterator(); i.hasNext();)
- {
- URIResolverExtension resolver = (URIResolverExtension) i.next();
- result = resolver.resolve(project, baseLocation, publicId, result);
- }
-
- // normalize the uri
- //
- result = normalize(baseLocation, result);
-
- // get the list of applicable post-normalized resolvers from the
- // extension registry
- //
- for (Iterator i = resolverRegistry.getMatchingURIResolvers(list, URIResolverExtensionRegistry.STAGE_POSTNORMALIZATION).iterator(); i.hasNext();)
- {
- URIResolverExtension resolver = (URIResolverExtension) i.next();
- result = resolver.resolve(project, baseLocation, publicId, result);
- }
-
- return result;
- }
-
- protected String normalize(String baseLocation, String systemId)
- {
- // If no systemId has been specified there is nothing to do
- // so return null;
- if(systemId == null)
- return null;
- String result = systemId;
- // normalize the URI
- URI systemURI = URI.createURI(systemId);
- if (systemURI.isRelative())
- {
- URI baseURI = URI.createURI(baseLocation);
- try
- {
- result = systemURI.resolve(baseURI).toString();
- }
- catch(IllegalArgumentException e)
- {}
-
- }
- return result;
- }
-
- protected IProject computeProject(String baseLocation)
- {
- if(baseLocation != null)
- {
- String pattern = "file:///";
- if (baseLocation.startsWith(pattern))
- {
- baseLocation = baseLocation.substring(pattern.length());
- }
- IPath path = new Path(baseLocation);
- //path = path.removeFirstSegments(1);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- //IContainer c =
- // ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
- return file != null ? file.getProject() : null;
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URI.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URI.java
deleted file mode 100644
index 3aac823..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URI.java
+++ /dev/null
@@ -1,2019 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver.internal;
-
-import java.io.File;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * A representation of a Uniform Resource Identifier (URI), as specified by
- * <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>, with certain
- * enhancements. A <code>URI</code> instance can be created by specifying
- * values for its components, or by providing a single URI string, which is
- * parsed into its components. Static factory methods whose names begin
- * with "create" are used for both forms of object creation. No public or
- * protected constructors are provided; this class can not be subclassed.
- *
- * <p>Like <code>String</code>, <code>URI</code> is an immutable class;
- * a <code>URI</code> instance offers several by-value methods that return a
- * new <code>URI</code> object based on its current state. Most useful,
- * a relative <code>URI</code> can be {@link #resolve(URI) resolve}d against
- * a base absolute <code>URI</code> -- the latter typically identifies the
- * document in which the former appears. The inverse to this is {@link
- * #deresolve(URI) deresolve}, which answers the question, "what relative
- * URI will resolve, against the given base, to this absolute URI?"
- *
- * <p>In the <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC</a>, much
- * attention is focused on a hierarchical naming system used widely to
- * locate resources via common protocols such as HTTP, FTP, and Gopher, and
- * to identify files on a local file system. Acordingly, most of this
- * class's functionality is for handling such URIs, which can be identified
- * via {@link #isHierarchical()}.
- *
- * <p><a name="device_explaination">
- * The primary enhancement beyond the RFC description is an optional
- * device component. Instead of treating the device as just another segment
- * in the path, it can be stored as a separate component (almost a
- * sub-authority), with the root below it. For example, resolving
- * <code>/bar</code> against <code>file:///c:/foo</code> would result in
- * <code>file:///c:/bar</code> being returned. Also, you cannot take
- * the parent of a device, so resolving <code>..</code> against
- * <code>file:///c:/</code> would not yield <code>file:///</code>, as you
- * might expect. This feature is useful when working with file-scheme
- * URIs, as devices do not typically occur in protocol-based ones. A
- * device-enabled <code>URI</code> can be created by parsing a string with
- * {@link #createURI} or by specifying a non-null <code>device</code>
- * paramter for either the {@link #createHierarchicalURI(String, String,
- * String, String, String) no-path} or the {@link
- * #createHierarchicalURI(String, String, String, String[], String, String)
- * absolute-path} form of <code>createHierarchicalURI()</code>.
- *
- * <p>Compared to the RFC description, this implementation is quite relaxed
- * about validity. Static methods whose names begin with "valid" test
- * whether a given string is a valid value for the various URI components.
- * Presently, these tests place no restrictions beyond what would have been
- * required in order for {@link #createURI} to
- * have parsed them correctly from a single URI string. Note that all of
- * the static factory methods invoke the appropriate validation methods and
- * throw exceptions in response to a negative result, ensuring that
- * invalid URIs are never created.
- *
- * <p>Finally, note the difference between a <code>null</code> parameter to
- * the static factory methods and an empty string. The former signifies the
- * absense of a given URI component, while the latter simply makes the
- * component blank. This can have a significant effect when resolving. For
- * example, consider the following two URIs: <code>/bar</code> (with no
- * authority) and <code>///bar</code> (with a blank authority). Imagine
- * resolving them against a base with an authority, such as
- * <code>http://www.eclipse.org/</code>. The former case will yield
- * <code>http://www.eclipse.org/bar</code>, as the base authority will be
- * preserved. In the latter case, the empty authority will override the
- * base authority, resulting in <code>http:///bar</code>!
- */
-public final class URI
-{
- // Common to all URI types.
- private final int hashCode;
- private final boolean hierarchical;
- private final String scheme; // null -> relative URI reference
- private final String authority;
- private final String fragment;
- private URI cachedTrimFragment;
- private String cachedToString;
-
- // Applicable only to a hierarchical URI.
- private final String device;
- private final boolean absolutePath;
- private final String[] segments; // empty last segment -> trailing separator
- private final String query;
-
- // Identifies a file-type absolute URI.
- private static final String SCHEME_FILE = "file";
- private static final String SCHEME_JAR = "jar";
-
- // Special segment values interpreted at resolve and resolve time.
- private static final String SEGMENT_EMPTY = "";
- private static final String SEGMENT_SELF = ".";
- private static final String SEGMENT_PARENT = "..";
- private static final String[] NO_SEGMENTS = new String[0];
-
- // Separators for parsing a URI string
- private static final char SCHEME_SEPARATOR = ':';
- private static final String AUTHORITY_SEPARATOR = "//";
- private static final char DEVICE_IDENTIFIER = ':';
- private static final char SEGMENT_SEPARATOR = '/';
- private static final char QUERY_SEPARATOR = '?';
- private static final char FRAGMENT_SEPARATOR = '#';
- private static final char USER_INFO_SEPARATOR = '@';
- private static final char PORT_SEPARATOR = ':';
- private static final char FILE_EXTENSION_SEPARATOR = '.';
- private static final char[] MAJOR_SEPARATORS = {
- SCHEME_SEPARATOR, SEGMENT_SEPARATOR, QUERY_SEPARATOR, FRAGMENT_SEPARATOR };
- private static final char[] SEGMENT_END = {
- SEGMENT_SEPARATOR, QUERY_SEPARATOR, FRAGMENT_SEPARATOR };
-
- /**
- * Static factory method for a generic, non-hierarchical URI. There is no
- * concept of a relative non-hierarchical URI; such an object cannot be
- * created.
- *
- * @exception java.lang.IllegalArgumentException if <code>scheme</code> is
- * null, or if <code>scheme</code>, <code>opaquePart</code>, or
- * <code>fragment</code> is not valid according to {@link #validScheme},
- * {@link #validOpaquePart}, or {@link #validFragment}, respectively.
- */
- public static URI createGenericURI(String scheme, String opaquePart,
- String fragment)
- {
- if (scheme == null)
- {
- throw new IllegalArgumentException("relative non-hierarchical URI");
- }
-
- return new URI(false, scheme, opaquePart, null, false, NO_SEGMENTS,
- null, fragment);
- }
-
- /**
- * Static factory method for a hierarchical URI with no path. The
- * URI will be relative if <code>scheme</code> is non-null, and absolute
- * otherwise. An absolute URI with no path requires a non-null
- * <code>authority</code> and/or <code>device</code>.
- *
- * @exception java.lang.IllegalArgumentException if <code>scheme</code> is
- * non-null while <code>authority</code> and <code>device</code> are null,
- * or if <code>scheme</code>, <code>authority</code>, <code>device</code>,
- * <code>query</code>, or <code>fragment</code> is not valid according to
- * {@link #validScheme}, {@link #validAuthority}, {@link #validDevice},
- * {@link #validQuery}, or {@link #validFragment}, respectively.
- */
- public static URI createHierarchicalURI(String scheme, String authority,
- String device, String query,
- String fragment)
- {
- if (scheme != null && authority == null && device == null)
- {
- throw new IllegalArgumentException(
- "absolute hierarchical URI without authority, device, path");
- }
-
- return new URI(true, scheme, authority, device, false, NO_SEGMENTS,
- query, fragment);
- }
-
- /**
- * Static factory method for a hierarchical URI with absolute path.
- * The URI will be relative if <code>scheme</code> is non-null, and
- * absolute otherwise.
- *
- * @param segments an array of non-null strings, each representing one
- * segment of the path. As an absolute path, it is automatically
- * preceeded by a <code>/</code> separator. If desired, a trailing
- * separator should be represented by an empty-string segment as the last
- * element of the array.
- *
- * @exception java.lang.IllegalArgumentException if <code>scheme</code>,
- * <code>authority</code>, <code>device</code>, <code>segments</code>,
- * <code>query</code>, or <code>fragment</code> is not valid according to
- * {@link #validScheme}, {@link #validAuthority}, {@link #validDevice},
- * {@link #validSegments}, {@link #validQuery}, or {@link #validFragment},
- * respectively.
- */
- public static URI createHierarchicalURI(String scheme, String authority,
- String device, String[] segments,
- String query, String fragment)
- {
- return new URI(true, scheme, authority, device, true, fix(segments),
- query, fragment);
- }
-
- /**
- * Static factory method for a relative hierarchical URI with relative
- * path.
- *
- * @param segments an array of non-null strings, each representing one
- * segment of the path. A trailing separator is represented by an
- * empty-string segment at the end of the array.
- *
- * @exception java.lang.IllegalArgumentException if <code>segments</code>,
- * <code>query</code>, or <code>fragment</code> is not valid according to
- * {@link #validSegments}, {@link #validQuery}, or {@link #validFragment},
- * respectively.
- */
- public static URI createHierarchicalURI(String[] segments, String query,
- String fragment)
- {
- return new URI(true, null, null, null, false, fix(segments), query,
- fragment);
- }
-
- // Converts null to length-zero array, and clones array to ensure
- // immutability.
- private static String[] fix(String[] segments)
- {
- return segments == null ? NO_SEGMENTS : (String[])segments.clone();
- }
-
- /**
- * Static factory method based on parsing a URI string, with
- * <a href="#device_explaination">explicit device support</a> enabled.
- * The specified string is parsed as described in <a
- * href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>, and an
- * appropriate <code>URI</code> is created and returned. Note that
- * validity testing is not as strict as in the RFC; essentially, only
- * separator characters are considered. So, for example, non-Latin
- * alphabet characters appearing in the scheme would not be considered an
- * error.
- *
- * @exception java.lang.IllegalArgumentException if any component parsed
- * from <code>uri</code> is not valid according to {@link #validScheme},
- * {@link #validOpaquePart}, {@link #validAuthority}, {@link
- * #validDevice}, {@link #validSegments}, {@link #validQuery}, or {@link
- * #validFragment}, as appropriate.
- */
- public static URI createURI(String uri)
- {
- return parseIntoURI(uri);
- }
-
- /**
- * Static factory method based on parsing a URI string, with
- * <a href="#device_explaination">explicit device support</a> enabled.
- * Note that validity testing is not a strict as in the RFC; essentially,
- * only separator characters are considered. So, for example, non-Latin
- * alphabet characters appearing in the scheme would not be considered an
- * error.
- * @exception java.lang.IllegalArgumentException if any component parsed
- * from <code>uri</code> is not valid according to {@link #validScheme},
- * {@link #validOpaquePart}, {@link #validAuthority}, {@link
- * #validDevice}, {@link #validSegments}, {@link #validQuery}, or {@link
- * #validFragment}, as appropriate.
- * @deprecated
- */
- public static URI createDeviceURI(String uri)
- {
- return parseIntoURI(uri);
- }
-
- // String-parsing implementation.
- private static URI parseIntoURI(String uri)
- {
- boolean hierarchical = true;
- String scheme = null;
- String authority = null;
- String device = null;
- boolean absolutePath = false;
- String[] segments = NO_SEGMENTS;
- String query = null;
- String fragment = null;
-
- int i = 0;
- int j = findSeparator(uri, i, MAJOR_SEPARATORS);
-
- if (j < uri.length() && uri.charAt(j) == SCHEME_SEPARATOR)
- {
- scheme = uri.substring(i, j);
- i = j + 1;
- }
-
- if (uri.startsWith(AUTHORITY_SEPARATOR, i))
- {
- i += AUTHORITY_SEPARATOR.length();
- j = findSeparator(uri, i, SEGMENT_END);
- authority = uri.substring(i, j);
- i = j;
- }
- else if (scheme != null &&
- (i == uri.length() ||
- uri.charAt(i) != SEGMENT_SEPARATOR &&
- !(scheme.equalsIgnoreCase(SCHEME_FILE) || scheme.equalsIgnoreCase(SCHEME_JAR))))
- {
- hierarchical = false;
- j = findSeparator(uri, i, new char[] { FRAGMENT_SEPARATOR });
- authority = uri.substring(i, j);
- i = j;
- }
-
- if (i < uri.length() &&
- uri.charAt(i) == SEGMENT_SEPARATOR)
- {
- j = findSeparator(uri, i + 1, SEGMENT_END);
- String s = uri.substring(i + 1, j);
-
- if (s.length() > 0 && s.charAt(s.length() - 1) == DEVICE_IDENTIFIER)
- {
- device = s;
- i = j;
- }
- }
-
- if (i < uri.length() && uri.charAt(i) == SEGMENT_SEPARATOR)
- {
- i++;
- absolutePath = true;
- }
-
- if (segmentsRemain(uri, i))
- {
- List segmentList = new ArrayList();
-
- while (segmentsRemain(uri, i))
- {
- j = findSeparator(uri, i, SEGMENT_END);
- segmentList.add(uri.substring(i, j));
- i = j;
-
- if (i < uri.length() && uri.charAt(i) == SEGMENT_SEPARATOR)
- {
- if (!segmentsRemain(uri, ++i)) segmentList.add(SEGMENT_EMPTY);
- }
- }
- segments = new String[segmentList.size()];
- segmentList.toArray(segments);
- }
-
- if (i < uri.length() && uri.charAt(i) == QUERY_SEPARATOR)
- {
- j = findSeparator(uri, ++i, new char[] { FRAGMENT_SEPARATOR });
- query = uri.substring(i, j);
- i = j;
- }
-
- if (i < uri.length()) // && uri.charAt(i) == FRAGMENT_SEPARATOR (implied)
- {
- fragment = uri.substring(++i);
- }
-
- return new URI(hierarchical, scheme, authority, device, absolutePath,
- segments, query, fragment);
- }
-
- /**
- * Static factory method based on parsing File path string, with
- * <a href="#device_explaination">explicit device support</a> enabled.
- * Note that validity testing is not a strict as in the RFC; essentially,
- * only separator characters are considered. So, for example, non-Latin
- * alphabet characters appearing in a path segment would not be considered an
- * error.
- * @exception java.lang.IllegalArgumentException if any component parsed
- * from <code>uri</code> is not valid according to {@link #validScheme},
- * {@link #validOpaquePart}, {@link #validAuthority}, {@link
- * #validDevice}, {@link #validSegments}, {@link #validQuery}, or {@link
- * #validFragment}, as appropriate.
- */
- public static URI createFileURI(String pathName)
- {
- File file = new File(pathName);
- String uri = File.separatorChar != '/' ? pathName.replace(File.separatorChar, SEGMENT_SEPARATOR) : pathName;
- if (file.isAbsolute())
- {
- URI result = parseIntoURI((uri.charAt(0) == SEGMENT_SEPARATOR ? "file:" : "file:/") + uri);
- return result;
- }
- else
- {
- URI result = parseIntoURI(uri);
- if (result.scheme() != null)
- {
- throw new IllegalArgumentException("invalid relative pathName: " + pathName);
- }
- return result;
- }
- }
-
- /**
- * Static factory method based on parsing a platform-relative path string.
- * The <code>pathName</code> must be of the form
- *<pre>
- * /project-name/path
- *</pre>
- * and the result will be of the form
- *<pre>
- * platform:/resource/project-name/path
- *</pre>
- * The leading separator of the path will be provided if not present.
- * This scheme supports relocatable projects in Eclipse and in stand-alone EMF.
- * @exception java.lang.IllegalArgumentException if any component parsed
- * from <code>uri</code> is not valid according to {@link #validScheme},
- * {@link #validOpaquePart}, {@link #validAuthority}, {@link
- * #validDevice}, {@link #validSegments}, {@link #validQuery}, or {@link
- * #validFragment}, as appropriate.
- * @see org.eclipse.core.runtime.Platform#resolve
- */
- public static URI createPlatformResourceURI(String pathName)
- {
- URI result = parseIntoURI((pathName.charAt(0) == SEGMENT_SEPARATOR ? "platform:/resource" : "platform:/resource/") + pathName);
- return result;
- }
-
- // Checks whether the string contains any more segments after the one that
- // starts at position i.
- private static boolean segmentsRemain(String uri, int i)
- {
- return i < uri.length() && uri.charAt(i) != QUERY_SEPARATOR &&
- uri.charAt(i) != FRAGMENT_SEPARATOR;
- }
-
- // Finds the next occurance of one of the characters specified in
- // separators in the given URI, beginning at index i. The index of the
- // first separator, or uri.length() if there is no such character, is
- // returned. Before searching, i is limited to be in the range
- // [0, uri.length()].
- private static int findSeparator(String uri, int i, char[] separators)
- {
- int len = uri.length();
- if (i >= len) return len;
-
- outerLoop: for (i = i > 0 ? i : 0; i < len; i++)
- {
- for (int j = 0, slen = separators.length; j < slen; j++)
- {
- if (uri.charAt(i) == separators[j]) break outerLoop;
- }
- }
- return i;
- }
-
- // Private constructor for use of static factory methods. Does validation
- // of each component, but assumes that the inter-component requirements
- // described in the factory doc-comments are all satisfied.
- private URI(boolean hierarchical, String scheme, String authority,
- String device, boolean absolutePath, String[] segments,
- String query, String fragment)
- {
- String name = null;
- String value = null;
-
- if (!validScheme(scheme))
- {
- throw new IllegalArgumentException("invalid scheme: " + scheme);
- }
- if (!hierarchical && !validOpaquePart(authority))
- {
- throw new IllegalArgumentException("invalid opaquePart: " + authority);
- }
- if (hierarchical && !validAuthority(authority))
- {
- throw new IllegalArgumentException("invalid authority: " + authority);
- }
- if (!validDevice(device))
- {
- throw new IllegalArgumentException("invalid device: " + device);
- }
- if (!validSegments(segments))
- {
- String s = segments == null ? "invalid segments: " + segments :
- "invalid segment: " + firstInvalidSegment(segments);
- throw new IllegalArgumentException(s);
- }
- if (!validQuery(query))
- {
- throw new IllegalArgumentException("invalid query: " + query);
- }
- if (!validFragment(fragment))
- {
- throw new IllegalArgumentException("invalid fragment: " + fragment);
- }
-
- int hashCode = 0;
- if (hierarchical)
- {
- ++hashCode;
- }
- if (absolutePath)
- {
- hashCode += 2;
- }
- if (scheme != null)
- {
- hashCode ^= scheme.hashCode();
- }
- if (authority != null)
- {
- hashCode ^= authority.hashCode();
- }
- if (device != null)
- {
- hashCode ^= device.hashCode();
- }
- if (query != null)
- {
- hashCode ^= query.hashCode();
- }
- if (fragment != null)
- {
- hashCode ^= fragment.hashCode();
- }
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- hashCode ^= segments[i].hashCode();
- }
-
- this.hashCode = hashCode;
- this.hierarchical = hierarchical;
- this.scheme = scheme;
- this.authority = authority;
- this.device = device;
- this.absolutePath = absolutePath;
- this.segments = segments;
- this.query = query;
- this.fragment = fragment;
- }
-
- // Searches the specified string for any of the specified target
- // characters, and if any occur, returns true; false otherwise.
- private static boolean contains(String s, char[] targets)
- {
- for (int i = 0, len = s.length(); i < len; i++)
- {
- for (int j = 0, tlen = targets.length; j < tlen; j++)
- {
- if (s.charAt(i) == targets[j]) return true;
- }
- }
- return false;
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the scheme component of a URI; <code>false</code> otherwise.
- *
- * <p>A valid scheme may be null or contain any characters except for the
- * following: <code>: / ? #</code>
- */
- public static boolean validScheme(String value)
- {
- return value == null || !contains(value, MAJOR_SEPARATORS);
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the opaque part component of a URI; <code>false</code>
- * otherwise.
- *
- * <p>A valid opaque part must be non-null, non-empty, and not contain the
- * <code>#</code> character. In addition, its first character must not be
- * <code>/</code>
- */
- public static boolean validOpaquePart(String value)
- {
- return value != null && value.indexOf(FRAGMENT_SEPARATOR) == -1 &&
- value.length() > 0 && value.charAt(0) != SEGMENT_SEPARATOR;
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the authority component of a URI; <code>false</code> otherwise.
- *
- * <p>A valid authority may be null or contain any characters except for
- * the following: <code>/ ? #</code>
- */
- public static boolean validAuthority(String value)
- {
- return value == null || !contains(value, SEGMENT_END);
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the device component of a URI; <code>false</code> otherwise.
- *
- * <p>A valid device may be null or non-empty, containing any characters
- * except for the following: <code>/ ? #</code> In addition, its last
- * character must be <code>:</code>
- */
- public static boolean validDevice(String value)
- {
- if (value == null) return true;
- int len = value.length();
- return len > 0 && value.charAt(len - 1) == DEVICE_IDENTIFIER &&
- !contains(value, SEGMENT_END);
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * a valid path segment of a URI; <code>false</code> otherwise.
- *
- * <p>A valid path segment must be non-null and not contain any of the
- * following characters: <code>/ ? #</code>
- */
- public static boolean validSegment(String value)
- {
- return value != null && !contains(value, SEGMENT_END);
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * a valid path segment array of a URI; <code>false</code> otherwise.
- *
- * <p>A valid path segment array must be non-null and contain only path
- * segements that are valid, according to {@link #validSegment}.
- */
- public static boolean validSegments(String[] value)
- {
- if (value == null) return false;
- for (int i = 0, len = value.length; i < len; i++)
- {
- if (!validSegment(value[i])) return false;
- }
- return true;
- }
-
- // Returns null if the specicied value is null or would be a valid path
- // segment array of a URI; otherwise, the value of the first invalid
- // segment.
- private static String firstInvalidSegment(String[] value)
- {
- if (value == null) return null;
- for (int i = 0, len = value.length; i < len; i++)
- {
- if (!validSegment(value[i])) return value[i];
- }
- return null;
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the query component of a URI; <code>false</code> otherwise.
- *
- * <p>A valid query may be null or contain any characters except for
- * <code>#</code>
- */
- public static boolean validQuery(String value)
- {
- return value == null || value.indexOf(FRAGMENT_SEPARATOR) == -1;
- }
-
- /**
- * Returns <code>true</code> if the specified <code>value</code> would be
- * valid as the fragment component of a URI; <code>false</code> otherwise.
- *
- * <p>A fragment is taken to be unconditionally valid.
- */
- public static boolean validFragment(String value)
- {
- return true;
- }
-
- /**
- * Returns <code>true</code> if this is a relative URI, or
- * <code>false</code> if it is an absolute URI.
- */
- public boolean isRelative()
- {
- return scheme == null;
- }
-
- /**
- * Returns <code>true</code> if this a a hierarchical URI, or
- * <code>false</code> if it is of the generic form.
- */
- public boolean isHierarchical()
- {
- return hierarchical;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarcical URI with an authority
- * component; <code>false</code> otherwise.
- */
- public boolean hasAuthority()
- {
- return hierarchical && authority != null;
- }
-
- /**
- * Returns <code>true</code> if this is a non-hierarchical URI with an
- * opaque part component; <code>false</code> otherwise.
- */
- public boolean hasOpaquePart()
- {
- // note: hierarchical -> authority != null
- return !hierarchical;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with a device
- * component; <code>false</code> otherwise.
- */
- public boolean hasDevice()
- {
- // note: device != null -> hierarchical
- return device != null;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with an
- * absolute or relative path; <code>false</code> otherwise.
- */
- public boolean hasPath()
- {
- // note: (absolutePath || authority == null) -> hierarchical
- // (authority == null && device == null && !absolutePath) -> scheme == null
- return absolutePath || (authority == null && device == null);
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with an
- * absolute path, or <code>false</code> if it is non-hierarchical, has no
- * path, or has a relative path.
- */
- public boolean hasAbsolutePath()
- {
- // note: absolutePath -> hierarchical
- return absolutePath;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with a relative
- * path, or <code>false</code> if it is non-hierarchical, has no path, or
- * has an absolute path.
- */
- public boolean hasRelativePath()
- {
- // note: authority == null -> hierarchical
- // (authority == null && device == null && !absolutePath) -> scheme == null
- return authority == null && device == null && !absolutePath;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with an empty
- * relative path; <code>false</code> otherwise.
- *
- * <p>Note that <code>!hasEmpty()</code> does <em>not</em> imply that this
- * URI has any path segments; however, <code>hasRelativePath &&
- * !hasEmptyPath()</code> does.
- */
- public boolean hasEmptyPath()
- {
- // note: authority == null -> hierarchical
- // (authority == null && device == null && !absolutePath) -> scheme == null
- return authority == null && device == null && !absolutePath &&
- segments.length == 0;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI with a query
- * component; <code>false</code> otherwise.
- */
- public boolean hasQuery()
- {
- // note: query != null -> hierarchical
- return query != null;
- }
-
- /**
- * Returns <code>true</code> if this URI has a fragment component;
- * <code>false</code> otherwise.
- */
- public boolean hasFragment()
- {
- return fragment != null;
- }
-
- /**
- * Returns <code>true</code> if this is a current document reference; that
- * is, if it is a relative hierarchical URI with no authority, device or
- * query components, and no path segments; <code>false</code> is returned
- * otherwise.
- */
- public boolean isCurrentDocumentReference()
- {
- // note: authority == null -> hierarchical
- // (authority == null && device == null && !absolutePath) -> scheme == null
- return authority == null && device == null && !absolutePath &&
- segments.length == 0 && query == null;
- }
-
- /**
- * Returns <code>true</code> if this is a {@link
- * #isCurrentDocumentReference() current document reference} with no
- * fragment component; <code>false</code> otherwise.
- *
- * @see #isCurrentDocumentReference()
- */
- public boolean isEmpty()
- {
- // note: authority == null -> hierarchical
- // (authority == null && device == null && !absolutePath) -> scheme == null
- return authority == null && device == null && !absolutePath &&
- segments.length == 0 && query == null && fragment == null;
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI that may refer
- * directly to a locally accessible file. This is considered to be the
- * case for a file-scheme absolute URI, or for a relative URI with no query;
- * <code>false</code> is returned otherwise.
- */
- public boolean isFile()
- {
- return isHierarchical() &&
- ((isRelative() && !hasQuery()) || SCHEME_FILE.equalsIgnoreCase(scheme));
- }
-
- /**
- * Returns the hash code.
- */
- public int hashCode()
- {
- return hashCode;
- }
-
- /**
- * Returns <code>true</code> if <code>obj</code> is an instance of
- * <code>URI</code> equal to this one; <code>false</code> otherwise.
- *
- * <p>Equality is determined strictly by comparing components, not by
- * attempting to interpret what resource is being identified.
- */
- public boolean equals(Object obj)
- {
- if (this == obj) return true;
- if (!(obj instanceof URI)) return false;
- URI uri = (URI) obj;
-
- return hashCode == uri.hashCode() &&
- hierarchical == uri.isHierarchical() &&
- absolutePath == uri.hasAbsolutePath() &&
- equals(scheme, uri.scheme()) &&
- equals(authority, hierarchical ? uri.authority() : uri.opaquePart()) &&
- equals(device, uri.device()) &&
- equals(query, uri.query()) &&
- equals(fragment, uri.fragment()) &&
- segmentsEqual(uri);
- }
-
- // Tests whether this URI's path segment array is equal to that of the
- // given uri.
- private boolean segmentsEqual(URI uri)
- {
- if (segments.length != uri.segmentCount()) return false;
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (!segments[i].equals(uri.segment(i))) return false;
- }
- return true;
- }
-
- // Tests two objects for equality, tolerating nulls; null is considered
- // to be a valid value that is only equal to itself.
- private static boolean equals(Object o1, Object o2)
- {
- return o1 == null ? o2 == null : o1.equals(o2);
- }
-
- /**
- * If this is an absolute URI, returns the scheme component;
- * <code>null</code> otherwise.
- */
- public String scheme()
- {
- return scheme;
- }
-
- /**
- * If this is a non-hierarchical URI, returns the opaque part component;
- * <code>null</code> otherwise.
- */
- public String opaquePart()
- {
- return isHierarchical() ? null : authority;
- }
-
- /**
- * If this is a hierarchical URI with an authority component, returns it;
- * <code>null</code> otherwise.
- */
- public String authority()
- {
- return isHierarchical() ? authority : null;
- }
-
- /**
- * If this is a hierarchical URI with an authority component that has a
- * user info portion, returns it; <code>null</code> otherwise.
- */
- public String userInfo()
- {
- if (!hasAuthority()) return null;
-
- int i = authority.indexOf(USER_INFO_SEPARATOR);
- return i < 0 ? null : authority.substring(0, i);
- }
-
- /**
- * If this is a hierarchical URI with an authority component that has a
- * host portion, returns it; <code>null</code> otherwise.
- */
- public String host()
- {
- if (!hasAuthority()) return null;
-
- int i = authority.indexOf(USER_INFO_SEPARATOR);
- int j = authority.indexOf(PORT_SEPARATOR);
- return j < 0 ? authority.substring(i + 1) : authority.substring(i + 1, j);
- }
-
- /**
- * If this is a hierarchical URI with an authority component that has a
- * port portion, returns it; <code>null</code> otherwise.
- */
- public String port()
- {
- if (!hasAuthority()) return null;
-
- int i = authority.indexOf(PORT_SEPARATOR);
- return i < 0 ? null : authority.substring(i + 1);
- }
-
- /**
- * If this is a hierarchical URI with a device component, returns it;
- * <code>null</code> otherwise.
- */
- public String device()
- {
- return device;
- }
-
- /**
- * If this is a hierarchical URI with a path, returns an array containing
- * the segments of the path; an empty array otherwise. The leading
- * separator in an absolute path is not represented in this array, but a
- * trailing separator is represented by an empty-string segment as the
- * final element.
- */
- public String[] segments()
- {
- return (String[])segments.clone();
- }
-
- /**
- * Returns an unmodifiable list containing the same segments as the array
- * returned by {@link #segments()}.
- */
- public List segmentsList()
- {
- return Collections.unmodifiableList(Arrays.asList(segments));
- }
-
- /**
- * Returns the number of elements in the segment array that would be
- * returned by {@link #segments()}.
- */
- public int segmentCount()
- {
- return segments.length;
- }
-
- /**
- * Provides fast, indexed access to individual segments in the path
- * segment array.
- *
- * @exception java.lang.IndexOutOfBoundsException if <code>i < 0</code> or
- * <code>i >= segmentCount()</code>.
- */
- public String segment(int i)
- {
- return segments[i];
- }
-
- /**
- * Returns the last segment in the segment array, or <code>null</code>.
- */
- public String lastSegment()
- {
- int len = segments.length;
- if (len == 0) return null;
- return segments[len - 1];
- }
-
- /**
- * If this is a hierarchical URI with a path, returns a string
- * representation of the path; <code>null</code> otherwise. The path
- * consists of a leading segment separator character (a slash), if the
- * path is absolute, followed by the slash-separated path segments. If
- * this URI has a separate <a href="#device_explaination">device
- * component</a>, it is <em>not</em> included in the path. If it has a
- * device stored as a path segment, it is included.
- */
- public String path()
- {
- if (!hasPath()) return null;
-
- StringBuffer result = new StringBuffer();
- if (hasAbsolutePath()) result.append(SEGMENT_SEPARATOR);
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (i != 0) result.append(SEGMENT_SEPARATOR);
- result.append(segments[i]);
- }
- return result.toString();
- }
-
- /**
- * If this is a hierarchical URI with a path, returns a string
- * representation of the path, including the authority and the
- * <a href="#device_explaination">device component</a>;
- * <code>null</code> otherwise.
- * <p>The format of this string is
- * <pre>
- * //authority/device/pathSegment1/pathSegment2...
- *</pre>
- */
- public String devicePath()
- {
- if (!hasPath()) return null;
-
- StringBuffer result = new StringBuffer();
- if (hasAuthority())
- {
- result.append(SEGMENT_SEPARATOR);
- result.append(SEGMENT_SEPARATOR);
- result.append(authority);
-
- if (hasDevice()) result.append(SEGMENT_SEPARATOR);
- }
-
- if (hasDevice()) result.append(device);
- if (hasAbsolutePath()) result.append(SEGMENT_SEPARATOR);
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (i != 0) result.append(SEGMENT_SEPARATOR);
- result.append(segments[i]);
- }
- return result.toString();
- }
-
- /**
- * If this is a hierarchical URI with a query component, returns it;
- * <code>null</code> otherwise.
- */
- public String query()
- {
- return query;
- }
-
-
- /**
- * Returns the URI formed from this URI and the given query.
- *
- * @exception java.lang.IllegalArgumentException if
- * <code>query</code> is not a valid query (portion) according
- * to {@link #validQuery}.
- */
- public URI appendQuery(String query)
- {
- if (!validQuery(query))
- {
- throw new IllegalArgumentException(
- "invalid query portion: " + query);
- }
- return new URI(hierarchical, scheme, authority, device, absolutePath, segments, query, fragment);
- }
-
- /**
- * If this URI has a non-null {@link #query}, returns the URI
- * formed by removing it; this URI unchanged, otherwise.
- */
- public URI trimQuery()
- {
- if (query == null)
- {
- return this;
- }
- else
- {
- return new URI(hierarchical, scheme, authority, device, absolutePath, segments, null, fragment);
- }
- }
-
- /**
- * If this URI has a fragment component, returns it; <code>null</code>
- * otherwise.
- */
- public String fragment()
- {
- return fragment;
- }
-
- /**
- * Returns the URI formed from this URI and the given fragment.
- *
- * @exception java.lang.IllegalArgumentException if
- * <code>fragment</code> is not a valid fragment (portion) according
- * to {@link #validFragment}.
- */
- public URI appendFragment(String fragment)
- {
- if (!validFragment(fragment))
- {
- throw new IllegalArgumentException(
- "invalid fragment portion: " + fragment);
- }
- URI result = new URI(hierarchical, scheme, authority, device, absolutePath, segments, query, fragment);
- result.cachedTrimFragment = this;
- return result;
- }
-
- /**
- * If this URI has a non-null {@link #fragment}, returns the URI
- * formed by removing it; this URI unchanged, otherwise.
- */
- public URI trimFragment()
- {
- if (fragment == null)
- {
- return this;
- }
- else if (cachedTrimFragment == null)
- {
- cachedTrimFragment = new URI(hierarchical, scheme, authority, device, absolutePath, segments, query, null);
- }
-
- return cachedTrimFragment;
- }
-
- /**
- * Resolves this URI reference against a <code>base</code> absolute
- * hierarchical URI, returning the resulting absolute URI. If already
- * absolute, the URI itself is returned. URI resolution is described in
- * detail in section 5.2 of <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC
- * 2396</a>, "Resolving Relative References to Absolute Form."
- *
- * <p>During resolution, empty segments, self references ("."), and parent
- * references ("..") are interpreted, so that they can be removed from the
- * path. Step 6(g) gives a choice of how to handle the case where parent
- * references point to a path above the root: the offending segments can
- * be preserved or discarded. This method preserves them. To have them
- * discarded, please use the {@link #resolve(URI, boolean)} method.
- *
- * @exception java.lang.IllegalArgumentException if <code>base</code> is
- * non-hierarchical or is relative.
- */
- public URI resolve(URI base)
- {
- return resolve(base, true);
- }
-
- /**
- * Resolves this URI reference against a <code>base</code> absolute
- * hierarchical URI, returning the resulting absolute URI. If already
- * absolute, the URI itself is returned. URI resolution is described in
- * detail in section 5.2 of <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC
- * 2396</a>, "Resolving Relative References to Absolute Form."
- *
- * <p>During resultion, empty segments, self references ("."), and parent
- * references ("..") are interpreted, so that they can be removed from the
- * path. Step 6(g) gives a choice of how to handle the case where parent
- * references point to a path above the root: the offending segments can
- * be preserved or discarded. This method can do either.
- *
- * @param preserveRootParent <code>true</code> if segments refering to the
- * parent of the root path are to be preserved; <code>false</code> if they
- * are to be discarded.
- *
- * @exception java.lang.IllegalArgumentException if <code>base</code> is
- * non-hierarchical or is relative.
- */
- public URI resolve(URI base, boolean preserveRootParents)
- {
- if (!base.isHierarchical() || base.isRelative())
- {
- throw new IllegalArgumentException(
- "resolve against non-hierarchical or relative base");
- }
-
- // an absolute URI needs no resolving
- if (!isRelative()) return this;
-
- // note: isRelative() -> hierarchical
-
- String newAuthority = authority;
- String newDevice = device;
- boolean newAbsolutePath = absolutePath;
- String[] newSegments = segments;
- String newQuery = query;
- // note: it's okay for two URIs to share a segments array, since
- // neither will ever modify it
-
- if (authority == null)
- {
- // no authority: use base's
- newAuthority = base.authority();
-
- if (device == null)
- {
- // no device: use base's
- newDevice = base.device();
-
- if (hasEmptyPath() && query == null)
- {
- // current document reference: use base path and query
- newAbsolutePath = base.hasAbsolutePath();
- newSegments = base.segments();
- newQuery = base.query();
- }
- else if (hasRelativePath())
- {
- // relative path: merge with base and keep query (note: if the
- // base has no path and this a non-empty relative path, there is
- // an implied root in the resulting path)
- newAbsolutePath = base.hasAbsolutePath() || !hasEmptyPath();
- newSegments = newAbsolutePath ? mergePath(base, preserveRootParents)
- : NO_SEGMENTS;
- }
- // else absolute path: keep it and query
- }
- // else keep device, path, and query
- }
- // else keep authority, device, path, and query
-
- // always keep fragment, even if null, and use scheme from base
- return new URI(true, base.scheme(), newAuthority, newDevice,
- newAbsolutePath, newSegments, newQuery, fragment);
- }
-
- // Merges this URI's relative path with the base non-relative path. If
- // base has no path, treat it as the root absolute path, unless this has
- // no path either.
- private String[] mergePath(URI base, boolean preserveRootParents)
- {
- if (base.hasRelativePath())
- {
- throw new IllegalArgumentException("merge against relative path");
- }
- if (!hasRelativePath())
- {
- throw new IllegalStateException("merge non-relative path");
- }
-
- int baseSegmentCount = base.segmentCount();
- int segmentCount = segments.length;
- String[] stack = new String[baseSegmentCount + segmentCount];
- int sp = 0;
-
- // use a stack to accumulate segments of base, except for the last
- // (i.e. skip trailing separator and anything following it), and of
- // relative path
- for (int i = 0; i < baseSegmentCount - 1; i++)
- {
- sp = accumulate(stack, sp, base.segment(i), preserveRootParents);
- }
-
- for (int i = 0; i < segmentCount; i++)
- {
- sp = accumulate(stack, sp, segments[i], preserveRootParents);
- }
-
- // if the relative path is empty or ends in an empty segment, a parent
- // reference, or a self referenfce, add a trailing separator to a
- // non-empty path
- if (sp > 0 && (segmentCount == 0 ||
- SEGMENT_EMPTY.equals(segments[segmentCount - 1]) ||
- SEGMENT_PARENT.equals(segments[segmentCount - 1]) ||
- SEGMENT_SELF.equals(segments[segmentCount - 1])))
- {
- stack[sp++] = SEGMENT_EMPTY;
- }
-
- // return a correctly sized result
- String[] result = new String[sp];
- System.arraycopy(stack, 0, result, 0, sp);
- return result;
- }
-
- // Adds a segment to a stack, skipping empty segments and self references,
- // and interpreting parent references.
- private static int accumulate(String[] stack, int sp, String segment,
- boolean preserveRootParents)
- {
- if (SEGMENT_PARENT.equals(segment))
- {
- if (sp == 0)
- {
- // special care must be taken for a root's parent reference: it is
- // either ignored or the symbolic reference itself is pushed
- if (preserveRootParents) stack[sp++] = segment;
- }
- else
- {
- // unless we're already accumulating root parent references,
- // parent references simply pop the last segment descended
- if (SEGMENT_PARENT.equals(stack[sp - 1])) stack[sp++] = segment;
- else sp--;
- }
- }
- else if (!SEGMENT_EMPTY.equals(segment) && !SEGMENT_SELF.equals(segment))
- {
- // skip empty segments and self references; push everything else
- stack[sp++] = segment;
- }
- return sp;
- }
-
- /**
- * Finds the shortest relative or, if necessary, the absolute URI that,
- * when resolved against the given <code>base</code> absolute hierarchical
- * URI using {@link #resolve(URI)}, will yield this absolute URI.
- *
- * @exception java.lang.IllegalArgumentException if <code>base</code> is
- * non-hierarchical or is relative.
- * @exception java.lang.IllegalStateException if <code>this</code> is
- * relative.
- */
- public URI deresolve(URI base)
- {
- return deresolve(base, true, false, true);
- }
-
- /**
- * Finds an absolute URI that, when resolved against the given
- * <code>base</code> absolute hierarchical URI using {@link #resolve(URI,
- * boolean)}, will yield this absolute URI.
- *
- * @param preserveRootParents the boolean argument to <code>resolve(URI,
- * boolean)</code> for which the returned URI should resolve to this URI.
- * @param anyRelPath if <code>true</code>, the returned URI's path (if
- * any) will be relative, if possible. If <code>false</code>, the form of
- * the result's path will depend upon the next parameter.
- * @param shorterRelPath if <code>anyRelPath</code> is <code>false</code>
- * and this parameter is <code>true</code>, the returned URI's path (if
- * any) will be relative, if one can be found that is no longer (by number
- * of segments) than the absolute path. If both <code>anyRelPath</code>
- * and this parameter are <code>false</code>, it will be absolute.
- *
- * @exception java.lang.IllegalArgumentException if <code>base</code> is
- * non-hierarchical or is relative.
- * @exception java.lang.IllegalStateException if <code>this</code> is
- * relative.
- */
- public URI deresolve(URI base, boolean preserveRootParents,
- boolean anyRelPath, boolean shorterRelPath)
- {
- if (!base.isHierarchical() || base.isRelative())
- {
- throw new IllegalArgumentException(
- "deresolve against non-hierarchical or relative base");
- }
- if (isRelative())
- {
- throw new IllegalStateException("deresolve relative URI");
- }
-
- // note: these assertions imply that neither this nor the base URI has a
- // relative path; thus, both have either an absolute path or no path
-
- // different scheme: need complete, absolute URI
- if (!scheme.equals(base.scheme())) return this;
-
- // since base must be hierarchical, and since a non-hierarchical URI
- // must have both scheme and opaque part, the complete absolute URI is
- // needed to resolve to a non-hierarchical URI
- if (!isHierarchical()) return this;
-
- String newAuthority = authority;
- String newDevice = device;
- boolean newAbsolutePath = absolutePath;
- String[] newSegments = segments;
- String newQuery = query;
-
- if (equals(authority, base.authority()) &&
- (hasDevice() || hasPath() || (!base.hasDevice() && !base.hasPath())))
- {
- // matching authorities and no device or path removal
- newAuthority = null;
-
- if (equals(device, base.device()) && (hasPath() || !base.hasPath()))
- {
- // matching devices and no path removal
- newDevice = null;
-
- // exception if (!hasPath() && base.hasPath())
-
- if (!anyRelPath && !shorterRelPath)
- {
- // user rejects a relative path: keep absolute or no path
- }
- else if (hasPath() == base.hasPath() && segmentsEqual(base) &&
- equals(query, base.query()))
- {
- // current document reference: keep no path or query
- newAbsolutePath = false;
- newSegments = NO_SEGMENTS;
- newQuery = null;
- }
- else if (!hasPath() && !base.hasPath())
- {
- // no paths: keep query only
- newAbsolutePath = false;
- newSegments = NO_SEGMENTS;
- }
- // exception if (!hasAbsolutePath())
- else if (hasCollapsableSegments(preserveRootParents))
- {
- // path form demands an absolute path: keep it and query
- }
- else
- {
- // keep query and select relative or absolute path based on length
- String[] rel = findRelativePath(base, preserveRootParents);
- if (anyRelPath || segments.length > rel.length)
- {
- // user demands a relative path or the absolute path is longer
- newAbsolutePath = false;
- newSegments = rel;
- }
- // else keep shorter absolute path
- }
- }
- // else keep device, path, and query
- }
- // else keep authority, device, path, and query
-
- // always include fragment, even if null
- return new URI(true, null, newAuthority, newDevice, newAbsolutePath,
- newSegments, newQuery, fragment);
- }
-
- // Returns true if the non-relative path includes segments that would be
- // collapsed when resolving; false otherwise. If preserveRootParents is
- // true, collapsable segments include any empty segments, except for the
- // last segment, as well as and parent and self references. If
- // preserveRootsParents is false, parent references are not collapsable if
- // they are the first segment or preceeded only by other parent
- // references.
- private boolean hasCollapsableSegments(boolean preserveRootParents)
- {
- if (hasRelativePath())
- {
- throw new IllegalStateException("test collapsability of relative path");
- }
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- String segment = segments[i];
- if ((i < len - 1 && SEGMENT_EMPTY.equals(segment)) ||
- SEGMENT_SELF.equals(segment) ||
- SEGMENT_PARENT.equals(segment) && (
- !preserveRootParents || (
- i != 0 && !SEGMENT_PARENT.equals(segments[i - 1]))))
- {
- return true;
- }
- }
- return false;
- }
-
- // Returns the shortest relative path between the the non-relative path of
- // the given base and this absolute path. If the base has no path, it is
- // treated as the root absolute path.
- private String[] findRelativePath(URI base, boolean preserveRootParents)
- {
- if (base.hasRelativePath())
- {
- throw new IllegalArgumentException(
- "find relative path against base with relative path");
- }
- if (!hasAbsolutePath())
- {
- throw new IllegalArgumentException(
- "find relative path of non-absolute path");
- }
-
- // treat an empty base path as the root absolute path
- String[] startPath = base.collapseSegments(preserveRootParents);
- String[] endPath = segments;
-
- // drop last segment from base, as in resolving
- int startCount = startPath.length > 0 ? startPath.length - 1 : 0;
- int endCount = endPath.length;
-
- // index of first segment that is different between endPath and startPath
- int diff = 0;
-
- // if endPath is shorter than startPath, the last segment of endPath may
- // not be compared: because startPath has been collapsed and had its
- // last segment removed, all preceeding segments can be considered non-
- // empty and followed by a separator, while the last segment of endPath
- // will either be non-empty and not followed by a separator, or just empty
- for (int count = startCount < endCount ? startCount : endCount - 1;
- diff < count && startPath[diff].equals(endPath[diff]); diff++);
-
- int upCount = startCount - diff;
- int downCount = endCount - diff;
-
- // a single separator, possibly preceeded by some parent reference
- // segments, is redundant
- if (downCount == 1 && SEGMENT_EMPTY.equals(endPath[endCount - 1]))
- {
- downCount = 0;
- }
-
- // an empty path needs to be replaced by a single "." if there is no
- // query, to distinguish it from a current document reference
- if (upCount + downCount == 0)
- {
- if (query == null) return new String[] { SEGMENT_SELF };
- return NO_SEGMENTS;
- }
-
- // return a correctly sized result
- String[] result = new String[upCount + downCount];
- Arrays.fill(result, 0, upCount, SEGMENT_PARENT);
- System.arraycopy(endPath, diff, result, upCount, downCount);
- return result;
- }
-
- // Collapses non-ending empty segments, parent references, and self
- // references in a non-relative path, returning the same path that would
- // be produced from the base hierarchical URI as part of a resolve.
- String[] collapseSegments(boolean preserveRootParents)
- {
- if (hasRelativePath())
- {
- throw new IllegalStateException("collapse relative path");
- }
-
- if (!hasCollapsableSegments(preserveRootParents)) return segments();
-
- // use a stack to accumulate segments
- int segmentCount = segments.length;
- String[] stack = new String[segmentCount];
- int sp = 0;
-
- for (int i = 0; i < segmentCount; i++)
- {
- sp = accumulate(stack, sp, segments[i], preserveRootParents);
- }
-
- // if the path is non-empty and originally ended in an empty segment, a
- // parent reference, or a self reference, add a trailing separator
- if (sp > 0 && (SEGMENT_EMPTY.equals(segments[segmentCount - 1]) ||
- SEGMENT_PARENT.equals(segments[segmentCount - 1]) ||
- SEGMENT_SELF.equals(segments[segmentCount - 1])))
- {
- stack[sp++] = SEGMENT_EMPTY;
- }
-
- // return a correctly sized result
- String[] result = new String[sp];
- System.arraycopy(stack, 0, result, 0, sp);
- return result;
- }
-
- /**
- * Returns the string representation of this URI. For a generic,
- * non-hierarchical URI, this looks like:
- *
- * <pre>
- * scheme:opaquePart#fragment</pre>
- *
- * <p>For a hierarchical URI, it looks like:
- * <pre>
- * scheme://authority/device/pathSegment1/pathSegment2...?query#fragment</pre>
- *
- * <p>Of course, absent components and their separators will be omitted.
- */
- public String toString()
- {
- if (cachedToString == null)
- {
- StringBuffer result = new StringBuffer();
- if (!isRelative())
- {
- result.append(scheme);
- result.append(SCHEME_SEPARATOR);
- }
-
- if (isHierarchical())
- {
- if (hasAuthority())
- {
- result.append(AUTHORITY_SEPARATOR);
- result.append(authority);
- }
-
- if (hasDevice())
- {
- result.append(SEGMENT_SEPARATOR);
- result.append(device);
- }
-
- if (hasAbsolutePath()) result.append(SEGMENT_SEPARATOR);
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (i != 0) result.append(SEGMENT_SEPARATOR);
- result.append(segments[i]);
- }
-
- if (hasQuery())
- {
- result.append(QUERY_SEPARATOR);
- result.append(query);
- }
- }
- else
- {
- result.append(authority);
- }
-
- if (hasFragment())
- {
- result.append(FRAGMENT_SEPARATOR);
- result.append(fragment);
- }
- cachedToString = result.toString();
- }
- return cachedToString;
- }
-
- // Returns a string representation of this URI for debugging, explicitly
- // showing each of the components.
- String toString(boolean includeSimpleForm)
- {
- StringBuffer result = new StringBuffer();
- if (includeSimpleForm) result.append(toString());
- result.append("\n hierarchical: ");
- result.append(hierarchical);
- result.append("\n scheme: ");
- result.append(scheme);
- result.append("\n authority: ");
- result.append(authority);
- result.append("\n device: ");
- result.append(device);
- result.append("\n absolutePath: ");
- result.append(absolutePath);
- result.append("\n segments: ");
- if (segments.length == 0) result.append("<empty>");
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (i > 0) result.append("\n ");
- result.append(segments[i]);
- }
- result.append("\n query: ");
- result.append(query);
- result.append("\n fragment: ");
- result.append(fragment);
- return result.toString();
- }
-
- /**
- * If this URI may refer directly to a locally accessible file, as
- * determined by {@link #isFile()}, returns the URI formatted as a
- * pathname to that file; null otherwise.
- *
- * <p>The format of this string is
- * <pre>
- * //authority/device/pathSegment1/pathSegment2...</pre>
- *
- * <p>However, the character used as a separator is system-dependant and
- * obtained from {@link java.io.File#separatorChar}.
- */
- public String toFileString()
- {
- if (!isFile()) return null;
-
- StringBuffer result = new StringBuffer();
- char separator = File.separatorChar;
-
- if (hasAuthority())
- {
- result.append(separator);
- result.append(separator);
- result.append(authority);
-
- if (hasDevice()) result.append(separator);
- }
-
- if (hasDevice()) result.append(device);
- if (hasAbsolutePath()) result.append(separator);
-
- for (int i = 0, len = segments.length; i < len; i++)
- {
- if (i != 0) result.append(separator);
- result.append(segments[i]);
- }
- return result.toString();
- }
-
- /**
- * Returns the URI formed by appending the specified segment on to the end
- * of the path of this URI, if hierarchical; this URI unchanged,
- * otherwise. If this URI has an authority and/or device, but no path,
- * the segment becomes the first under the root in an absolute path.
- *
- * @exception java.lang.IllegalArgumentException if <code>segment</code>
- * is not a valid segment according to {@link #validSegment}.
- */
- public URI appendSegment(String segment)
- {
- if (!validSegment(segment))
- {
- throw new IllegalArgumentException("invalid segment: " + segment);
- }
-
- if (!isHierarchical()) return this;
-
- // absolute path or no path -> absolute path
- boolean newAbsolutePath = !hasRelativePath();
-
- int len = segments.length;
- String[] newSegments = new String[len + 1];
- System.arraycopy(segments, 0, newSegments, 0, len);
- newSegments[len] = segment;
-
- return new URI(true, scheme, authority, device, newAbsolutePath,
- newSegments, query, fragment);
- }
-
- /**
- * Returns the URI formed by appending the specified segments on to the
- * end of the path of this URI, if hierarchical; this URI unchanged,
- * otherwise. If this URI has an authority and/or device, but no path,
- * the segments are made to form an absolute path.
- *
- * @param segments an array of non-null strings, each representing one
- * segment of the path. If desired, a trailing separator should be
- * represented by an empty-string segment as the last element of the
- * array.
- *
- * @exception java.lang.IllegalArgumentException if <code>segments</code>
- * is not a valid segment array according to {@link #validSegments}.
- */
- public URI appendSegments(String[] segments)
- {
- if (!validSegments(segments))
- {
- String s = segments == null ? "invalid segments: " + segments :
- "invalid segment: " + firstInvalidSegment(segments);
- throw new IllegalArgumentException(s);
- }
-
- if (!isHierarchical()) return this;
-
- // absolute path or no path -> absolute path
- boolean newAbsolutePath = !hasRelativePath();
-
- int len = this.segments.length;
- int segmentsCount = segments.length;
- String[] newSegments = new String[len + segmentsCount];
- System.arraycopy(this.segments, 0, newSegments, 0, len);
- System.arraycopy(segments, 0, newSegments, len, segmentsCount);
-
- return new URI(true, scheme, authority, device, newAbsolutePath,
- newSegments, query, fragment);
- }
-
- /**
- * Returns the URI formed by trimming the specified number of segments
- * (including empty segments, such as one representing a trailing
- * separator) from the end of the path of this URI, if hierarchical;
- * otherwise, this URI is returned unchanged.
- *
- * <p>Note that if all segments are trimmed from an absolute path, the
- * root absolute path remains.
- *
- * @param i the number of segments to be trimmed in the returned URI. If
- * less than 1, this URI is returned unchanged; if equal to or greater
- * than the number of segments in this URI's path, all segments are
- * trimmed.
- */
- public URI trimSegments(int i)
- {
- if (!isHierarchical() || i < 1) return this;
-
- String[] newSegments = NO_SEGMENTS;
- int len = segments.length - i;
- if (len > 0)
- {
- newSegments = new String[len];
- System.arraycopy(segments, 0, newSegments, 0, len);
- }
- return new URI(true, scheme, authority, device, absolutePath,
- newSegments, query, fragment);
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI that has a path
- * that ends with a trailing separator; <code>false</code> otherwise.
- *
- * <p>A trailing separator is represented as an empty segment as the
- * last segment in the path; note that this definition does <em>not</em>
- * include the lone separator in the root absolute path.
- */
- public boolean hasTrailingPathSeparator()
- {
- return segments.length > 0 &&
- SEGMENT_EMPTY.equals(segments[segments.length - 1]);
- }
-
- /**
- * If this is a hierarchical URI whose path includes a file extension,
- * that file extension is returned; null otherwise. We define a file
- * extension as any string following the last period (".") in the final
- * path segment. If there is no path, the path ends in a trailing
- * separator, or the final segment contains no period, then we consider
- * there to be no file extension. If the final segment ends in a period,
- * then the file extension is an empty string.
- */
- public String fileExtension()
- {
- int len = segments.length;
- if (len == 0) return null;
-
- String lastSegment = segments[len - 1];
- int i = lastSegment.lastIndexOf(FILE_EXTENSION_SEPARATOR);
- return i < 0 ? null : lastSegment.substring(i + 1);
- }
-
- /**
- * Returns the URI formed by appending a period (".") followed by the
- * specified file extension to the last path segment of this URI, if it is
- * hierarchical with a non-empty path ending in a non-empty segment;
- * otherwise, this URI is returned unchanged.
-
- * <p>The extension is appended regardless of whether the segment already
- * contains an extension.
- *
- * @exception java.lang.IllegalArgumentException if
- * <code>fileExtension</code> is not a valid segment (portion) according
- * to {@link #validSegment}.
- */
- public URI appendFileExtension(String fileExtension)
- {
- if (!validSegment(fileExtension))
- {
- throw new IllegalArgumentException(
- "invalid segment portion: " + fileExtension);
- }
-
- int len = segments.length;
- if (len == 0) return this;
-
- String lastSegment = segments[len - 1];
- if (SEGMENT_EMPTY.equals(lastSegment)) return this;
- StringBuffer newLastSegment = new StringBuffer(lastSegment);
- newLastSegment.append(FILE_EXTENSION_SEPARATOR);
- newLastSegment.append(fileExtension);
-
- String[] newSegments = new String[len];
- System.arraycopy(segments, 0, newSegments, 0, len - 1);
- newSegments[len - 1] = newLastSegment.toString();
-
- // note: segments.length > 0 -> hierarchical
- return new URI(true, scheme, authority, device, absolutePath,
- newSegments, query, fragment);
- }
-
- /**
- * If this URI has a non-null {@link #fileExtension}, returns the URI
- * formed by removing it; this URI unchanged, otherwise.
- */
- public URI trimFileExtension()
- {
- int len = segments.length;
- if (len == 0) return this;
-
- String lastSegment = segments[len - 1];
- int i = lastSegment.lastIndexOf(FILE_EXTENSION_SEPARATOR);
- if (i < 0) return this;
-
- String newLastSegment = lastSegment.substring(0, i);
- String[] newSegments = new String[len];
- System.arraycopy(segments, 0, newSegments, 0, len - 1);
- newSegments[len - 1] = newLastSegment;
-
- // note: segments.length > 0 -> hierarchical
- return new URI(true, scheme, authority, device, absolutePath,
- newSegments, query, fragment);
- }
-
- /**
- * Returns <code>true</code> if this is a hierarchical URI that ends in a
- * slash; that is, it has a trailing path separator or is the root
- * absolute path, and has no query and no fragment; <code>false</code>
- * is returned otherwise.
- */
- public boolean isPrefix()
- {
- return hierarchical && query == null && fragment == null &&
- (hasTrailingPathSeparator() || (absolutePath && segments.length == 0));
- }
-
- /**
- * If this is a hierarchical URI reference and <code>oldPrefix</code> is a
- * prefix of it, this returns the URI formed by replacing it by
- * <code>newPrefix</code>; <code>null</code> otherwise.
- *
- * <p>In order to be a prefix, the <code>oldPrefix</code>'s
- * {@link #isPrefix} must return <code>true</code>, and it must match this
- * URI's scheme, authority, and device. Also, the paths must match, up to
- * prefix's end.
- *
- * @exception java.lang.IllegalArgumentException if either
- * <code>oldPrefix</code> or <code>newPrefix</code> is not a prefix URI
- * according to {@link #isPrefix}.
- */
- public URI replacePrefix(URI oldPrefix, URI newPrefix)
- {
- if (!oldPrefix.isPrefix() || !newPrefix.isPrefix())
- {
- String which = oldPrefix.isPrefix() ? "new" : "old";
- throw new IllegalArgumentException("non-prefix " + which + " value");
- }
-
- // Get what's left of the segments after trimming the prefix.
- String[] tailSegments = getTailSegments(oldPrefix);
- if (tailSegments == null) return null;
-
- // If the new prefix has segments, it is not the root absolute path,
- // and we need to drop the trailing empty segment and append the tail
- // segments.
- String[] mergedSegments = tailSegments;
- if (newPrefix.segmentCount() != 0)
- {
- int segmentsToKeep = newPrefix.segmentCount() - 1;
- mergedSegments = new String[segmentsToKeep + tailSegments.length];
- System.arraycopy(newPrefix.segments(), 0, mergedSegments, 0,
- segmentsToKeep);
-
- if (tailSegments.length != 0)
- {
- System.arraycopy(tailSegments, 0, mergedSegments, segmentsToKeep,
- tailSegments.length);
- }
- }
-
- return new URI(true, newPrefix.scheme(), newPrefix.authority(),
- newPrefix.device(), newPrefix.hasAbsolutePath(),
- mergedSegments, query, fragment);
- }
-
- // If this is a hierarchical URI reference and prefix is a prefix of it,
- // returns the portion of the path remaining after that prefix has been
- // trimmed; null otherwise.
- private String[] getTailSegments(URI prefix)
- {
- if (!prefix.isPrefix())
- {
- throw new IllegalArgumentException("non-prefix trim");
- }
-
- // Don't even consider it unless this is hierarchical and has scheme,
- // authority, device and path absoluteness equal to those of the prefix.
- if (!hierarchical ||
- !equals(scheme, prefix.scheme()) ||
- !equals(authority, prefix.authority()) ||
- !equals(device, prefix.device()) ||
- absolutePath != prefix.hasAbsolutePath())
- {
- return null;
- }
-
- // If the prefix has no segments, then it is the root absolute path, and
- // we know this is an absolute path, too.
- if (prefix.segmentCount() == 0) return segments;
-
- // This must have no fewer segments than the prefix. Since the prefix
- // is not the root absolute path, its last segment is empty; all others
- // must match.
- int i = 0;
- int segmentsToCompare = prefix.segmentCount() - 1;
- if (segments.length <= segmentsToCompare) return null;
-
- for (; i < segmentsToCompare; i++)
- {
- if (!segments[i].equals(prefix.segment(i))) return null;
- }
-
- // The prefix really is a prefix of this. If this has just one more,
- // empty segment, the paths are the same.
- if (i == segments.length - 1 && SEGMENT_EMPTY.equals(segments[i]))
- {
- return NO_SEGMENTS;
- }
-
- // Otherwise, the path needs only the remaining segments.
- String[] newSegments = new String[segments.length - i];
- System.arraycopy(segments, i, newSegments, 0, newSegments.length);
- return newSegments;
- }
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionDescriptor.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionDescriptor.java
deleted file mode 100644
index 1e34175..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionDescriptor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver.internal;
-
-import java.util.List;
-
-import org.eclipse.wst.common.uriresolver.URIResolverExtension;
-
-
-/**
- * @author csalter
- *
- * To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-public class URIResolverExtensionDescriptor
-{
- protected URIResolverExtension resolver;
- //protected String projectNature;
- protected String fileType;
- protected String className;
- public List projectNatureIds;
- protected String resourceType;
- protected int stage = URIResolverExtensionRegistry.STAGE_POSTNORMALIZATION;
- protected ClassLoader classLoader;
- protected boolean error;
-
- public URIResolverExtensionDescriptor(String className, ClassLoader classLoader, List projectNatureIds, String resourceType, int stage)
- {
- this.className = className;
- this.classLoader = classLoader;
- this.projectNatureIds = projectNatureIds;
- this.resourceType = resourceType;
- this.stage = stage;
- }
-
- public URIResolverExtension getResolver()
- {
-
- if (resolver == null && className != null && !error)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(className) : Class.forName(className);
- resolver = (URIResolverExtension) theClass.newInstance();
- }
- catch (Exception e)
- {
- error = true;
- e.printStackTrace();
- }
- }
- return resolver;
- }
-
- public boolean matches(String projectNatureId, String resourceType, int stage)
- {
- if(projectNatureIds.contains(projectNatureId))
- {
- return matches(this.resourceType, resourceType) && this.stage == stage;
- }
- return false;
- }
-
- public boolean matches(String a, String b)
- {
- return (a != null) ? a.equals(b) : a == b;
- }
-}
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistry.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistry.java
deleted file mode 100644
index 1e5bfd5..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistry.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.uriresolver.URIResolverExtension;
-
-
-
-public class URIResolverExtensionRegistry {
- protected HashMap map = new HashMap();
- public static final int STAGE_PRENORMALIZATION = 1;
- public static final int STAGE_POSTNORMALIZATION = 2;
- protected final static String NULL_PROJECT_NATURE_ID = "";
-
- public URIResolverExtensionRegistry() {
- }
-
- public void put(String className, ClassLoader classLoader, List projectNatureIds, String resourceType, int stage) {
- if(projectNatureIds == null)
- projectNatureIds = new ArrayList();
- if(projectNatureIds.isEmpty())
- {
- projectNatureIds.add(NULL_PROJECT_NATURE_ID);
- }
- URIResolverExtensionDescriptor info = new URIResolverExtensionDescriptor(className, classLoader, projectNatureIds, resourceType, stage);
-
- Iterator idsIter = projectNatureIds.iterator();
- while(idsIter.hasNext())
- {
- String key = (String)idsIter.next();
-
- List list = (List)map.get(key);
- if (list == null)
- {
- list = new ArrayList();
- map.put(key, list);
- }
-
- list.add(info);
- }
- }
-
-
- /**
- * Return a list of URIResolverExtensionDescriptor objects that apply to this project.
- *
- */
- public List getExtensionDescriptors(IProject project)
- {
- List result = new ArrayList();
- for (Iterator i = map.keySet().iterator(); i.hasNext(); )
- {
- String key = (String)i.next();
- try{
- if (key == NULL_PROJECT_NATURE_ID ||
- project == null ||
- project.hasNature(key))
- {
- result.addAll((List)map.get(key));
- }
- }
- catch (CoreException e)
- {}
- }
- return result;
- }
-
- /**
- * Return a list of URIResolver objects that match the stage.
- *
- */
- public List getMatchingURIResolvers(List resolverInfoList, int stage)
- {
- List result = new ArrayList();
- for (Iterator i = resolverInfoList.iterator(); i.hasNext(); ){
- URIResolverExtensionDescriptor info = (URIResolverExtensionDescriptor)i.next();
- if (info.stage == stage)
- {
- Object resolver = info.getResolver();
- if (resolver != null)
- {
- result.add(resolver);
- }
- }
- }
- return result;
- }
-
- public URIResolverExtension get(String key) {
- URIResolverExtensionDescriptor info = (URIResolverExtensionDescriptor) map.get(key);
- return info != null ? info.getResolver() : null;
- }
-
-
-
- /*
- protected URIResolverExtensionDescriptor getMatchingURIResolverExtensionDescriptor(List list, String projectNatureId, String resourceType, int stage)
- {
- URIResolverExtensionDescriptor result = null;
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- URIResolverExtensionDescriptor info = (URIResolverExtensionDescriptor)i.next();
- if (info.matches(projectNatureId, resourceType, stage))
- {
- result = info;
- break;
- }
- }
- return result;
- }*/
-}
-
diff --git a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistryReader.java b/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistryReader.java
deleted file mode 100644
index 4da8b1a..0000000
--- a/plugins/org.eclipse.wst.common.uriresolver/src/org/eclipse/wst/common/uriresolver/internal/URIResolverExtensionRegistryReader.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-*
-* Contributors:
-* IBM - Initial API and implementation
-* Jens Lukowski/Innoopract - initial renaming/restructuring
-*
-*/
-package org.eclipse.wst.common.uriresolver.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-
-/**
- * @author csalter
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class URIResolverExtensionRegistryReader {
-
- protected static final String EXTENSION_POINT_ID = "resolverExtensions";
- protected static final String TAG_NAME = "resolverExtension";
- protected static final String ATT_ID = "id";
- protected static final String ELEM_PROJECT_NATURE_ID = "projectNature";
- protected static final String ATT_RESOURCE_TYPE = "resourceType";
- protected static final String ATT_CLASS = "class";
- protected static final String ATT_STAGE = "stage";
- protected static final String VAL_STAGE_PRE = "prenormalization";
- protected static final String VAL_STAGE_POST = "postnormalization";
- protected static final String ATT_VALUE = "value";
-
-
- protected URIResolverExtensionRegistry registry;
-
- public URIResolverExtensionRegistryReader(URIResolverExtensionRegistry registry) {
- this.registry = registry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry() {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(URIResolverPlugin.getInstance().getDescriptor().getUniqueIdentifier(), EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- readElement(elements[i]);
- }
- }
- }
-
- /**
- * readElement() - parse and deal with an extension like:
- *
- * <extension point="org.eclipse.wst.contentmodel.util_implementation">
- * <util_implementation class = org.eclipse.wst.baseutil.CMUtilImplementationImpl />
- * </extension>
- */
- protected void readElement(IConfigurationElement element) {
- if (element.getName().equals(TAG_NAME)) {
- //String id = element.getAttribute(ATT_ID);
- String className = element.getAttribute(ATT_CLASS);
- //String projectNatureId = element.getAttribute(ATT_PROJECT_NATURE_ID);
- String resourceType = element.getAttribute(ATT_RESOURCE_TYPE);
- String stage = element.getAttribute(ATT_STAGE);
- List projectNatureIds = new ArrayList();
- IConfigurationElement[] ids = element.getChildren(ELEM_PROJECT_NATURE_ID);
- int numids = ids.length;
- for(int i = 0; i < numids; i++)
- {
- String tempid = ids[i].getAttribute(ATT_VALUE);
-
- if(tempid != null)
- {
- projectNatureIds.add(tempid);
- }
- }
- if (className != null) {
- try {
- ClassLoader classLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- int stageint = URIResolverExtensionRegistry.STAGE_POSTNORMALIZATION;
- if(stage.equalsIgnoreCase(VAL_STAGE_PRE))
- {
- stageint = URIResolverExtensionRegistry.STAGE_PRENORMALIZATION;
- }
- registry.put(className, classLoader, projectNatureIds, resourceType, stageint);
- } catch (Exception e) {
- }
- }
- }
- }
- }