- Timestamp:
- 2018-02-17T16:36:12+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java
r12620 r13431 10 10 import javax.swing.JTabbedPane; 11 11 12 import org.openstreetmap.josm.gui.help.HelpUtil; 12 13 import org.openstreetmap.josm.tools.GBC; 13 14 import org.openstreetmap.josm.tools.Logging; … … 136 137 return subSettingMap != null ? subSettingMap.get(sub) : null; 137 138 } 139 140 @Override 141 public String getHelpContext() { 142 return HelpUtil.ht("/Action/Preferences"); 143 } 138 144 } -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r12678 r13431 42 42 43 43 private final PreferenceTabbedPane tpPreferences = new PreferenceTabbedPane(); 44 private final ContextSensitiveHelpAction helpAction = new ContextSensitiveHelpAction(); 44 45 private boolean canceled; 45 46 … … 68 69 btns.add(new JButton(new OKAction())); 69 70 btns.add(new JButton(new CancelAction())); 70 btns.add(new JButton( new ContextSensitiveHelpAction(HelpUtil.ht("/Action/Preferences"))));71 btns.add(new JButton(helpAction)); 71 72 pnl.add(expert, GBC.std().insets(5, 0, 0, 0)); 72 73 pnl.add(btns, GBC.std().fill(GBC.HORIZONTAL)); … … 85 86 86 87 InputMapUtils.addEscapeAction(getRootPane(), new CancelAction()); 87 HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Action/Preferences")); 88 setHelpContext(HelpUtil.ht("/Action/Preferences")); 89 } 90 91 /** 92 * Sets the help context of the preferences dialog. 93 * @param helpContext new help context 94 * @since 13431 95 */ 96 public final void setHelpContext(String helpContext) { 97 helpAction.setHelpTopic(helpContext); 98 HelpUtil.setHelpContext(getRootPane(), helpContext); 88 99 } 89 100 … … 97 108 } 98 109 110 /** 111 * Determines if preferences changes have been canceled. 112 * @return {@code true} if preferences changes have been canceled 113 */ 99 114 public boolean isCanceled() { 100 115 return canceled; … … 109 124 if (visible) { 110 125 // Make the pref window at most as large as the parent JOSM window 111 // Have to take window decorations into account or the windows will 112 // be too large 126 // Have to take window decorations into account or the windows will be too large 113 127 Insets i = this.getParent().getInsets(); 114 128 Dimension p = this.getParent().getSize(); 115 129 p = new Dimension(Math.min(p.width-i.left-i.right, 700), 116 Math.min(p.height-i.top-i.bottom, 800));130 Math.min(p.height-i.top-i.bottom, 800)); 117 131 new WindowGeometry( 118 132 getClass().getName() + ".geometry", -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r13160 r13431 5 5 6 6 import java.awt.Component; 7 import java.awt.Container; 7 8 import java.awt.Font; 8 9 import java.awt.GridBagLayout; … … 610 611 } 611 612 } 613 Container ancestor = getTopLevelAncestor(); 614 if (ancestor instanceof PreferenceDialog) { 615 ((PreferenceDialog) ancestor).setHelpContext(preferenceSettings.getHelpContext()); 616 } 612 617 } 613 618 } -
trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java
r8512 r13431 78 78 */ 79 79 boolean selectSubTab(SubPreferenceSetting subPref); 80 81 /** 82 * Returns the help context for this preferences settings tab. 83 * @return the help context for this preferences settings tab 84 * @since 13431 85 */ 86 String getHelpContext(); 80 87 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r12846 r13431 69 69 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; 70 70 import org.openstreetmap.josm.gui.MainApplication; 71 import org.openstreetmap.josm.gui.help.HelpUtil; 71 72 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 72 73 import org.openstreetmap.josm.gui.util.GuiHelper; … … 993 994 } 994 995 996 @Override 997 public String getHelpContext() { 998 return HelpUtil.ht("/Preferences/Toolbar"); 999 } 995 1000 } 996 1001 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r12881 r13431 40 40 import org.openstreetmap.josm.data.Preferences; 41 41 import org.openstreetmap.josm.data.PreferencesUtils; 42 import org.openstreetmap.josm.spi.preferences.Setting;43 import org.openstreetmap.josm.spi.preferences.StringSetting;44 42 import org.openstreetmap.josm.gui.dialogs.LogShowDialog; 43 import org.openstreetmap.josm.gui.help.HelpUtil; 45 44 import org.openstreetmap.josm.gui.io.CustomConfigurator; 46 45 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; … … 52 51 import org.openstreetmap.josm.gui.widgets.JosmTextField; 53 52 import org.openstreetmap.josm.spi.preferences.Config; 53 import org.openstreetmap.josm.spi.preferences.Setting; 54 import org.openstreetmap.josm.spi.preferences.StringSetting; 54 55 import org.openstreetmap.josm.tools.GBC; 55 56 import org.openstreetmap.josm.tools.Logging; … … 463 464 return false; 464 465 } 466 467 @Override 468 public String getHelpContext() { 469 return HelpUtil.ht("/Preferences/Advanced"); 470 } 465 471 } -
trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java
r13050 r13431 11 11 import javax.swing.JPanel; 12 12 13 import org.openstreetmap.josm.gui.help.HelpUtil; 13 14 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 14 15 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 147 148 return false; 148 149 } 150 151 @Override 152 public String getHelpContext() { 153 return HelpUtil.ht("/Preferences/Audio"); 154 } 149 155 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
r8509 r13431 6 6 import javax.swing.JTabbedPane; 7 7 8 import org.openstreetmap.josm.gui.help.HelpUtil; 8 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 9 10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 42 43 gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH)); 43 44 } 45 46 @Override 47 public String getHelpContext() { 48 return HelpUtil.ht("/Preferences/Display"); 49 } 44 50 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r13427 r13431 62 62 import org.openstreetmap.josm.gui.MainApplication; 63 63 import org.openstreetmap.josm.gui.download.DownloadDialog; 64 import org.openstreetmap.josm.gui.help.HelpUtil; 64 65 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 65 66 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 957 958 MainApplication.getMenu().imageryMenu.refreshOffsetMenu(); 958 959 } 960 961 @Override 962 public String getHelpContext() { 963 return HelpUtil.ht("/Preferences/Imagery"); 964 } 959 965 } -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java
r8509 r13431 6 6 import javax.swing.JTabbedPane; 7 7 8 import org.openstreetmap.josm.gui.help.HelpUtil; 8 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 9 10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 41 42 gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH)); 42 43 } 44 45 @Override 46 public String getHelpContext() { 47 return HelpUtil.ht("/Preferences/Map"); 48 } 43 49 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r12846 r13431 649 649 } 650 650 } 651 652 @Override 653 public String getHelpContext() { 654 return HelpUtil.ht("/Preferences/Plugins"); 655 } 651 656 } -
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r13288 r13431 28 28 29 29 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.gui.help.HelpUtil; 30 31 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 31 32 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 219 220 return false; 220 221 } 222 223 @Override 224 public String getHelpContext() { 225 return HelpUtil.ht("/Preferences/RemoteControl"); 226 } 221 227 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreference.java
r10763 r13431 110 110 return false; 111 111 } 112 113 @Override 114 public String getHelpContext() { 115 return HelpUtil.ht("/Preferences/Connection"); 116 } 112 117 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreference.java
r7668 r13431 6 6 import javax.swing.JPanel; 7 7 8 import org.openstreetmap.josm.gui.help.HelpUtil; 8 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 9 10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 58 59 defaultFilter = substring; 59 60 } 61 62 @Override 63 public String getHelpContext() { 64 return HelpUtil.ht("/Preferences/Shortcuts"); 65 } 60 66 } -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java
r12649 r13431 6 6 import javax.swing.JTabbedPane; 7 7 8 import org.openstreetmap.josm.gui.help.HelpUtil; 8 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 9 10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 44 45 return false; 45 46 } 47 48 @Override 49 public String getHelpContext() { 50 return HelpUtil.ht("/Preferences/Validator"); 51 } 46 52 }
Note:
See TracChangeset
for help on using the changeset viewer.