/
NewAnnotationWizardPage.java
127 lines (114 loc) · 3.11 KB
/
NewAnnotationWizardPage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*******************************************************************************
* Copyright (c) 2017 Red Hat, Inc and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Red Hat, Inc - initial API and implementation
*******************************************************************************/
package org.eclipse.reddeer.eclipse.jdt.ui.wizards;
import org.eclipse.reddeer.core.reference.ReferencedComposite;
import org.eclipse.reddeer.jface.wizard.WizardPage;
import org.eclipse.reddeer.swt.impl.button.CheckBox;
import org.eclipse.reddeer.swt.impl.button.RadioButton;
import org.eclipse.reddeer.swt.impl.text.LabeledText;
/**
* Wizard page for creating an annotation.
*/
public class NewAnnotationWizardPage extends WizardPage {
public NewAnnotationWizardPage(ReferencedComposite referencedComposite) {
super(referencedComposite);
}
/**
* Sets a given package name.
*
* @param packageName
* Package name
*/
public NewAnnotationWizardPage setPackage(String packageName) {
new LabeledText(this, "Package:").setText(packageName);
return this;
}
/**
* Sets a given source folder.
*
* @param sourceFolder
* Source folder
*/
public NewAnnotationWizardPage setSourceFolder(String sourceFolder) {
new LabeledText(this, "Source folder:").setText(sourceFolder);
return this;
}
/**
* Sets a given enclosing type.
*
* @param enclosing
* Eclosing type
*/
public NewAnnotationWizardPage setEnclosingType(boolean enclosing) {
new CheckBox(this, "Enclosing type:").toggle(enclosing);
return this;
}
/**
* Sets a given name.
*
* @param name
* Name
*/
public NewAnnotationWizardPage setName(String name) {
new LabeledText(this, "Name:").setText(name);
return this;
}
/**
* Sets generating comments.
*
* @param generate
* Indicates whether to generate comments
*/
public NewAnnotationWizardPage setGenerateComments(boolean generate) {
new CheckBox(this, "Generate comments").toggle(generate);
return this;
}
/**
* Sets public visibility.
*
* @param isPublic Is public?
*/
public NewAnnotationWizardPage setPublic(boolean isPublic) {
new RadioButton(this, "public").toggle(isPublic);
return this;
}
/**
* Sets default visibility.
*
* @param isDefault
* Is default?
*/
public NewAnnotationWizardPage setDefault(boolean isDefault) {
new RadioButton(this, "default").toggle(isDefault);
return this;
}
/**
* Sets private visibility.
*
* @param isPrivate
* Is private?
*/
public NewAnnotationWizardPage setPrivate(boolean isPrivate) {
new RadioButton(this, "private").toggle(isPrivate);
return this;
}
/**
* Sets protected visibility.
*
* @param isProtected
* Is protected?
*/
public NewAnnotationWizardPage setProtected(boolean isProtected) {
new RadioButton(this, "protected").toggle(isProtected);
return this;
}
}