Changeset 8974 in josm for trunk/src/org


Ignore:
Timestamp:
2015-11-02T09:00:53+01:00 (4 years ago)
Author:
simon04
Message:

fix #12047 - Closing CombinePrimitiveResolverDialog does not abort the merge/combine action

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r8947 r8974  
    7979 * merged to, see {@link #setTargetPrimitive(OsmPrimitive)}.
    8080 *
    81  * After the dialog is closed use {@link #isCanceled()} to check whether the user canceled
    82  * the dialog. If it wasn't canceled you may build a collection of {@link Command} objects
     81 * After the dialog is closed use {@link #isApplied()} to check whether the dialog has been
     82 * applied. If it was applied you may build a collection of {@link Command} objects
    8383 * which reflect the conflict resolution decisions the user made in the dialog:
    8484 * see {@link #buildResolutionCommands()}
     
    110110    private TagConflictResolver pnlTagConflictResolver;
    111111    protected RelationMemberConflictResolver pnlRelationMemberConflictResolver;
    112     private boolean canceled;
     112    private boolean applied;
    113113    private JPanel pnlButtons;
    114114    protected transient OsmPrimitive targetPrimitive;
     
    338338    }
    339339
    340     protected void setCanceled(boolean canceled) {
    341         this.canceled = canceled;
    342     }
    343 
    344     /**
    345      * Determines if this dialog has been cancelled.
    346      * @return true if this dialog has been cancelled, false otherwise.
    347      */
    348     public boolean isCanceled() {
    349         return canceled;
     340    protected void setApplied(boolean applied) {
     341        this.applied = applied;
     342    }
     343
     344    /**
     345     * Determines if this dialog has been closed with "Apply".
     346     * @return true if this dialog has been closed with "Apply", false otherwise.
     347     */
     348    public boolean isApplied() {
     349        return applied;
    350350    }
    351351
     
    356356            new WindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(Main.parent,
    357357                    new Dimension(600, 400))).applySafe(this);
    358             setCanceled(false);
     358            setApplied(false);
    359359            btnApply.requestFocusInWindow();
    360360        } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775
     
    375375        @Override
    376376        public void actionPerformed(ActionEvent arg0) {
    377             setCanceled(true);
    378377            setVisible(false);
    379378        }
     
    391390        @Override
    392391        public void actionPerformed(ActionEvent arg0) {
     392            setApplied(true);
    393393            setVisible(false);
    394394            pnlTagConflictResolver.rememberPreferences();
     
    515515            if (!dialog.isResolvedCompletely()) {
    516516                dialog.setVisible(true);
    517                 if (dialog.isCanceled()) {
     517                if (!dialog.isApplied()) {
    518518                    throw new UserCancelException();
    519519                }
Note: See TracChangeset for help on using the changeset viewer.