diff -r c05e59b7044f profiler/src/org/netbeans/modules/profiler/actions/AttachAction.java --- a/profiler/src/org/netbeans/modules/profiler/actions/AttachAction.java Wed May 27 10:48:03 2009 +0200 +++ b/profiler/src/org/netbeans/modules/profiler/actions/AttachAction.java Wed May 27 12:05:12 2009 +0200 @@ -54,8 +54,14 @@ public final class AttachAction extends AbstractAction { //~ Constructors ------------------------------------------------------------------------------------------------------------- - public AttachAction() { + private AttachAction() { + putValue(Action.NAME, NbBundle.getMessage(AttachAction.class, "LBL_AttachMainProjectAction")); // NOI18N putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AttachAction.class, "HINT_AttachMainProjectAction")); // NOI18N + } + + private static final AttachAction DEF = new AttachAction(); + public static AttachAction getDefault() { + return DEF; } //~ Methods ------------------------------------------------------------------------------------------------------------------ diff -r c05e59b7044f profiler/src/org/netbeans/modules/profiler/actions/ProfilerToolbarDropdownAction.java --- a/profiler/src/org/netbeans/modules/profiler/actions/ProfilerToolbarDropdownAction.java Wed May 27 10:48:03 2009 +0200 +++ b/profiler/src/org/netbeans/modules/profiler/actions/ProfilerToolbarDropdownAction.java Wed May 27 12:05:12 2009 +0200 @@ -42,6 +42,7 @@ import org.openide.awt.Actions; import org.openide.awt.DropDownButtonFactory; +import org.openide.filesystems.FileObject; import org.openide.util.actions.Presenter; import java.awt.Component; import java.awt.event.ActionEvent; @@ -85,10 +86,13 @@ // --- Presenter.Toolbar implementation -------------------------------------- public Component getToolbarPresenter() { if (toolbarPresenter == null) { + final FileObject fo = FileUtil.getConfigFile( + "Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance" + ); // gets the real action registered in the menu from layer - final Action attachAction = (Action)FileUtil.getConfigFile( - "Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance" // NOI18N - ).getAttribute("instanceCreate"); // NOI18N + final Action attachAction = fo != null ? + (Action)fo.getAttribute("instanceCreate") : // NOI18N + getAttachAction(); final JMenuItem dropdownItem1 = createDropdownItem(defaultAction); final JMenuItem dropdownItem2 = createDropdownItem(attachAction); @@ -147,4 +151,8 @@ return item; } + + private static Action getAttachAction() { + return AttachAction.getDefault(); + } } diff -r c05e59b7044f profiler/src/org/netbeans/modules/profiler/mf-layer.xml --- a/profiler/src/org/netbeans/modules/profiler/mf-layer.xml Wed May 27 10:48:03 2009 +0200 +++ b/profiler/src/org/netbeans/modules/profiler/mf-layer.xml Wed May 27 12:05:12 2009 +0200 @@ -335,7 +335,7 @@ - +