Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlparsons2004-04-23 22:45:10 +0000
committerlparsons2004-04-23 22:45:10 +0000
commitc9d7dfd763f6feda69fda515ba084f26b84c3032 (patch)
tree8a50f86f8e4f6a00a7cf381c927ca27e80046002 /org.eclipse.ui.intro
parente1b2b37ec43333eb2e725ed8c57ba3579a4f7d01 (diff)
downloadeclipse.platform.ua-c9d7dfd763f6feda69fda515ba084f26b84c3032.tar.gz
eclipse.platform.ua-c9d7dfd763f6feda69fda515ba084f26b84c3032.tar.xz
eclipse.platform.ua-c9d7dfd763f6feda69fda515ba084f26b84c3032.zip
Refactor intro APIs as part of review
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/schema/introContentFileSpec.html4
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroURL.java7
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/ContextHelpPart.java1
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java1
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java (renamed from org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IIntroAction.java)11
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java39
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java (renamed from org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/IStandbyContentPart.java)8
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java41
8 files changed, 95 insertions, 17 deletions
diff --git a/org.eclipse.ui.intro/schema/introContentFileSpec.html b/org.eclipse.ui.intro/schema/introContentFileSpec.html
index 3ca172001..2041bbd07 100644
--- a/org.eclipse.ui.intro/schema/introContentFileSpec.html
+++ b/org.eclipse.ui.intro/schema/introContentFileSpec.html
@@ -233,9 +233,5 @@ the page only when using the Web based presentation.<br>
properies file which is applied to the page only when using the SWT
based presentation. </li>
</ul>
-<h2><code></code>Example</h2>
-<p>The following is an example of a very simple cheat sheet content
-file:</p>
-<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;cheatsheet title="Example"&gt;<br> &lt;intro&gt;<br> &lt;description&gt;Example cheat sheet with two steps.&lt;/description&gt;<br> &lt;/intro&gt;<br> &lt;item title="Step 1"&gt;<br> &lt;description&gt;This is a step with an action.&lt;/description&gt;<br> &lt;action class="com.xyz.myaction" pluginId="com.xyz"/&gt;<br> &lt;/item&gt;<br> &lt;item title="Step 2"&gt;<br> &lt;description&gt;This is a fully manual step.&lt;/description&gt;<br> &lt;/item&gt;<br>&lt;/cheatsheet&gt;</pre>
</body>
</html>
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroURL.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroURL.java
index fd0d0c301..4407a3aa2 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroURL.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroURL.java
@@ -27,6 +27,7 @@ import org.eclipse.ui.internal.intro.impl.parts.*;
import org.eclipse.ui.internal.intro.impl.presentations.*;
import org.eclipse.ui.internal.intro.impl.util.*;
import org.eclipse.ui.intro.*;
+import org.eclipse.ui.intro.config.*;
import org.osgi.framework.*;
/**
@@ -34,7 +35,8 @@ import org.osgi.framework.*;
* a host. This class holds all logic to execute Intro URL commands, ie: an
* Intro URL knows how to execute itself.
*/
-public class IntroURL {
+public class IntroURL implements IIntroURL {
+
/**
* Intro URL constants.
@@ -226,8 +228,7 @@ public class IntroURL {
IIntroAction introAction = (IIntroAction) actionObject;
IIntroSite site = IntroPlugin.getDefault().getIntroModelRoot()
.getPresentation().getIntroPart().getIntroSite();
- introAction.initialize(site, parameters);
- introAction.run();
+ introAction.run(site, parameters);
} else if (actionObject instanceof IAction) {
IAction action = (IAction) actionObject;
action.run();
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/ContextHelpPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/ContextHelpPart.java
index 1f0e82dff..bf240322b 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/ContextHelpPart.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/ContextHelpPart.java
@@ -27,6 +27,7 @@ import org.eclipse.ui.help.*;
import org.eclipse.ui.internal.intro.impl.*;
import org.eclipse.ui.internal.intro.impl.util.*;
import org.eclipse.ui.intro.*;
+import org.eclipse.ui.intro.config.*;
/**
*
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java
index 90322daca..24be22ab6 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java
@@ -21,6 +21,7 @@ import org.eclipse.ui.internal.intro.impl.*;
import org.eclipse.ui.internal.intro.impl.model.*;
import org.eclipse.ui.internal.intro.impl.util.*;
import org.eclipse.ui.intro.*;
+import org.eclipse.ui.intro.config.*;
public class StandbyPart {
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IIntroAction.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java
index f8a1aecba..c427e7695 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IIntroAction.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * 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
@@ -9,17 +9,16 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.internal.intro.impl.model;
+package org.eclipse.ui.intro.config;
import java.util.*;
-import org.eclipse.jface.action.*;
import org.eclipse.ui.intro.*;
/**
- * Intro Action.
+ * Intro action.
*/
-public interface IIntroAction extends IAction {
+public interface IIntroAction {
/**
* Called right before the run method of the action. The properties
@@ -28,6 +27,6 @@ public interface IIntroAction extends IAction {
* @param site
* @param params
*/
- void initialize(IIntroSite site, Properties params);
+ void run(IIntroSite site, Properties params);
}
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java
new file mode 100644
index 000000000..2ab804267
--- /dev/null
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.ui.intro.config;
+
+/**
+ * An intro url. An intro URL is a valid http url, with org.eclipse.ui.intro as
+ * a host. This class holds all logic to execute Intro URL commands, ie: an
+ * Intro URL knows how to execute itself.
+ */
+public interface IIntroURL {
+ /**
+ * Executes whatever valid Intro action is embedded in this Intro URL.
+ *
+ */
+ public void execute();
+
+ /**
+ * @return Returns the action imbedded in this URL.
+ */
+ public String getAction();
+
+ /**
+ * Return a parameter defined in the Intro URL. Returns null if the
+ * parameter is not defined.
+ *
+ * @param parameterId
+ * @return
+ */
+ public String getParameter(String parameterId);
+}
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/IStandbyContentPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java
index eea3ed64f..bcba826bd 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/IStandbyContentPart.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.internal.intro.impl.parts;
+package org.eclipse.ui.intro.config;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.forms.widgets.*;
@@ -29,7 +29,7 @@ import org.eclipse.ui.intro.*;
public interface IStandbyContentPart {
/**
- * Creates the SWT controls for this cheat sheet viewer.
+ * Creates the SWT controls for this standby part.
* <p>
* Clients should not call this method (the intro framework calls this method when
* it needs to, which may be never).
@@ -70,7 +70,7 @@ public interface IStandbyContentPart {
public void setInput(Object input);
/**
- * Asks this cheat sheet viewer to take focus.
+ * Asks this standby part to take focus.
* <p>
* Clients should not call this method (the intro framework calls this method at
* appropriate times).
@@ -79,7 +79,7 @@ public interface IStandbyContentPart {
public void setFocus();
/**
- * Disposes of this cheat sheet viewer.
+ * Disposes of this standby part.
* <p>
* Clients should not call this method (the intro framework calls this method at
* appropriate times).
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java
new file mode 100644
index 000000000..1d887f43d
--- /dev/null
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.ui.intro.config;
+
+import org.eclipse.ui.internal.intro.impl.model.*;
+import org.eclipse.ui.internal.intro.impl.model.IntroURLParser;
+
+/**
+ *
+ */
+public final class IntroURLFactory {
+ /**
+ * Non-instantiable.
+ */
+ private IntroURLFactory() {
+ // do nothing
+ }
+
+ /**
+ * @param url
+ * @return
+ */
+ public static IIntroURL createIntroURL(String url) {
+ IntroURLParser parser = new IntroURLParser(url);
+ if (parser.hasIntroUrl()) {
+ IntroURL introURL = parser.getIntroURL();
+ return introURL;
+ }
+ return null;
+ }
+
+}

Back to the top