Lines 39-45
Link Here
|
39 |
|
39 |
|
40 |
package org.netbeans.modules.search; |
40 |
package org.netbeans.modules.search; |
41 |
|
41 |
|
42 |
import java.awt.BorderLayout; |
|
|
43 |
import java.awt.CardLayout; |
42 |
import java.awt.CardLayout; |
44 |
import java.awt.Color; |
43 |
import java.awt.Color; |
45 |
import java.awt.EventQueue; |
44 |
import java.awt.EventQueue; |
Lines 64-71
Link Here
|
64 |
import javax.swing.BorderFactory; |
63 |
import javax.swing.BorderFactory; |
65 |
import javax.swing.Box; |
64 |
import javax.swing.Box; |
66 |
import javax.swing.BoxLayout; |
65 |
import javax.swing.BoxLayout; |
|
|
66 |
import javax.swing.ButtonGroup; |
67 |
import javax.swing.JButton; |
67 |
import javax.swing.JButton; |
68 |
import javax.swing.JPanel; |
68 |
import javax.swing.JPanel; |
|
|
69 |
import javax.swing.JRadioButton; |
69 |
import javax.swing.JScrollPane; |
70 |
import javax.swing.JScrollPane; |
70 |
import javax.swing.JSeparator; |
71 |
import javax.swing.JSeparator; |
71 |
import javax.swing.JSplitPane; |
72 |
import javax.swing.JSplitPane; |
Lines 152-157
Link Here
|
152 |
private JButton btnReplace = new JButton(); |
153 |
private JButton btnReplace = new JButton(); |
153 |
private JButton btnPrev; |
154 |
private JButton btnPrev; |
154 |
private JButton btnNext; |
155 |
private JButton btnNext; |
|
|
156 |
private ButtonGroup sortButtonGroup = new ButtonGroup(); |
157 |
private JRadioButton sortButton = new JRadioButton(); |
158 |
private JRadioButton unsortButton = new JRadioButton(); |
155 |
private JToggleButton btnDisplayContext = new JToggleButton(); |
159 |
private JToggleButton btnDisplayContext = new JToggleButton(); |
156 |
private Separator sepDisplayContext; |
160 |
private Separator sepDisplayContext; |
157 |
|
161 |
|
Lines 257-262
Link Here
|
257 |
} |
261 |
} |
258 |
}); |
262 |
}); |
259 |
|
263 |
|
|
|
264 |
//Search sort buttons |
265 |
final ActionListener listener = new ActionListener() { |
266 |
public void actionPerformed(ActionEvent e) { |
267 |
treeModel.setSorted(e.getSource() == sortButton); |
268 |
} |
269 |
}; |
270 |
unsortButton.setSelected(true); |
271 |
sortButtonGroup.add(sortButton); |
272 |
sortButtonGroup.add(unsortButton); |
273 |
sortButton.addActionListener(listener); |
274 |
unsortButton.addActionListener(listener); |
275 |
|
260 |
Mnemonics.setLocalizedText( |
276 |
Mnemonics.setLocalizedText( |
261 |
btnStop, |
277 |
btnStop, |
262 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_STOP")); //NOI18N |
278 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_STOP")); //NOI18N |
Lines 269-275
Link Here
|
269 |
Mnemonics.setLocalizedText( |
285 |
Mnemonics.setLocalizedText( |
270 |
btnModifySearch, |
286 |
btnModifySearch, |
271 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_CUSTOMIZE")); //NOI18N |
287 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_CUSTOMIZE")); //NOI18N |
|
|
288 |
Mnemonics.setLocalizedText( |
289 |
sortButton, |
290 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_SORT")); //NOI18N |
291 |
Mnemonics.setLocalizedText( |
292 |
unsortButton, |
293 |
NbBundle.getMessage(ResultView.class, "TEXT_BUTTON_UNSORT")); //NOI18N |
272 |
|
294 |
|
|
|
295 |
sortButton.setEnabled(false); |
296 |
unsortButton.setEnabled(false); |
297 |
|
273 |
btnStop.setEnabled(false); |
298 |
btnStop.setEnabled(false); |
274 |
btnShowDetails.setEnabled(false); |
299 |
btnShowDetails.setEnabled(false); |
275 |
|
300 |
|
Lines 277-282
Link Here
|
277 |
|
302 |
|
278 |
JPanel buttonsPanel = new JPanel(); |
303 |
JPanel buttonsPanel = new JPanel(); |
279 |
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS)); |
304 |
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS)); |
|
|
305 |
buttonsPanel.add(sortButton); |
306 |
buttonsPanel.add(unsortButton); |
280 |
buttonsPanel.add(btnReplace); |
307 |
buttonsPanel.add(btnReplace); |
281 |
buttonsPanel.add(Box.createHorizontalGlue()); |
308 |
buttonsPanel.add(Box.createHorizontalGlue()); |
282 |
buttonsPanel.add(btnShowDetails); |
309 |
buttonsPanel.add(btnShowDetails); |
Lines 371-376
Link Here
|
371 |
accessCtx.setAccessibleName(bundle.getString("ACSN_ResultTree")); //NOI18N |
398 |
accessCtx.setAccessibleName(bundle.getString("ACSN_ResultTree")); //NOI18N |
372 |
accessCtx.setAccessibleDescription(bundle.getString("ACSD_ResultTree")); //NOI18N |
399 |
accessCtx.setAccessibleDescription(bundle.getString("ACSD_ResultTree")); //NOI18N |
373 |
|
400 |
|
|
|
401 |
sortButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_SORT")); //NOI18N |
402 |
unsortButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_UNSORT")); //NOI18N |
374 |
btnReplace.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_REPLACE")); //NOI18N |
403 |
btnReplace.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_REPLACE")); //NOI18N |
375 |
btnModifySearch.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_CUSTOMIZE")); //NOI18N |
404 |
btnModifySearch.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_CUSTOMIZE")); //NOI18N |
376 |
btnShowDetails.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_FILL")); //NOI18N |
405 |
btnShowDetails.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_TEXT_BUTTON_FILL")); //NOI18N |
Lines 603-608
Link Here
|
603 |
|
632 |
|
604 |
/** |
633 |
/** |
605 |
*/ |
634 |
*/ |
|
|
635 |
void updateSortButtons() { |
636 |
assert EventQueue.isDispatchThread(); |
637 |
|
638 |
if (searchInProgress) { |
639 |
unsortButton.setSelected(true); |
640 |
} |
641 |
setSortButtonsEnabled(hasResults && !searchInProgress); |
642 |
} |
643 |
|
644 |
/** |
645 |
*/ |
606 |
void updateShowAllDetailsBtn() { |
646 |
void updateShowAllDetailsBtn() { |
607 |
assert EventQueue.isDispatchThread(); |
647 |
assert EventQueue.isDispatchThread(); |
608 |
|
648 |
|
Lines 624-629
Link Here
|
624 |
"TXT_RootSearchedNodesFulltext")); //NOI18N |
664 |
"TXT_RootSearchedNodesFulltext")); //NOI18N |
625 |
|
665 |
|
626 |
searchInProgress = true; |
666 |
searchInProgress = true; |
|
|
667 |
updateSortButtons(); |
627 |
updateShowAllDetailsBtn(); |
668 |
updateShowAllDetailsBtn(); |
628 |
setBtnModifyEnabled(true); |
669 |
setBtnModifyEnabled(true); |
629 |
setBtnStopEnabled(true); |
670 |
setBtnStopEnabled(true); |
Lines 638-643
Link Here
|
638 |
|
679 |
|
639 |
searchInProgress = false; |
680 |
searchInProgress = false; |
640 |
hasDetails = (resultModel != null) ? resultModel.hasDetails() : false; |
681 |
hasDetails = (resultModel != null) ? resultModel.hasDetails() : false; |
|
|
682 |
updateSortButtons(); |
641 |
updateShowAllDetailsBtn(); |
683 |
updateShowAllDetailsBtn(); |
642 |
setBtnStopEnabled(false); |
684 |
setBtnStopEnabled(false); |
643 |
setBtnReplaceEnabled(true); |
685 |
setBtnReplaceEnabled(true); |
Lines 655-660
Link Here
|
655 |
void searchCancelled() { |
697 |
void searchCancelled() { |
656 |
setRootDisplayName(NbBundle.getMessage(ResultView.class, "TEXT_TASK_CANCELLED"));//NOI18N |
698 |
setRootDisplayName(NbBundle.getMessage(ResultView.class, "TEXT_TASK_CANCELLED"));//NOI18N |
657 |
searchInProgress = true; |
699 |
searchInProgress = true; |
|
|
700 |
updateSortButtons(); |
658 |
updateShowAllDetailsBtn(); |
701 |
updateShowAllDetailsBtn(); |
659 |
setBtnStopEnabled(false); |
702 |
setBtnStopEnabled(false); |
660 |
setBtnReplaceEnabled(true); |
703 |
setBtnReplaceEnabled(true); |
Lines 1136-1141
Link Here
|
1136 |
Manager.getInstance().scheduleReplaceTask(taskReplace); |
1179 |
Manager.getInstance().scheduleReplaceTask(taskReplace); |
1137 |
} |
1180 |
} |
1138 |
|
1181 |
|
|
|
1182 |
void setSortButtonsEnabled(boolean enabled) { |
1183 |
sortButton.setEnabled(enabled); |
1184 |
unsortButton.setEnabled(enabled); |
1185 |
} |
1186 |
|
1139 |
void setBtnModifyEnabled(boolean enabled){ |
1187 |
void setBtnModifyEnabled(boolean enabled){ |
1140 |
btnModifySearch.setEnabled(enabled); |
1188 |
btnModifySearch.setEnabled(enabled); |
1141 |
} |
1189 |
} |