added getting started quickhelp menu item, made quick help sticky
This commit is contained in:
parent
ef2338d2f3
commit
be52981bcc
1 changed files with 38 additions and 0 deletions
|
@ -387,11 +387,28 @@ public class GUI extends Observable {
|
|||
));
|
||||
quickHelpScroll.setVisible(false);
|
||||
loadQuickHelp("KEYBOARD_SHORTCUTS");
|
||||
loadQuickHelp("GETTING_STARTED");
|
||||
|
||||
// Load default and overwrite with user settings (if any)
|
||||
loadExternalToolsDefaultSettings();
|
||||
loadExternalToolsUserSettings();
|
||||
|
||||
final boolean showQuickhelp = getExternalToolsSetting("SHOW_QUICKHELP", "true").equalsIgnoreCase("true");
|
||||
if (showQuickhelp) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
JCheckBoxMenuItem checkBox = ((JCheckBoxMenuItem)showQuickHelpAction.getValue("checkbox"));
|
||||
if (checkBox == null) {
|
||||
return;
|
||||
}
|
||||
if (checkBox.isSelected()) {
|
||||
return;
|
||||
}
|
||||
checkBox.doClick();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Debugging - Break on repaints outside EDT */
|
||||
/*RepaintManager.setCurrentManager(new RepaintManager() {
|
||||
public void addDirtyRegion(JComponent comp, int a, int b, int c, int d) {
|
||||
|
@ -1003,6 +1020,7 @@ public class GUI extends Observable {
|
|||
/* Help */
|
||||
menu = new JMenu("Help");
|
||||
menu.setMnemonic(KeyEvent.VK_H);
|
||||
menu.add(new JMenuItem(showGettingStartedAction));
|
||||
menu.add(new JMenuItem(showKeyboardShortcutsAction));
|
||||
JCheckBoxMenuItem checkBox = new JCheckBoxMenuItem(showQuickHelpAction);
|
||||
showQuickHelpAction.putValue("checkbox", checkBox);
|
||||
|
@ -1971,6 +1989,7 @@ public class GUI extends Observable {
|
|||
* @return Plugin instance
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public Plugin getStartedPlugin(String classname) {
|
||||
return getPlugin(classname);
|
||||
}
|
||||
|
@ -4502,6 +4521,7 @@ public class GUI extends Observable {
|
|||
boolean show = ((JCheckBoxMenuItem) e.getSource()).isSelected();
|
||||
quickHelpTextPane.setVisible(show);
|
||||
quickHelpScroll.setVisible(show);
|
||||
setExternalToolsSetting("SHOW_QUICKHELP", new Boolean(show).toString());
|
||||
((JPanel)frame.getContentPane()).revalidate();
|
||||
updateDesktopSize(getDesktopPane());
|
||||
}
|
||||
|
@ -4510,6 +4530,24 @@ public class GUI extends Observable {
|
|||
return true;
|
||||
}
|
||||
};
|
||||
GUIAction showGettingStartedAction = new GUIAction("Getting started") {
|
||||
private static final long serialVersionUID = 2382848024856978524L;
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
loadQuickHelp("GETTING_STARTED");
|
||||
JCheckBoxMenuItem checkBox = ((JCheckBoxMenuItem)showQuickHelpAction.getValue("checkbox"));
|
||||
if (checkBox == null) {
|
||||
return;
|
||||
}
|
||||
if (checkBox.isSelected()) {
|
||||
return;
|
||||
}
|
||||
checkBox.doClick();
|
||||
}
|
||||
|
||||
public boolean shouldBeEnabled() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
GUIAction showKeyboardShortcutsAction = new GUIAction("Keyboard shortcuts") {
|
||||
private static final long serialVersionUID = 2382848024856978524L;
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
|
Loading…
Reference in a new issue