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 49806
Collapse All | Expand All

(-)core/src/org/netbeans/core/ShortcutsPanel.java (+6 lines)
Lines 60-65 Link Here
60
        shortcutsList.setSelectedIndices(new int[0]);
60
        shortcutsList.setSelectedIndices(new int[0]);
61
        updateButtons ();
61
        updateButtons ();
62
    }
62
    }
63
    
64
    public void addNotify() {
65
        super.addNotify();
66
        //Turn off remapping so keys will be read sanely
67
        System.setProperty ("nb.mac.swap.ctrl.and.alt", "false");
68
    }
63
69
64
    /** This method is called from within the constructor to
70
    /** This method is called from within the constructor to
65
     * initialize the form.
71
     * initialize the form.
(-)core/ui/src/org/netbeans/core/ui/resources/layer.xml (-5 / +7 lines)
Lines 144-152 Link Here
144
	    </file>
144
	    </file>
145
            <attr name="Separator2.instance/org-openide-actions-FindAction.instance" boolvalue="true" />
145
            <attr name="Separator2.instance/org-openide-actions-FindAction.instance" boolvalue="true" />
146
            <file name="org-openide-actions-FindAction.instance"/>
146
            <file name="org-openide-actions-FindAction.instance"/>
147
            <attr name="org-openide-actions-FindAction.instance/org-openide-actions-ReplaceAction.instance" boolvalue="true" />
147
            <attr name="org-openide-actions-FindAction.instance/ReplaceAction.shadow" boolvalue="true" />
148
            <file name="org-openide-actions-ReplaceAction.instance"/>
148
            <file name="ReplaceAction.shadow">
149
            <attr name="org-openide-actions-ReplaceAction.instance/org-openide-actions-GotoAction.instance" boolvalue="true" />
149
                    <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-ReplaceAction.instance"/>
150
            </file>
151
            <attr name="ReplaceAction.shadow/org-openide-actions-GotoAction.instance" boolvalue="true" />
150
            <file name="org-openide-actions-GotoAction.instance"/>
152
            <file name="org-openide-actions-GotoAction.instance"/>
151
        </folder>
153
        </folder>
152
        
154
        
Lines 301-308 Link Here
301
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
303
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
302
	</file>
304
	</file>
303
    
305
    
304
        <file name="C-H.instance">
306
        <file name="C-H.shadow">
305
	    <attr name="instanceClass" stringvalue="org.openide.actions.ReplaceAction"/>
307
            <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-ReplaceAction.instance"/>
306
	</file>
308
	</file>
307
309
308
        <file name="D-P.instance">
310
        <file name="D-P.instance">
(-)core/windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java (+35 lines)
Lines 114-119 Link Here
114
        return res;
114
        return res;
115
    }
115
    }
116
116
117
    private static boolean wasMacSwap = false;
117
    public boolean dispatchKeyEvent(KeyEvent ev) {
118
    public boolean dispatchKeyEvent(KeyEvent ev) {
118
        // XXX(-ttran) Sun JDK 1.4 on Linux: pressing Alt key produces
119
        // XXX(-ttran) Sun JDK 1.4 on Linux: pressing Alt key produces
119
        // KeyEvent.VK_ALT, but Alt+<key> produces Meta+<key>
120
        // KeyEvent.VK_ALT, but Alt+<key> produces Meta+<key>
Lines 123-128 Link Here
123
                mods = (mods & ~ InputEvent.META_MASK) | InputEvent.ALT_MASK;
124
                mods = (mods & ~ InputEvent.META_MASK) | InputEvent.ALT_MASK;
124
                ev.setModifiers(mods);
125
                ev.setModifiers(mods);
125
            }
126
            }
127
        }
128
        
129
        if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
130
            boolean macSwap = Boolean.getBoolean (
131
                "nb.mac.swap.ctrl.and.alt"); //NOI18N
132
            if (macSwap) {
133
                //Allows international keyboards to use the Alt key as the Compose
134
                //key
135
                int mods = ev.getModifiers();
136
                System.setProperty ("lastKeyModifiers", Integer.toString(mods)); //NOI18N
137
                boolean isCtrl = (mods & InputEvent.CTRL_MASK) != 0;
138
                boolean isAlt = (mods & InputEvent.ALT_MASK) != 0;
139
                int code = ev.getKeyCode();
140
                boolean skip = code == KeyEvent.VK_UP || code == KeyEvent.VK_DOWN ||
141
                    code == KeyEvent.VK_RIGHT || code == KeyEvent.VK_LEFT || 
142
                    code == KeyEvent.VK_ENTER || code == KeyEvent.VK_SPACE;
143
                if (isCtrl != isAlt && !skip) {
144
                    if (isAlt) {
145
                        mods ^= InputEvent.ALT_MASK;
146
                        mods |= InputEvent.CTRL_MASK;
147
                    }
148
                    if (isCtrl) {
149
                        mods ^= InputEvent.CTRL_MASK;
150
                        mods |= InputEvent.ALT_MASK;
151
                    }
152
                    ev.setModifiers (mods);
153
                }
154
            }
155
            if (wasMacSwap != macSwap) {
156
                if (!macSwap) {
157
                    System.getProperties().remove ("lastKeyModifiers"); //NOI18N
158
                }
159
            }
160
            wasMacSwap = macSwap;
126
        }
161
        }
127
162
128
        if (ev.getID() == KeyEvent.KEY_PRESSED
163
        if (ev.getID() == KeyEvent.KEY_PRESSED
(-)editor/libsrc/org/netbeans/editor/BaseKit.java (-21 / +31 lines)
Lines 780-807 Link Here
780
                int mod = evt.getModifiers();
780
                int mod = evt.getModifiers();
781
                boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
781
                boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
782
                // On the mac, norwegian and french keyboards use Alt to do bracket characters.
782
                // On the mac, norwegian and french keyboards use Alt to do bracket characters.
783
                // This replicates Apple's modification DefaultEditorKit.DefaultKeyTypedAction
784
                boolean alt = ((mod & ActionEvent.ALT_MASK) != 0);
783
                boolean alt = ((mod & ActionEvent.ALT_MASK) != 0);
785
                if (isMac && alt) {
784
                
786
                    //Ugly, but without IDE-wide global keybinding registry, there
785
                if (isMac) {
787
                    //simply is no way to find out if it's a character we want
786
                    boolean macSwap = Boolean.getBoolean (
788
                    //or not, so filter for commonly used characters and otherwise
787
                            "nb.mac.swap.ctrl.and.alt"); //NOI18N
789
                    //handle normally.  The problem is really Apple's, that they
788
790
                    //use Alt- as the compose key in some locales.  Eventually
789
                    if (alt && !macSwap) {
791
                    //perhaps the applemenu module could detect this and provide alternate
790
                        //Ugly, but without IDE-wide global keybinding registry, there
792
                    //bindings with a line switch for all Alt- bindings.  For
791
                        //simply is no way to find out if it's a character we want
793
                    //4.0, this will have to do.
792
                        //or not, so filter for commonly used characters and otherwise
794
                    //
793
                        //handle normally.  The problem is really Apple's, that they
795
                    //Original patch replicated what Apple does in DefaultKeyAction,
794
                        //use Alt- as the compose key in some locales.  Eventually
796
                    //(check META instead of ALT) but this broke all Alt- 
795
                        //perhaps the applemenu module could detect this and provide alternate
797
                    //shortcuts.  So we do it the ugly way.
796
                        //bindings with a line switch for all Alt- bindings.  For
798
                    //
797
                        //4.0, this will have to do.
799
                    //This *does* break Alt-8/9 key combinations on norwegian and
798
                        //
800
                    //french keyboards, but that's better than not being able to
799
                        //Original patch replicated what Apple does in DefaultKeyAction,
801
                    //type brackets
800
                        //(check META instead of ALT) but this broke all Alt- 
802
                    String cmd = evt.getActionCommand();
801
                        //shortcuts.  So we do it the ugly way.
803
                    alt &= !"{".equals(cmd) && !"}".equals(cmd) && !"[".equals(cmd) && //NOI18N
802
                        //
804
                        !"]".equals(cmd) && !"(".equals(cmd) && !")".equals(cmd); //NOI18N
803
                        //This *does* break Alt-8/9 key combinations on norwegian and
804
                        //french keyboards, but that's better than not being able to
805
                        //type brackets
806
                        String cmd = evt.getActionCommand();
807
                        alt &= !"{".equals(cmd) && !"}".equals(cmd) && !"[".equals(cmd) && //NOI18N
808
                            !"]".equals(cmd) && !"(".equals(cmd) && !")".equals(cmd); //NOI18N
809
                    } else if (macSwap) {
810
                        //Allow alt keys through if the flag is set - replicate
811
                        //Apple's hack in DefaultKeyAction.
812
                        alt = false;
813
                        ctrl = false;
814
                    }
805
                }
815
                }
806
                
816
                
807
                if ((alt && !ctrl) || (ctrl && !alt)) {
817
                if ((alt && !ctrl) || (ctrl && !alt)) {
(-)editor/libsrc/org/netbeans/editor/ext/ExtKit.java (+24 lines)
Lines 15-20 Link Here
15
15
16
import java.awt.Rectangle;
16
import java.awt.Rectangle;
17
import java.awt.event.ActionEvent;
17
import java.awt.event.ActionEvent;
18
import java.awt.event.InputEvent;
18
import java.io.IOException;
19
import java.io.IOException;
19
import java.util.List;
20
import java.util.List;
20
import java.util.Iterator;
21
import java.util.Iterator;
Lines 397-408 Link Here
397
        }
398
        }
398
399
399
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
400
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
401
            //Hack: On the mac, we provide an action to globally swap
402
            //Ctrl and Alt, so Alt can be used as a control character.  But
403
            //Goto is bound to Ctrl-G even on mac, so we need to suppress it,
404
            //or Alt-G when swapped will not insert an international character.
405
            //We provide the alternate binding AS-G so Goto can work even in
406
            //swapped mode.  See 
407
            //org.netbeans.core.windows.ShortcutKeyAndMenuEventProcessor
408
            
409
            if (isMac) {
410
                String lastMods = System.getProperty("lastKeyModifiers"); //NOI18N
411
                if (lastMods != null) {
412
                    try {
413
                        int mods = Integer.parseInt(lastMods);
414
                        if ((mods & InputEvent.ALT_MASK) != 0) {
415
                            return;
416
                        }
417
                    } catch (NumberFormatException e) {
418
                        //do nothing
419
                    }
420
                }
421
            }
422
            
400
            if (target != null) {
423
            if (target != null) {
401
                new GotoDialogSupport().showGotoDialog(new KeyEventBlocker(target, false));
424
                new GotoDialogSupport().showGotoDialog(new KeyEventBlocker(target, false));
402
            }
425
            }
403
        }
426
        }
404
427
405
    }
428
    }
429
    private static final boolean isMac = System.getProperty("mrj.version") != null; //NOI18N
406
430
407
    /** Action to go to the declaration of the variable under the caret.
431
    /** Action to go to the declaration of the variable under the caret.
408
    */
