2011/08/05 - Jakarta Cactus has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.cactus.eclipse.quickfix;
22
23 import org.apache.cactus.eclipse.runner.ui.CactifyActionDelegate;
24 import org.apache.cactus.eclipse.runner.ui.CactusMessages;
25 import org.apache.cactus.eclipse.runner.ui.CactusPlugin;
26 import org.eclipse.jdt.core.IJavaProject;
27 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
28 import org.eclipse.jface.text.IDocument;
29 import org.eclipse.jface.text.contentassist.IContextInformation;
30 import org.eclipse.swt.graphics.Image;
31 import org.eclipse.swt.graphics.Point;
32
33
34
35
36
37
38 public class AddCactusClassesCompletionProposal implements IJavaCompletionProposal {
39
40
41
42 private final String name;
43
44
45
46 private final String proposalInfo;
47
48
49
50 private final int relevance;
51
52
53
54 private IJavaProject project;
55
56
57
58
59 public AddCactusClassesCompletionProposal(
60 String name,
61 int relevance,
62 IJavaProject theWorkingProject) {
63 this.name = name;
64 this.relevance = relevance;
65 this.project = theWorkingProject;
66
67 final StringBuffer buffer = new StringBuffer(80);
68 buffer.append(CactusMessages.getString("Cactus.quickFix.description"));
69 this.proposalInfo = buffer.toString();
70 }
71
72
73
74
75 public int getRelevance() {
76 return relevance;
77 }
78
79
80
81
82
83 public void apply(IDocument document) {
84 CactifyActionDelegate cactifyDelegate = new CactifyActionDelegate();
85 cactifyDelegate.setSelectedProject(project);
86
87 cactifyDelegate.run(null);
88 }
89
90
91
92
93 public Point getSelection(IDocument document) {
94 return null;
95 }
96
97
98
99
100 public String getAdditionalProposalInfo() {
101 return proposalInfo;
102 }
103
104
105
106
107 public String getDisplayString() {
108 return name;
109 }
110
111
112
113
114 public Image getImage() {
115 return CactusPlugin.getDefault().getImageRegistry().get(CactusPlugin.CACTUS_RUN_IMAGE);
116 }
117
118
119
120 public IContextInformation getContextInformation() {
121 return null;
122 }
123
124
125
126 public IJavaCompletionProposal createTypeProposal() {
127 return null;
128 }
129 }
130