- Timestamp:
- 2018-03-19T20:22:42+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r13434 r13545 762 762 static SearchTask newSearchTask(SearchSetting setting, SearchReceiver resultReceiver) { 763 763 final DataSet ds = MainApplication.getLayerManager().getActiveDataSet(); 764 if (ds == null) { 765 throw new IllegalStateException("No active dataset"); 766 } 764 767 return newSearchTask(setting, ds, resultReceiver); 765 768 } -
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r13188 r13545 26 26 27 27 private transient PropertyChangeListener propertyChangeListener; 28 private BasicArrowButton arrowButton; 29 private boolean arrowEnabledWithButton; 28 30 29 31 /** … … 87 89 */ 88 90 public BasicArrowButton createArrow(ActionListener listener) { 91 return createArrow(listener, false); 92 } 93 94 /** 95 * Create the arrow for opening a drop-down menu 96 * @param listener listener to use for button actions (e.g. pressing) 97 * @param enabledWithButton determines if the button arrow enabled state is the same as main button 98 * @return the created button 99 * @since 13545 100 */ 101 public BasicArrowButton createArrow(ActionListener listener, boolean enabledWithButton) { 89 102 setMargin(new Insets(0, 0, 0, 0)); 90 BasicArrowButton arrowButton = new BasicArrowButton(SwingConstants.SOUTH, null, null, Color.BLACK, null); 103 arrowEnabledWithButton = enabledWithButton; 104 arrowButton = new BasicArrowButton(SwingConstants.SOUTH, null, null, Color.BLACK, null); 91 105 arrowButton.setBorder(BorderFactory.createEmptyBorder()); 92 106 add(arrowButton, BorderLayout.EAST); 93 107 arrowButton.addActionListener(listener); 108 if (arrowEnabledWithButton) { 109 arrowButton.setEnabled(isEnabled()); 110 } 94 111 return arrowButton; 112 } 113 114 @Override 115 public void setEnabled(boolean b) { 116 super.setEnabled(b); 117 if (arrowButton != null && arrowEnabledWithButton) { 118 arrowButton.setEnabled(b); 119 } 95 120 } 96 121 … … 107 132 setAction(null); 108 133 } 134 arrowButton = null; 109 135 } 110 136 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r13434 r13545 128 128 // the search button 129 129 final SideButton searchButton = new SideButton(actSearch); 130 searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton) );130 searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton), true); 131 131 132 132 createLayout(lstPrimitives, true, Arrays.asList(
Note:
See TracChangeset
for help on using the changeset viewer.