432
    */
(-)editor/libsrc/org/netbeans/editor/ext/ExtSettingsDefaults.java (-2 / +13 lines)
Lines 73-78 Link Here
73
    public static final Dimension defaultJavaDocPreferredSize = new Dimension(500, 300);    
73
    public static final Dimension defaultJavaDocPreferredSize = new Dimension(500, 300);    
74
    public static final Boolean defaultJavaDocAutoPopup = Boolean.TRUE;
74
    public static final Boolean defaultJavaDocAutoPopup = Boolean.TRUE;
75
    private static int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
75
    private static int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
76
    private static boolean IS_MAC = System.getProperty("mrj.version") != null;
76
    
77
    
77
    public static final MultiKeyBinding[] defaultExtKeyBindings
78
    public static final MultiKeyBinding[] defaultExtKeyBindings
78
    = new MultiKeyBinding[] {
79
    = new MultiKeyBinding[] {
Lines 90-108 Link Here
90
              ExtKit.findAction
91
              ExtKit.findAction
91
          ),
92
          ),
92
          new MultiKeyBinding(
93
          new MultiKeyBinding(
93
              KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK),
94
              KeyStroke.getKeyStroke(IS_MAC ? KeyEvent.VK_R : KeyEvent.VK_H, MENU_MASK),
94
              ExtKit.replaceAction
95
              ExtKit.replaceAction
95
          ),
