This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 165925
Collapse All | Expand All

(-)a/profiler/src/org/netbeans/modules/profiler/actions/AttachAction.java (-1 / +7 lines)
Lines 54-61 Link Here
54
public final class AttachAction extends AbstractAction {
54
public final class AttachAction extends AbstractAction {
55
    //~ Constructors -------------------------------------------------------------------------------------------------------------
55
    //~ Constructors -------------------------------------------------------------------------------------------------------------
56
56
57
    public AttachAction() {
57
    private AttachAction() {
58
        putValue(Action.NAME, NbBundle.getMessage(AttachAction.class, "LBL_AttachMainProjectAction")); // NOI18N
58
        putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AttachAction.class, "HINT_AttachMainProjectAction")); // NOI18N
59
        putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AttachAction.class, "HINT_AttachMainProjectAction")); // NOI18N
60
    }
61
62
    private static final AttachAction DEF = new AttachAction();
63
    public static AttachAction getDefault() {
64
        return DEF;
59
    }
65
    }
60
66
61
    //~ Methods ------------------------------------------------------------------------------------------------------------------
67
    //~ Methods ------------------------------------------------------------------------------------------------------------------
(-)a/profiler/src/org/netbeans/modules/profiler/actions/ProfilerToolbarDropdownAction.java (-3 / +11 lines)
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
}
(-)a/profiler/src/org/netbeans/modules/profiler/mf-layer.xml (-1 / +1 lines)
Lines 335-341 Link Here
335
        <folder name="Profile">
335
        <folder name="Profile">
336
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.profiler.actions.Bundle"/>
336
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.profiler.actions.Bundle"/>
337
            <file name="org-netbeans-modules-profiler-actions-AttachAction.instance">
337
            <file name="org-netbeans-modules-profiler-actions-AttachAction.instance">
338
                <attr name="delegate" newvalue="org.netbeans.modules.profiler.actions.AttachAction"/>
338
                <attr name="delegate" methodvalue="org.netbeans.modules.profiler.actions.AttachAction.getDefault"/>
339
                <attr name="displayName" bundlevalue="org.netbeans.modules.profiler.actions.Bundle#LBL_AttachMainProjectAction"/>
339
                <attr name="displayName" bundlevalue="org.netbeans.modules.profiler.actions.Bundle#LBL_AttachMainProjectAction"/>
340
                <attr name="iconBase" stringvalue="org/netbeans/modules/profiler/actions/resources/attach.png"/>
340
                <attr name="iconBase" stringvalue="org/netbeans/modules/profiler/actions/resources/attach.png"/>
341
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
341
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>

Return to bug 165925