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

(-)a/editor.lib/nbproject/project.properties (-1 / +1 lines)
Lines 39-45 Link Here
39
39
40
javac.compilerargs=-Xlint:unchecked
40
javac.compilerargs=-Xlint:unchecked
41
javac.source=1.5
41
javac.source=1.5
42
spec.version.base=1.30.0
42
spec.version.base=1.31.0
43
is.autoload=true
43
is.autoload=true
44
44
45
javadoc.arch=${basedir}/arch.xml
45
javadoc.arch=${basedir}/arch.xml
(-)a/editor.lib/src/org/netbeans/lib/editor/hyperlink/HyperlinkOperation.java (-2 / +12 lines)
Lines 96-101 Link Here
96
96
97
    private boolean        hyperlinkEnabled;
97
    private boolean        hyperlinkEnabled;
98
    private int            actionKeyMask;
98
    private int            actionKeyMask;
99
    private int            altActionKeyMask;
99
    
100
    
100
    public static void ensureRegistered(JTextComponent component, String mimeType) {
101
    public static void ensureRegistered(JTextComponent component, String mimeType) {
101
        if (component.getClientProperty(KEY) == null) {
102
        if (component.getClientProperty(KEY) == null) {
Lines 106-111 Link Here
106
    private static synchronized Cursor getMouseCursor(HyperlinkType type) {
107
    private static synchronized Cursor getMouseCursor(HyperlinkType type) {
107
        switch (type) {
108
        switch (type) {
108
            case GO_TO_DECLARATION:
109
            case GO_TO_DECLARATION:
110
            case GO_TO_ALT_DECLARATION:
109
                return Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
111
                return Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
110
            default:
112
            default:
111
                throw new UnsupportedOperationException();
113
                throw new UnsupportedOperationException();
Lines 196-201 Link Here
196
198
197
        Preferences prefs = MimeLookup.getLookup(DocumentUtilities.getMimeType(component)).lookup(Preferences.class);
199
        Preferences prefs = MimeLookup.getLookup(DocumentUtilities.getMimeType(component)).lookup(Preferences.class);
198
        this.actionKeyMask = prefs.getInt(SimpleValueNames.HYPERLINK_ACTIVATION_MODIFIERS, InputEvent.CTRL_DOWN_MASK);
200
        this.actionKeyMask = prefs.getInt(SimpleValueNames.HYPERLINK_ACTIVATION_MODIFIERS, InputEvent.CTRL_DOWN_MASK);
201
        this.altActionKeyMask = prefs.getInt(SimpleValueNames.ALT_HYPERLINK_ACTIVATION_MODIFIERS, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK);
199
    }
202
    }
200
    
203
    
201
    public void mouseMoved(MouseEvent e) {
204
    public void mouseMoved(MouseEvent e) {
Lines 221-227 Link Here
221
    }
224
    }
222
    
225
    
223
    private HyperlinkType getHyperlinkType(InputEvent e) {
226
    private HyperlinkType getHyperlinkType(InputEvent e) {
224
        return ((e.getModifiers() | e.getModifiersEx()) & actionKeyMask) == actionKeyMask ? HyperlinkType.GO_TO_DECLARATION : null;
227
        int modifiers = e.getModifiers() | e.getModifiersEx();
228
        if ((modifiers & altActionKeyMask) == altActionKeyMask) {
229
            return HyperlinkType.GO_TO_ALT_DECLARATION;
230
        } else if ((modifiers & actionKeyMask) == actionKeyMask) {
231
            return HyperlinkType.GO_TO_DECLARATION;
232
        }
233
        return null;
225
    }
234
    }
226
    
235
    
227
    private void performHyperlinking(int position, HyperlinkType type) {
236
    private void performHyperlinking(int position, HyperlinkType type) {
Lines 357-364 Link Here
357
    }
366
    }
358
367
359
    public void keyReleased(KeyEvent e) {
368
    public void keyReleased(KeyEvent e) {
360
        if ((e.getModifiers() & actionKeyMask) == 0)
369
        if (getHyperlinkType(e) == null) {
361
            unHyperlink(true);
370
            unHyperlink(true);
371
        }
362
    }
372
    }
363
373
364
    public void keyPressed(KeyEvent e) {
374
    public void keyPressed(KeyEvent e) {
(-)a/editor.lib/src/org/netbeans/lib/editor/hyperlink/spi/HyperlinkType.java (-4 / +9 lines)
Lines 40-56 Link Here
40
 */
40
 */
41
package org.netbeans.lib.editor.hyperlink.spi;
41
package org.netbeans.lib.editor.hyperlink.spi;
42
42
43
/**A type of work for hyperlinks. Currently, there is only one hyperlink type
43
/**A type of work for hyperlinks. 
44
 * (go to declaration), but more can be introduced in the future.
45
 *
44
 *
46
 * @since 1.18
45
 * @since 1.18
47
 * @author Jan Lahoda
46
 * @author Jan Lahoda
48
 */
47
 */
49
public enum HyperlinkType {
48
public enum HyperlinkType {
50
    
49
    
51
    /**
50
    /** 
51
     * go to declaration
52
     * @since 1.18
52
     * @since 1.18
53
     */
53
     */
54
    GO_TO_DECLARATION,
54
    GO_TO_DECLARATION,
55
    
55
56
    /**
57
     * go to alternative declaration 
58
     * @since 1.31
59
     */
60
    GO_TO_ALT_DECLARATION,
56
}
61
}
(-)a/editor.settings/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.editor.settings/1
2
OpenIDE-Module: org.netbeans.modules.editor.settings/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/settings/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/settings/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.23
4
OpenIDE-Module-Specification-Version: 1.24
5
OpenIDE-Module-Needs: org.netbeans.api.editor.settings.implementation
5
OpenIDE-Module-Needs: org.netbeans.api.editor.settings.implementation
(-)a/editor.settings/src/org/netbeans/api/editor/settings/SimpleValueNames.java (+6 lines)
Lines 373-378 Link Here
373
     */
373
     */
374
    public static final String HYPERLINK_ACTIVATION_MODIFIERS = "hyperlink-activation-modifiers"; //NOI18N
374
    public static final String HYPERLINK_ACTIVATION_MODIFIERS = "hyperlink-activation-modifiers"; //NOI18N
375
    
375
    
376
    /**
377
     * Modifiers for which the alternative hyperlinks should be enabled.
378
     * @since 1.24
379
     */
380
    public static final String ALT_HYPERLINK_ACTIVATION_MODIFIERS = "alt-hyperlink-activation-modifiers"; //NOI18N
381
376
    /** 
382
    /** 
377
     * Whether popup menu will be displayed on mouse right-click or not.
383
     * Whether popup menu will be displayed on mouse right-click or not.
378
     * It's set to true by default.
384
     * It's set to true by default.

Return to bug 157705