96
          ),
96
          new MultiKeyBinding(
97
          new MultiKeyBinding(
97
              KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_MASK),
98
              KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_MASK),
98
              ExtKit.gotoAction
99
              ExtKit.gotoAction
99
          ),
100
          ),
101
          //Next entry is to handle suppression of Ctrl-G on mac when 
102
          //ctrl and alt are swapped (alt is the compose key for international
103
          //keyboards on mac, so we allow swapping of Alt and G keys via a
104
          //shortcut so users have full use of their keyboard when necessary.
105
          //In swap mode, this binding is actually invoked on Ctrl-Shift-G,
106
          //not Alt-Shift-G.  Wish there were a better way to solve it.
107
          new MultiKeyBinding(
108
              KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
109
              ExtKit.gotoAction
110
          ),
100
          new MultiKeyBinding(
111
          new MultiKeyBinding(
101
              KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK),
112
              KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK),
102
              ExtKit.completionShowAction
113
              ExtKit.completionShowAction
103
          ),
114
          ),
104
          new MultiKeyBinding( // Japanese Solaris uses CTRL+SPACE for IM
115
          new MultiKeyBinding( // Japanese Solaris uses CTRL+SPACE for IM
105
              KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, InputEvent.CTRL_MASK),
116
              KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, MENU_MASK),
