Ignore:
Timestamp:
2013-06-29T03:52:07+02:00 (11 years ago)
Author:
donvip
Message:

[josm_czechaddress] fix #josm6491 - Use of enter key in plugin dialogs

Location:
applications/editors/josm/plugins/czechaddress
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/czechaddress/.settings/org.eclipse.core.resources.prefs

    r16601 r29727  
    1 #Mon Jul 20 22:01:52 CEST 2009
    21eclipse.preferences.version=1
    32encoding//src/org/openstreetmap/josm/plugins/czechaddress/StringUtils.java=UTF-8
    43encoding//src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java=UTF-8
     4encoding/<project>=UTF-8
  • applications/editors/josm/plugins/czechaddress/.settings/org.eclipse.jdt.core.prefs

    r18503 r29727  
    1 #Thu Nov 05 21:57:41 CET 2009
    21eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     3org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     4org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     5org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     6org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    37org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    48org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
     
    812org.eclipse.jdt.core.compiler.debug.localVariable=generate
    913org.eclipse.jdt.core.compiler.debug.sourceFile=generate
     14org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    1015org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     16org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     17org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     18org.eclipse.jdt.core.compiler.problem.deadCode=warning
     19org.eclipse.jdt.core.compiler.problem.deprecation=warning
     20org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
     21org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
     22org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
     23org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
    1124org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     25org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
     26org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     27org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     28org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
     29org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
     30org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
     31org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
     32org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     33org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
     34org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
     35org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     36org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     37org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
     38org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     39org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
     40org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     41org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
     42org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     43org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     44org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
     45org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
     46org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
     47org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     48org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
     49org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     50org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
     51org.eclipse.jdt.core.compiler.problem.nullReference=warning
     52org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     53org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
     54org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
     55org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
     56org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     57org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
     58org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     59org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     60org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
     61org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
     62org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
     63org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
     64org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     65org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
     66org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
     67org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
     68org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
     69org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     70org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
     71org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
     72org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
     73org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     74org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
     75org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
     76org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     77org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
     78org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     79org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
     80org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
     81org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
     82org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
     83org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     84org.eclipse.jdt.core.compiler.problem.unusedImport=warning
     85org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
     86org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
     87org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
     88org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
     89org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
     90org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
     91org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
     92org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     93org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
     94org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    1295org.eclipse.jdt.core.compiler.source=1.6
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java

    r27834 r29727  
    2626import org.openstreetmap.josm.gui.MapFrame;
    2727import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     28import org.openstreetmap.josm.gui.util.GuiHelper;
    2829import org.openstreetmap.josm.plugins.Plugin;
    2930import org.openstreetmap.josm.plugins.PluginInformation;
     
    163164        ManagerDialog dialog = new ManagerDialog();
    164165        if (dialog.countAutomaticRenameProposals() > 0)
    165             dialog.setVisible(true);
     166            dialog.showDialog();
    166167    }
    167168
     
    192193    public void pluginStatusChanged(int message) {
    193194        if (message == MESSAGE_DATABASE_LOADED) {
    194             czechMenu = Main.main.menu.addMenu(marktr("Adress"), KeyEvent.VK_Z, 4, ht("/Plugin/CzechAddress"));
    195             menuItems.add(MainMenu.add(czechMenu, new PointManipulatorAction()));
    196             menuItems.add(MainMenu.add(czechMenu, new GroupManipulatorAction()));
    197             menuItems.add(MainMenu.add(czechMenu, new ConflictResolveAction()));
    198             menuItems.add(MainMenu.add(czechMenu, new ManagerAction()));
    199             menuItems.add(MainMenu.add(czechMenu, new HelpAction()));
     195            GuiHelper.runInEDTAndWait(new Runnable() {
     196                @Override public void run() {
     197                    czechMenu = Main.main.menu.addMenu(marktr("Adress"), KeyEvent.VK_Z, 4, ht("/Plugin/CzechAddress"));
     198                    menuItems.add(MainMenu.add(czechMenu, new PointManipulatorAction()));
     199                    menuItems.add(MainMenu.add(czechMenu, new GroupManipulatorAction()));
     200                    menuItems.add(MainMenu.add(czechMenu, new ConflictResolveAction()));
     201                    menuItems.add(MainMenu.add(czechMenu, new ManagerAction()));
     202                    menuItems.add(MainMenu.add(czechMenu, new HelpAction()));
     203                }
     204            });
    200205            return;
    201206        }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/ConflictResolveAction.java

    r27852 r29727  
    33import java.awt.event.ActionEvent;
    44import java.awt.event.KeyEvent;
     5
    56import org.openstreetmap.josm.actions.JosmAction;
    67import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin;
     
    3940     */
    4041    public void actionPerformed(ActionEvent e) {
    41         ConflictResolver.getInstance().setVisible(true);
     42        ConflictResolver.getInstance().showDialog();
    4243    }
    4344}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/GroupManipulatorAction.java

    r27878 r29727  
    11package org.openstreetmap.josm.plugins.czechaddress.actions;
    2 
    3 import org.openstreetmap.josm.plugins.czechaddress.gui.GroupManipulatorDialog;
    42
    53import java.awt.event.ActionEvent;
     
    86import org.openstreetmap.josm.actions.JosmAction;
    97import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin;
     8import org.openstreetmap.josm.plugins.czechaddress.gui.GroupManipulatorDialog;
    109import org.openstreetmap.josm.tools.Shortcut;
    1110
     
    4140    public void actionPerformed(ActionEvent e) {
    4241        if (CzechAddressPlugin.getLocation() == null) return;
    43         GroupManipulatorDialog.getInstence().setVisible(true);
     42        GroupManipulatorDialog.getInstance().setVisible(true);
    4443    }
    4544}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/ManagerAction.java

    r28340 r29727  
    2525    @Override
    2626        public void actionPerformed(ActionEvent e) {
    27         (new ManagerDialog()).setVisible(true);
     27        new ManagerDialog().showDialog();
    2828    }
    2929}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/PointManipulatorAction.java

    r27852 r29727  
    5252        if (CzechAddressPlugin.getLocation() == null) return;
    5353
    54         PointManipulatorDialog dialog = new PointManipulatorDialog(primitive);
    55         dialog.setVisible(true);
     54        new PointManipulatorDialog(primitive).showDialog();
    5655    }
    5756}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java

    r27852 r29727  
    77import java.util.Collection;
    88import java.util.Collections;
     9import java.util.LinkedList;
    910import java.util.List;
    10 import java.util.LinkedList;
    1111
    1212import javax.swing.JOptionPane;
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java

    r23190 r29727  
    88import java.util.logging.Level;
    99import java.util.logging.Logger;
     10
    1011import javax.swing.ComboBoxModel;
    1112import javax.swing.DefaultComboBoxModel;
    12 import javax.swing.event.ListDataListener;
    1313import javax.swing.Icon;
    1414import javax.swing.JButton;
    1515import javax.swing.event.ListDataEvent;
     16import javax.swing.event.ListDataListener;
     17
    1618import org.openstreetmap.josm.Main;
    1719import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    2325import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.House;
    2426import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.Street;
     27import org.openstreetmap.josm.plugins.czechaddress.gui.utils.UniversalListRenderer;
    2528import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner;
    2629import org.openstreetmap.josm.plugins.czechaddress.intelligence.ReasonerListener;
    27 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.UniversalListRenderer;
    2830import org.openstreetmap.josm.tools.ImageProvider;
    2931
     
    218220            mainField.setSelectedIndex(index);
    219221            mainField.repaint();
    220             setVisible(true);
     222            showDialog();
    221223        }
    222224    }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java

    r27870 r29727  
    11package org.openstreetmap.josm.plugins.czechaddress.gui;
    2 
    3 import static org.openstreetmap.josm.tools.I18n.tr;
    42
    53import java.awt.Component;
     
    2119import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2220import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
     21import org.openstreetmap.josm.gui.util.GuiHelper;
    2322import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin;
    2423import org.openstreetmap.josm.plugins.czechaddress.MapUtils;
     
    8887
    8988        if (message == MESSAGE_DATABASE_LOADED) {
    90             relocateButton.setEnabled(true);
     89            GuiHelper.runInEDTAndWait(new Runnable() {
     90                @Override public void run() {
     91                    relocateButton.setEnabled(true);
     92                }
     93            });
    9194            return;
    9295        }
     
    9598            DataSet.addSelectionListener(this);
    9699
    97             streetModel.setParent(CzechAddressPlugin.getLocation());
    98             relocateButton.setText("Změnit místo");
    99             streetComboBox.setEnabled(true);
    100             houseList.setEnabled(true);
    101             keepOddityCheckBox.setEnabled(true);
     100            GuiHelper.runInEDTAndWait(new Runnable() {
     101                @Override public void run() {
     102                streetModel.setParent(CzechAddressPlugin.getLocation());
     103                relocateButton.setText("Změnit místo");
     104                streetComboBox.setEnabled(true);
     105                houseList.setEnabled(true);
     106                keepOddityCheckBox.setEnabled(true);
     107                }
     108            });
    102109            return;
    103110        }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/GroupManipulatorDialog.java

    r23190 r29727  
    3333
    3434    private static GroupManipulatorDialog singleton = null;
    35     public static GroupManipulatorDialog getInstence() {
     35    public static GroupManipulatorDialog getInstance() {
    3636        if (singleton == null)
    3737            singleton = new GroupManipulatorDialog();
     
    5757        setContent(mainPanel);
    5858        setButtonIcons(new String[] {"ok.png", "cancel.png"});
     59        setDefaultButton(1);
     60        setCancelButton(2);
    5961        setupDialog();
    6062        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java

    r29661 r29727  
    4141
    4242    public static ElementWithStreets selectLocation() {
    43         LocationSelector ls = new LocationSelector();
    44         ls.setVisible(true);
     43        LocationSelector ls = (LocationSelector) new LocationSelector().showDialog();
    4544
    4645        if (ls.getValue() == 1)
     
    5857        setButtonIcons(new String[] {"ok.png", "cancel.png"});
    5958        setDefaultButton(1);
     59        setCancelButton(2);
    6060        setupDialog();
    6161
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java

    r26509 r29727  
    7474        setContent(mainPanel);
    7575        setButtonIcons(new String[] {"ok.png", "cancel.png"});
     76        setDefaultButton(1);
     77        setCancelButton(2);
    7678        setupDialog();
    7779    }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java

    r23190 r29727  
    8282        setContent(mainPanel, false);
    8383        setButtonIcons(new String[] { "ok.png", "cancel.png" });
     84        setDefaultButton(1);
     85        setCancelButton(2);
    8486        setupDialog();
    8587        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/EditorFactory.java

    r15649 r29727  
    3131
    3232    public static boolean editStreet(Street street) {
    33         StreetEditor dialog = new StreetEditor(street);
    34         dialog.setVisible(true);
     33        StreetEditor dialog = (StreetEditor) new StreetEditor(street).showDialog();
    3534        if (dialog.getValue() == 1) {
    3635            Reasoner r = Reasoner.getInstance();
     
    4948
    5049    public static boolean editHouse(House house) {
    51         HouseEditor dialog = new HouseEditor(house);
    52         dialog.setVisible(true);
     50        HouseEditor dialog = (HouseEditor) new HouseEditor(house).showDialog();
    5351        if (dialog.getValue() == 1) {
    5452            Reasoner r = Reasoner.getInstance();
     
    6664
    6765    public static boolean editSuburb(Suburb suburb) {
    68         SuburbEditor dialog = new SuburbEditor(suburb);
    69         dialog.setVisible(true);
     66        SuburbEditor dialog = (SuburbEditor) new SuburbEditor(suburb).showDialog();
    7067        if (dialog.getValue() == 1) {
    7168            suburb.setName(dialog.getSuburbName());
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/HouseEditor.java

    r18408 r29727  
    3636        setContent(mainPanel);
    3737        this.setButtonIcons(new String[] {"ok.png", "cancel.png"});
     38        setDefaultButton(1);
     39        setCancelButton(2);
    3840        setupDialog();
    3941    }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.java

    r18408 r29727  
    22
    33import javax.swing.DefaultComboBoxModel;
     4
    45import org.openstreetmap.josm.Main;
    56import org.openstreetmap.josm.gui.ExtendedDialog;
    6 import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
    77import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.AddressElement;
    88import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.House;
     
    4747        setContent(mainPanel);
    4848        this.setButtonIcons(new String[] {"ok.png", "cancel.png"});
     49        setDefaultButton(1);
     50        setCancelButton(2);
    4951        setupDialog();
    5052    }
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/SuburbEditor.java

    r23190 r29727  
    22
    33import javax.swing.DefaultComboBoxModel;
     4
    45import org.openstreetmap.josm.Main;
    56import org.openstreetmap.josm.gui.ExtendedDialog;
     
    5556        setContent(mainPanel);
    5657        this.setButtonIcons(new String[] {"ok.png", "cancel.png"});
     58        setDefaultButton(1);
     59        setCancelButton(2);
    5760        setupDialog();
    5861    }
Note: See TracChangeset for help on using the changeset viewer.