Ignore:
Timestamp:
2017-12-28T15:37:27+01:00 (7 years ago)
Author:
donvip
Message:

fix #josm14013 - buttons not working (patch by javiersanp)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java

    r32970 r33963  
    4545import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
    4646import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction;
     47import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.ApplyAllGuessesAction;
    4748import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AddressActions;
    4849import org.openstreetmap.josm.tools.ImageProvider;
     
    6162    private JTable streetTable;
    6263
     64    private ApplyAllGuessesAction applyGuessesAction = AddressActions.getApplyGuessesAction();
    6365    private AbstractAddressEditAction[] actions = new AbstractAddressEditAction[] {
    6466        AddressActions.getResolveAction(),
    6567        AddressActions.getGuessAddressAction(),
    66         AddressActions.getApplyGuessesAction(),
    67         AddressActions.getSelectAction(),
     68        applyGuessesAction,
    6869        AddressActions.getRemoveTagsAction(),
    69         AddressActions.getConvertToRelationAction(),
    70         AddressActions.getConvertAllToRelationAction()
     70        AddressActions.getSelectAction()
    7171    };
    7272
     
    126126            unresolvedTable.getSelectionModel().addListSelectionListener(this);
    127127            unresolvedTable.getSelectionModel().addListSelectionListener(new IncompleteAddressListener());
    128             unresolvedTable.addMouseListener(AddressActions.getApplyGuessesAction());
     128            unresolvedTable.addMouseListener(applyGuessesAction);
    129129
    130130            JTableHeader header = unresolvedTable.getTableHeader();
     
    146146            try {
    147147                JPanel unresolvedButtons = new JPanel(new GridLayout(2, 5, 5, 5));
    148                 SideButton assign = new SideButton(AddressActions.getResolveAction());
    149                 unresolvedButtons.add(assign);
    150 
    151                 SideButton guess = new SideButton(AddressActions.getGuessAddressAction());
    152                 unresolvedButtons.add(guess);
    153                 SideButton applyAllGuesses = new SideButton(AddressActions.getApplyGuessesAction());
    154                 unresolvedButtons.add(applyAllGuesses);
    155 
    156                 SideButton removeAddressTags = new SideButton(AddressActions.getRemoveTagsAction());
    157                 unresolvedButtons.add(removeAddressTags);
    158 
    159                 unresolvedButtons.add(new JPanel());
    160 
    161                 SideButton selectInMap = new SideButton(AddressActions.getSelectAction());
    162                 unresolvedButtons.add(selectInMap);
     148                for (AbstractAddressEditAction action : actions) {
     149                    action.setContainer(addressEditContainer);
     150                    SideButton button = new SideButton(action);
     151                    unresolvedButtons.add(button);
     152                }
    163153                headerPanel2.setMinimumSize(new Dimension(100, 70));
    164154
     
    202192        } else {
    203193            this.getContentPane().add(new JLabel(tr("(No data)")), BorderLayout.CENTER);
    204         }
    205 
    206         for (int i = 0; i < actions.length; i++) {
    207             actions[i].setContainer(addressEditContainer);
    208194        }
    209195
Note: See TracChangeset for help on using the changeset viewer.