Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 240442
Collapse All | Expand All

(-)plugin.xml (-3 / +33 lines)
Lines 2-8 Link Here
2
<?eclipse version="3.0"?>
2
<?eclipse version="3.0"?>
3
<plugin>
3
<plugin>
4
    <extension-point id="taskEditorExtensions" name="Task Editor Extension" schema="schema/taskEditorExtensions.exsd"/>
4
    <extension-point id="taskEditorExtensions" name="Task Editor Extension" schema="schema/taskEditorExtensions.exsd"/>
5
5
    <extension-point id="resourceHyperlinkExtensions" name="Resource Hyperlink Extension" schema="schema/resourceHyperlinkExtensions.exsd"/>
6
    
6
	<extension point="org.eclipse.ui.views">
7
	<extension point="org.eclipse.ui.views">
7
     	<category name="Experimental" id="org.eclipse.mylyn.sandbox"/>
8
     	<category name="Experimental" id="org.eclipse.mylyn.sandbox"/>
8
    </extension>
9
    </extension>
Lines 404-411 Link Here
404
      </propertyTester>
405
      </propertyTester>
405
   </extension>
406
   </extension>
406
   
407
   
407
   
408
    <extension
408
   
409
         point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
410
      <hyperlinkDetector
411
            class="org.eclipse.mylyn.internal.sandbox.ui.hyperlinks.ResourceHyperlinkDetector"
412
            id="org.eclipse.mylyn.sandbox.ui.hyperlinkDetector"
413
            name="Resource Hyperlink Detector"
414
            targetId="org.eclipse.ui.DefaultTextEditor">
415
      </hyperlinkDetector>
416
   </extension>
417
418
    <extension
419
          point="org.eclipse.mylyn.sandbox.ui.resourceHyperlinkExtensions">
420
       <resourceHyperlinkExtension
421
             class="org.eclipse.mylyn.internal.sandbox.ui.hyperlinks.JavaResourceHyperlinkExtension"
422
             fileType="java"
423
             generatedPrefix="java class">
424
       </resourceHyperlinkExtension>  
425
       <resourceHyperlinkExtension
426
             class="org.eclipse.mylyn.internal.sandbox.ui.hyperlinks.CppResourceHyperlinkExtension"
427
             
428
             fileType="cpp"
429
             generatedPrefix="cpp class">
430
431
       </resourceHyperlinkExtension>
432
       <resourceHyperlinkExtension
433
             class="org.eclipse.mylyn.internal.sandbox.ui.hyperlinks.UnknownResourceHyperlinkExtension"
434
             fileType="unknown"
435
             generatedPrefix="file">
436
       </resourceHyperlinkExtension>
437
    </extension>
438
409
   <!--
439
   <!--
410
   <extension point="org.eclipse.mylyn.tasks.ui.presentations">
440
   <extension point="org.eclipse.mylyn.tasks.ui.presentations">
411
      <presentation 
441
      <presentation 
(-)src/org/eclipse/mylyn/internal/sandbox/ui/hyperlinks/CppResourceHyperlink.java (+44 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.hyperlinks;
10
11
import org.eclipse.jface.text.IRegion;
12
import org.eclipse.jface.text.hyperlink.IHyperlink;
13
14
/**
15
 * @author Jingwen Ou
16
 */
17
public class CppResourceHyperlink implements IHyperlink {
18
19
	private final IRegion region;
20
21
	private final String typeName;
22
23
	public CppResourceHyperlink(IRegion region, String typeName) {
24
		this.region = region;
25
		this.typeName = typeName;
26
	}
27
28
	public IRegion getHyperlinkRegion() {
29
		return region;
30
	}
31
32
	public String getHyperlinkText() {
33
		return "Open " + typeName;
34
	}
35
36
	public String getTypeLabel() {
37
		return null;
38
	}
39
40
	public void open() {
41
		// TODO: check out cdt
42
	}
43
44
}
(-)src/org/eclipse/mylyn/internal/sandbox/ui/hyperlinks/UnknownResourceHyperlink.java (+44 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.hyperlinks;
10
11
import org.eclipse.jface.text.IRegion;
12
import org.eclipse.jface.text.hyperlink.IHyperlink;
13
14
/**
15
 * @author Jingwen Ou
16
 */
17
public class UnknownResourceHyperlink implements IHyperlink {
18
	private final IRegion region;
19
20
	private final String typeName;
21
22
	public UnknownResourceHyperlink(IRegion region, String typeName) {
23
		this.region = region;
24
		this.typeName = typeName;
25
	}
26
27
	public IRegion getHyperlinkRegion() {
28
		return region;
29
	}
30
31
	public String getHyperlinkText() {
32
		return "Open " + typeName;
33
	}
34
35
	public String getTypeLabel() {
36
		// ignore
37
		return null;
38
	}
39
40
	public void open() {
41
		// TODO: open default editor for specific resource
42
	}
43
44
}
(-)src/org/eclipse/mylyn/internal/sandbox/ui/hyperlinks/UnknownResourceHyperlinkExtension.java (+35 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.hyperlinks;
10
11
import org.eclipse.jface.text.IRegion;
12
import org.eclipse.jface.text.hyperlink.IHyperlink;
13
14
/**
15
 * @author Jingwen Ou
16
 */
17
public class UnknownResourceHyperlinkExtension extends AbstractResourceHyperlinkExtension {
18
	private static final String UNKNOWN_PREFIX = "file\\s";
19
20
	@Override
21
	protected String getReourceExpressions() {
22
		return UNKNOWN_PREFIX + DEFAULT_QUALIFIED_NAME;
23
	}
24
25
	@Override
26
	public boolean resourceExists(String resourceName) {
27
		// ignore
28
		return true;
29
	}
30
31
	@Override
32
	protected IHyperlink getHyperlink(IRegion region, String resourceName) {
33
		return new UnknownResourceHyperlink(region, resourceName);
34
	}
35
}
(-)src/org/eclipse/mylyn/internal/sandbox/ui/hyperlinks/CppResourceHyperlinkExtension.java (+37 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.hyperlinks;
10
11
import org.eclipse.jface.text.IRegion;
12
import org.eclipse.jface.text.hyperlink.IHyperlink;
13
14
/**
15
 * @author Jingwen Ou
16
 */
17
public class CppResourceHyperlinkExtension extends AbstractResourceHyperlinkExtension {
18
19
	private static final String CPP_PREFIX = "cpp\\sclass\\s";
20
21
	@Override
22
	protected String getReourceExpressions() {
23
		return CPP_PREFIX + DEFAULT_QUALIFIED_NAME;
24
	}
25
26
	@Override
27
	public boolean resourceExists(String resourceName) {
28
		// TODO: check out cdt for answers, ignore for now
29
		return false;
30
	}
31
32
	@Override
33
	protected IHyperlink getHyperlink(IRegion region, String resourceName) {
34
		return new CppResourceHyperlink(region, resourceName);
35
	}
36
37
}

Return to bug 240442