Lines 42-47
Link Here
|
42 |
|
42 |
|
43 |
import org.openide.awt.Actions; |
43 |
import org.openide.awt.Actions; |
44 |
import org.openide.awt.DropDownButtonFactory; |
44 |
import org.openide.awt.DropDownButtonFactory; |
|
|
45 |
import org.openide.filesystems.FileObject; |
45 |
import org.openide.util.actions.Presenter; |
46 |
import org.openide.util.actions.Presenter; |
46 |
import java.awt.Component; |
47 |
import java.awt.Component; |
47 |
import java.awt.event.ActionEvent; |
48 |
import java.awt.event.ActionEvent; |
Lines 85-94
Link Here
|
85 |
// --- Presenter.Toolbar implementation -------------------------------------- |
86 |
// --- Presenter.Toolbar implementation -------------------------------------- |
86 |
public Component getToolbarPresenter() { |
87 |
public Component getToolbarPresenter() { |
87 |
if (toolbarPresenter == null) { |
88 |
if (toolbarPresenter == null) { |
|
|
89 |
final FileObject fo = FileUtil.getConfigFile( |
90 |
"Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance" |
91 |
); |
88 |
// gets the real action registered in the menu from layer |
92 |
// gets the real action registered in the menu from layer |
89 |
final Action attachAction = (Action)FileUtil.getConfigFile( |
93 |
final Action attachAction = fo != null ? |
90 |
"Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance" // NOI18N |
94 |
(Action)fo.getAttribute("instanceCreate") : // NOI18N |
91 |
).getAttribute("instanceCreate"); // NOI18N |
95 |
getAttachAction(); |
92 |
|
96 |
|
93 |
final JMenuItem dropdownItem1 = createDropdownItem(defaultAction); |
97 |
final JMenuItem dropdownItem1 = createDropdownItem(defaultAction); |
94 |
final JMenuItem dropdownItem2 = createDropdownItem(attachAction); |
98 |
final JMenuItem dropdownItem2 = createDropdownItem(attachAction); |
Lines 147-150
Link Here
|
147 |
|
151 |
|
148 |
return item; |
152 |
return item; |
149 |
} |
153 |
} |
|
|
154 |
|
155 |
private static Action getAttachAction() { |
156 |
return AttachAction.getDefault(); |
157 |
} |
150 |
} |
158 |
} |