Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis D'Entremont2007-03-12 17:49:33 +0000
committerCurtis D'Entremont2007-03-12 17:49:33 +0000
commit23c5f8c999e364a99a8b5c1efbd6457461d1cfde (patch)
tree5f2bc1be25362592a61f9c6e17c89797a0275b37 /org.eclipse.ui.cheatsheets/src/org
parent369f3c706b8f2a33d5608b8c7af6adcfc5a4fa0b (diff)
downloadeclipse.platform.ua-23c5f8c999e364a99a8b5c1efbd6457461d1cfde.tar.gz
eclipse.platform.ua-23c5f8c999e364a99a8b5c1efbd6457461d1cfde.tar.xz
eclipse.platform.ua-23c5f8c999e364a99a8b5c1efbd6457461d1cfde.zip
revert accidental API change
Diffstat (limited to 'org.eclipse.ui.cheatsheets/src/org')
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java15
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatsheetSearchParticipant.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java10
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetHandler.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetURLHandler.java2
7 files changed, 17 insertions, 18 deletions
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
index b9b2d3f11..f790e7972 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
@@ -42,7 +42,6 @@ public final class OpenCheatSheetAction extends Action {
private URL url;
private String xml;
private String basePath;
- private boolean forceView;
/**
* Creates an action that opens the cheat sheet with the given id.
@@ -51,16 +50,14 @@ public final class OpenCheatSheetAction extends Action {
* extension point.
*
* @param id the cheat sheet id
- * @param forceView to avoid opening in dialogs (e.g. selection dialog itself)
* @exception IllegalArgumentException if <code>id</code>
* is <code>null</code>
*/
- public OpenCheatSheetAction(String id, boolean forceView) {
+ public OpenCheatSheetAction(String id) {
if (id == null) {
throw new IllegalArgumentException();
}
this.id = id;
- this.forceView = forceView;
}
/**
@@ -70,18 +67,16 @@ public final class OpenCheatSheetAction extends Action {
* @param id the id to give this cheat sheet
* @param name the name to give this cheat sheet
* @param url URL of the cheat sheet content file
- * @param forceView to avoid opening in dialogs (e.g. selection dialog itself)
* @exception IllegalArgumentException if the parameters
* are <code>null</code>
*/
- public OpenCheatSheetAction(String id, String name, URL url, boolean forceView) {
+ public OpenCheatSheetAction(String id, String name, URL url) {
if (id == null || name == null || url == null) {
throw new IllegalArgumentException();
}
this.id = id;
this.name = name;
this.url = url;
- this.forceView = forceView;
}
/**
@@ -95,12 +90,11 @@ public final class OpenCheatSheetAction extends Action {
* a composite cheat sheet which has tasks which use path parameters in which
* case the paths will be relative to baseURL. May be <code>null</code>
* if this is not a composite cheat sheet
- * @param forceView to avoid opening in dialogs (e.g. selection dialog itself)
* @exception IllegalArgumentException if the parameters
* are <code>null</code>
* @since 3.3
*/
- public OpenCheatSheetAction(String id, String name, String xml, URL baseURL, boolean forceView) {
+ public OpenCheatSheetAction(String id, String name, String xml, URL baseURL) {
if (id == null || name == null || xml == null) {
throw new IllegalArgumentException();
}
@@ -110,7 +104,6 @@ public final class OpenCheatSheetAction extends Action {
if (baseURL !=null) {
basePath = baseURL.toExternalForm();
}
- this.forceView = forceView;
}
@@ -125,7 +118,7 @@ public final class OpenCheatSheetAction extends Action {
Shell shell = Display.getDefault().getActiveShell();
Object data = shell.getData();
// are we in a dialog that can show a cheat sheet?
- if (!forceView && !shell.isFocusControl() && data instanceof TrayDialog) {
+ if (!shell.isFocusControl() && data instanceof TrayDialog) {
TrayDialog dialog = (TrayDialog)data;
HelpTray tray = (HelpTray)dialog.getTray();
if (tray == null) {
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
index f9acb18f9..01a631504 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
@@ -53,7 +53,7 @@ public final class OpenCheatSheetFromHelpAction implements ILiveHelpAction {
// Active help does not run on the UI thread, so we must use syncExec
Display.getDefault().syncExec(new Runnable() {
public void run() {
- new OpenCheatSheetAction(cheatsheetID, false).run();
+ new OpenCheatSheetAction(cheatsheetID).run();
}
});
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatsheetSearchParticipant.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatsheetSearchParticipant.java
index 6cac9879c..212cc031f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatsheetSearchParticipant.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatsheetSearchParticipant.java
@@ -121,7 +121,7 @@ public class CheatsheetSearchParticipant extends XMLSearchParticipant {
}
public boolean open(String id) {
- Action openAction = new OpenCheatSheetAction(id, false);
+ Action openAction = new OpenCheatSheetAction(id);
openAction.run();
return true;
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
index c27f225f0..c5046605d 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
@@ -287,7 +287,7 @@ public class CheatSheetMenu extends ContributionItem {
* @param event SelectionEvent - the event send along with the selection callback
*/
protected void run(CheatSheetElement element, SelectionEvent event) {
- new OpenCheatSheetAction(element.getID(), false).run();
+ new OpenCheatSheetAction(element.getID()).run();
}
/* (non-Javadoc)
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
index 70dbe9d7b..d6c5b126c 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
@@ -539,6 +539,12 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends
* (non-Javadoc) Method declared on Dialog.
*/
protected void okPressed() {
+ /*
+ * Prevent the cheat sheet from opening inside this dialog's tray
+ * because it is about to close.
+ */
+ getShell().setVisible(false);
+
if (selectFileRadio.getSelection()) {
setResultFromFile();
} else if (selectRegisteredRadio.getSelection() ){
@@ -560,7 +566,7 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends
.getTriggerPoint(ICheatSheetResource.TRIGGER_POINT_ID);
if (WorkbenchActivityHelper.allowUseOf(triggerPoint,
currentSelection)) {
- new OpenCheatSheetAction(currentSelection.getID(), true).run();
+ new OpenCheatSheetAction(currentSelection.getID()).run();
}
}
}
@@ -580,7 +586,7 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends
try {
File contentFile = new File(selectFileCombo.getText());
url = contentFile.toURL();
- new OpenCheatSheetAction(id, id ,url, true).run();
+ new OpenCheatSheetAction(id, id ,url).run();
opened = true;
} catch (MalformedURLException e) {
opened = false;
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetHandler.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetHandler.java
index 09c1aa1fd..8d022f896 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetHandler.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetHandler.java
@@ -34,7 +34,7 @@ public class OpenCheatSheetHandler extends AbstractHandler {
CheatSheetCategoryBasedSelectionAction action = new CheatSheetCategoryBasedSelectionAction();
action.run();
} else {
- OpenCheatSheetAction action = new OpenCheatSheetAction(cheatSheetId, false);
+ OpenCheatSheetAction action = new OpenCheatSheetAction(cheatSheetId);
action.run();
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetURLHandler.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetURLHandler.java
index f5182cb34..42b3ac004 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetURLHandler.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/handlers/OpenCheatSheetURLHandler.java
@@ -56,7 +56,7 @@ public class OpenCheatSheetURLHandler extends AbstractHandler {
}
OpenCheatSheetAction action = new OpenCheatSheetAction(cheatSheetId,
- name, url, false);
+ name, url);
action.run();
return null;

Back to the top