106
              ExtKit.completionShowAction
117
              ExtKit.completionShowAction
107
          ),
118
          ),
108
          new MultiKeyBinding(
119
          new MultiKeyBinding(
(-)editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml (+3 lines)
Lines 97-102 Link Here
97
    <bind actionName="escape" key="ESCAPE"/>
97
    <bind actionName="escape" key="ESCAPE"/>
98
    <bind actionName="find" key="D-F"/>
98
    <bind actionName="find" key="D-F"/>
99
    <bind actionName="goto" key="C-G"/>
99
    <bind actionName="goto" key="C-G"/>
100
    <!-- Mac binding for when Ctrl & Alt swapped - we suppress C-G so Alt-G
101
      will produce a valid character -->
102
    <bind actionName="goto" key="AS-G"/>
100
    <bind actionName="match-brace" key="D-OPEN_BRACKET"/>
103
    <bind actionName="match-brace" key="D-OPEN_BRACKET"/>
101
    <bind actionName="replace" key="C-H"/>
104
    <bind actionName="replace" key="C-H"/>
102
    <bind actionName="selection-match-brace" key="DS-B"/>
105
    <bind actionName="selection-match-brace" key="DS-B"/>
(-)ide/applemenu/src/org/netbeans/modules/applemenu/Bundle.properties (+3 lines)
Lines 18-20 Link Here
18
    and moves some standard menu items there - Tools | Options becomes \
18
    and moves some standard menu items there - Tools | Options becomes \
19
    Preferences, Help | About becomes about, File | Exit becomes Quit.
19
    Preferences, Help | About becomes about, File | Exit becomes Quit.
20
20
21
LBL_SwapCtrlAlt=Swap Ctrl and Alt
22
MSG_Swapped=Ctrl and Alt swapped
23
MSG_NotSwapped=Ctrl and Alt swapping off
(-)ide/applemenu/src/org/netbeans/modules/applemenu/DefaultGlobalKeyBindings.xml (-1 / +1 lines)
Lines 120-126 Link Here
120
    <bind actionName="find" key="D-F"/>
120
    <bind actionName="find" key="D-F"/>
121
    <bind actionName="goto" key="C-G"/>
121
    <bind actionName="goto" key="C-G"/>
122
    <bind actionName="match-brace" key="D-OPEN_BRACKET"/>
122
    <bind actionName="match-brace" key="D-OPEN_BRACKET"/>
123
    <bind actionName="replace" key="C-H"/>
123
    <bind actionName="replace" key="D-R"/>
124
    <bind actionName="selection-match-brace" key="DS-B"/>
124
    <bind actionName="selection-match-brace" key="DS-B"/>
125
    <bind actionName="shift-insert-break" key="S-ENTER"/>
125
    <bind actionName="shift-insert-break" key="S-ENTER"/>
126
    <bind actionName="show-popup-menu" key="S-F10"/>
126
    <bind actionName="show-popup-menu" key="S-F10"/>
(-)ide/applemenu/src/org/netbeans/modules/applemenu/SwapCtrlAltAction.java (+84 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
/*
14
 * SwapCtrlAltAction.java
15
 *
16
 * Created on October 1, 2004, 1:48 PM
17
 */
18
19
package org.netbeans.modules.applemenu;
20
21
import org.openide.awt.StatusDisplayer;
22
import org.openide.util.HelpCtx;
23
import org.openide.util.NbBundle;
24
import org.openide.util.actions.BooleanStateAction;
25
26
/**
27
 * Apple uses Alt- as the compose key on international keyboards.  This causes
28
 * a bunch of conflicts with key bindings.  There are low level patches in the
29
 * editor and window system to swap Ctrl- and Alt- if a system property is set
30
 * to true.  
31
 * <p>
32
 * This action toggles the system property <code>nb.mac.swap.ctrl.and.alt</code>,
33
 * so that international keyboard users can switch between having alt bindings
34
 * and having full use of Alt as a compose key on the mac.
35
 * <p>
36
 * In a perfect world, we would simply not have any Alt- bindings on the mac, and
37
 * use Ctrl as an appropriate substitute.  Currently, that is not a realistic
38
 * option, as there is no way to detect when an international keyboard is 
39
 * present, and using Alt- for bindings on U.S. keyboards is very likely the
40
 * most intuitive choice (not to mention the docs issues it would cause).
41
 *
42
 * @author Tim Boudreau
43
 * @see org.netbeans.core.windows.ShortcutAndMenuKeyEventProcessor#dispatchKeyEvent
44
 * @see org.netbeans.editor.BaseKit.DefaultKeyTypedAction#actionPerformed
45
 */
46
public class SwapCtrlAltAction extends BooleanStateAction {
47
    private static final String PROP_KEY = "nb.mac.swap.ctrl.and.alt"; //NOI18N
48
    
49
    /** Creates a new instance of SwapCtrlAltAction */
50
    public SwapCtrlAltAction() {
51
        
52
    }
53
    
54
    public void actionPerformed (java.awt.event.ActionEvent ev) {
55
        super.actionPerformed (ev);
56
        boolean hasProp = propSet();
57
        if (hasProp) {
58
            System.setProperty(PROP_KEY, "false"); //NOI18N
59
            StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(
60
                SwapCtrlAltAction.class, "MSG_NotSwapped")); //NOI18N
61
        } else {
62
            System.setProperty(PROP_KEY, "true"); //NOI18N
63
            StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(
64
                SwapCtrlAltAction.class, "MSG_Swapped")); //NOI18N
65
        }
66
    }
67
    
68
    private boolean propSet () {
69
        return Boolean.getBoolean (PROP_KEY);
70
    }
71
    
72
    protected void initialize () {
73
        super.initialize();
74
        putProperty(PROP_BOOLEAN_STATE, propSet() ? Boolean.TRUE : Boolean.FALSE);
75
    }
76
    
77
    public HelpCtx getHelpCtx() {
78
        return HelpCtx.DEFAULT_HELP;
79
    }
80
    
81
    public String getName() {
82
        return NbBundle.getMessage (SwapCtrlAltAction.class, "LBL_SwapCtrlAlt"); //NOI18N
83
    }
84
}
(-)ide/applemenu/src/org/netbeans/modules/applemenu/layer.xml (-1 / +11 lines)
Lines 34-40 Link Here
34
            <file name="org-netbeans-core-actions-AboutAction.instance_hidden"/>
34
            <file name="org-netbeans-core-actions-AboutAction.instance_hidden"/>
35
        </folder>
35
        </folder>
36
        
36
        
37
-->        
37
-->
38
        <folder name="Tools">
39
            <file name="org-netbeans-modules-applemenu-SwapCtrlAltAction.instance"/>
40
        </folder>
41
38
    </folder>
42
    </folder>
39
    
43
    
40
    <folder name="Shortcuts">
44
    <folder name="Shortcuts">
Lines 62-67 Link Here
62
        </file>
66
        </file>
63
67
64
        <file name="D-BACK_QUOTE.shadow_hidden"/>
68
        <file name="D-BACK_QUOTE.shadow_hidden"/>
69
        
70
        <file name="C-H.shadow_hidden"/>
71
        
72
        <file name="MS-BACK_SLASH.instance">
73
            <attr name="instanceClass" stringvalue="org.netbeans.modules.applemenu.SwapCtrlAltAction"/>
74
        </file>
65
    </folder>
75
    </folder>
66
76
67
    <folder name="Editors">
77
    <folder name="Editors">
(-)openide/io/src/org/openide/windows/InputOutput.java (-1 / +6 lines)
Lines 35-40 Link Here
35
 * 
35
 * 
36
 * @see OutputWriter
36
 * @see OutputWriter
37
 * @author   Ian Formanek, Jaroslav Tulach, Petr Hamernik, Ales Novak, Jan Jancura
37
 * @author   Ian Formanek, Jaroslav Tulach, Petr Hamernik, Ales Novak, Jan Jancura
38
 * @deprecated - use the extension interface org.openide.io.InputOutput instead
38
 */
39
 */
39
public interface InputOutput {
40
public interface InputOutput {
40
41
Lines 119-125 Link Here
119
    /** Set whether the output window should take focus when anything is written to it.
120
    /** Set whether the output window should take focus when anything is written to it.
120
    * <strong>Note that this really means the output window will steal keyboard
121
    * <strong>Note that this really means the output window will steal keyboard
121
    * focus whenever a line of output is written.  This is generally an extremely
122
    * focus whenever a line of output is written.  This is generally an extremely
122
    * bad idea and strongly recommended against by most UI guidelines.</strong> 
123
    * bad idea and strongly recommended against by most UI guidelines.</strong>
124
    *
125
    * @deprecated - there are more polite ways to request user attention than
126
    *  stealing keyboard focus - this is almost always wrong from a usability
127
    *  perspective
123
    * @return <code>true</code> to take focus
128
    * @return <code>true</code> to take focus
124
    */
129
    */
125
    public void setFocusTaken(boolean value);
130
    public void setFocusTaken(boolean value);
(-)openide/io/src/org/openide/windows/OutputWriter.java (-11 / +3 lines)
Lines 45-63 Link Here
45
    public abstract void println(String s, OutputListener l) throws IOException;
45
    public abstract void println(String s, OutputListener l) throws IOException;
46
46
47
    /** Clear the output pane.
47
    /** Clear the output pane.
48
    * <b>Note on the current implementation (core/output2):</b> After calling
49
    * this method, do not try to use the instance of OutputWriter it was called
50
    * on again - call <code>IOProvider.getDefault().getIO(name, false).getOut()</code> to 
51
    * fetch the new writer created as a result of this call.  Generally it is
52
    * preferable not to hold references to either OutputWriter or InputOutput,
53
    * but rather to fetch them as needed from <code>IOProvider.getDefault()</code>.  This
54
    * avoids memory leaks and ensures that the instance you're calling is 
55
    * always the one that is actually represented in the UI.
56
    * <p>
57
    * Expect this method to be deprecated in a future release and an 
58
    * equivalent created in <code>InputOutput</code>.
59
    * 
48
    * 
60
    * @throws IOException if there is a problem
49
    * @throws IOException if there is a problem
50
    * @deprecated - ambiguous what it means to reset the stderr but not the stdout.
51
    *  use org.openide.io.InputOutput.reset() (org.openide.IO.inputOutput, not
52
    * org.openide.WINDOWS.InputOutput).
61
    */
53
    */
62
    public abstract void reset() throws IOException;
54
    public abstract void reset() throws IOException;
63
}
55
}

Return to bug 49806