Skip to content

Commit 6453ee5

Browse files
committed
ENH(Refactor class names to ease coding)
1 parent dceab71 commit 6453ee5

File tree

114 files changed

+1831
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1831
-1599
lines changed

src/main/java/mmarquee/automation/UIAutomation.java

Lines changed: 68 additions & 68 deletions
Large diffs are not rendered by default.

src/main/java/mmarquee/automation/controls/AutomationAppBar.java renamed to src/main/java/mmarquee/automation/controls/AppBar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
* @author Mark Humphreys
2222
* Date 02/03/2016.
2323
*/
24-
public class AutomationAppBar extends AutomationBase {
24+
public class AppBar extends AutomationBase {
2525
/**
2626
* <p>
27-
* Constructor for the AutomationAppBar.
27+
* Constructor for the AppBar.
2828
* </p>
2929
* <p>
3030
* This element seems to be undocumented by Microsoft
3131
* </p>
3232
* @param builder The builder
3333
*/
34-
public AutomationAppBar(final ElementBuilder builder) {
34+
public AppBar(final ElementBuilder builder) {
3535
super(builder);
3636
}
3737
}

src/main/java/mmarquee/automation/controls/AutomationApplication.java renamed to src/main/java/mmarquee/automation/controls/Application.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @author Mark Humphreys
3636
* Date 26/01/2016.
3737
*/
38-
public class AutomationApplication extends AutomationBase {
38+
public class Application extends AutomationBase {
3939

4040
/**
4141
* The window handle.
@@ -115,10 +115,10 @@ public void waitForInputIdle() {
115115
/**
116116
* Gets the window associated with the title.
117117
* @param title The title to look for.
118-
* @return An AutomationWindow.
118+
* @return An Window.
119119
* @throws AutomationException Cannot find element.
120120
*/
121-
public AutomationWindow getWindow(final String title)
121+
public Window getWindow(final String title)
122122
throws AutomationException {
123123

124124
AutomationElement foundElement = null;
@@ -134,7 +134,7 @@ public AutomationWindow getWindow(final String title)
134134
}
135135

136136
if (foundElement != null) {
137-
return new AutomationWindow(new ElementBuilder(foundElement));
137+
return new Window(new ElementBuilder(foundElement));
138138
} else {
139139
throw new ElementNotFoundException(title);
140140
}
@@ -143,10 +143,10 @@ public AutomationWindow getWindow(final String title)
143143
/**
144144
* Gets the window associated with the classname.
145145
* @param className The class name of the element to look for
146-
* @return An AutomationWindow.
146+
* @return An Window.
147147
* @throws AutomationException Cannot find element.
148148
*/
149-
public AutomationWindow getWindowByClassName(final String className)
149+
public Window getWindowByClassName(final String className)
150150
throws AutomationException {
151151

152152
AutomationElement foundElement = null;
@@ -162,7 +162,7 @@ public AutomationWindow getWindowByClassName(final String className)
162162
}
163163

164164
if (foundElement != null) {
165-
return new AutomationWindow(new ElementBuilder(foundElement));
165+
return new Window(new ElementBuilder(foundElement));
166166
} else {
167167
throw new ElementNotFoundException("matching " + className);
168168
}
@@ -171,10 +171,10 @@ public AutomationWindow getWindowByClassName(final String className)
171171
/**
172172
* Gets the window associated with the title.
173173
* @param titlePattern A pattern matching the title to look for.
174-
* @return An AutomationWindow.
174+
* @return An Window.
175175
* @throws AutomationException Cannot find element.
176176
*/
177-
public AutomationWindow getWindow(final Pattern titlePattern)
177+
public Window getWindow(final Pattern titlePattern)
178178
throws AutomationException {
179179

180180
AutomationElement foundElement = null;
@@ -190,7 +190,7 @@ public AutomationWindow getWindow(final Pattern titlePattern)
190190
}
191191

192192
if (foundElement != null) {
193-
return new AutomationWindow(new ElementBuilder(foundElement));
193+
return new Window(new ElementBuilder(foundElement));
194194
} else {
195195
throw new ElementNotFoundException("matching " + titlePattern);
196196
}
@@ -203,7 +203,7 @@ public AutomationWindow getWindow(final Pattern titlePattern)
203203
* @return The found control
204204
* @throws AutomationException Something has gone wrong
205205
*/
206-
public AutomationWindow getWindow(final Search search)
206+
public Window getWindow(final Search search)
207207
throws AutomationException {
208208
if (search.getHasNamePattern()) {
209209
return getWindow(search.getNamePattern());
@@ -217,11 +217,11 @@ public AutomationWindow getWindow(final Search search)
217217
}
218218

219219
/**
220-
* Constructor for the AutomationApplication.
220+
* Constructor for the Application.
221221
*
222222
* @param builder The builder
223223
*/
224-
public AutomationApplication(final ElementBuilder builder) {
224+
public Application(final ElementBuilder builder) {
225225
super(builder);
226226
this.isAttached = builder.getAttached();
227227
this.user32 = builder.getUser32();

src/main/java/mmarquee/automation/controls/AutomationBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ protected PointerByReference createAndCondition(
610610
* @return IUIAutomationElementArray
611611
* @throws AutomationException Error in automation library
612612
*/
613-
protected List<AutomationElement> findAll(
613+
protected java.util.List <AutomationElement> findAll(
614614
final TreeScope scope,
615615
final PointerByReference condition)
616616
throws AutomationException {

src/main/java/mmarquee/automation/controls/AutomationControlFactory.java

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -67,86 +67,86 @@ static AutomationBase get(final AutomationBase parent,
6767
String className = element.getClassName();
6868
switch (controlType) {
6969
case Button:
70-
return new AutomationButton(new ElementBuilder(element));
70+
return new Button(new ElementBuilder(element));
7171
case Calendar:
72-
return new AutomationCalendar(new ElementBuilder(element));
72+
return new Calendar(new ElementBuilder(element));
7373
case CheckBox:
74-
return new AutomationCheckBox(new ElementBuilder(element));
74+
return new CheckBox(new ElementBuilder(element));
7575
case ComboBox:
76-
return new AutomationComboBox(new ElementBuilder(element));
76+
return new ComboBox(new ElementBuilder(element));
7777
case Edit:
78-
if (AutomationPasswordEditBox.CLASS_NAME.equals(className)) {
79-
return new AutomationPasswordEditBox(new ElementBuilder(element));
80-
} else if (AutomationMaskedEdit.CLASS_NAME.equals(className)) {
81-
return new AutomationMaskedEdit(new ElementBuilder(element));
78+
if (PasswordEditBox.CLASS_NAME.equals(className)) {
79+
return new PasswordEditBox(new ElementBuilder(element));
80+
} else if (MaskedEdit.CLASS_NAME.equals(className)) {
81+
return new MaskedEdit(new ElementBuilder(element));
8282
}
83-
return new AutomationEditBox(new ElementBuilder(element));
83+
return new EditBox(new ElementBuilder(element));
8484
case Hyperlink:
85-
return new AutomationHyperlink(new ElementBuilder(element));
85+
return new Hyperlink(new ElementBuilder(element));
8686
case Image:
87-
return new AutomationImage(new ElementBuilder(element));
87+
return new Image(new ElementBuilder(element));
8888
case ListItem:
89-
return new AutomationListItem(new ElementBuilder(element));
89+
return new ListItem(new ElementBuilder(element));
9090
case List:
91-
return new AutomationList(new ElementBuilder(element));
91+
return new List(new ElementBuilder(element));
9292
case Menu:
9393
return new AutomationMenu(new ElementBuilder(element));
9494
case MenuBar:
9595
return new AutomationMainMenu(new ElementBuilder(element).parent(parent.getElement()));
9696
case MenuItem:
9797
return new AutomationMenuItem(new ElementBuilder(element));
9898
case ProgressBar:
99-
return new AutomationProgressBar(new ElementBuilder(element));
99+
return new ProgressBar(new ElementBuilder(element));
100100
case RadioButton:
101-
return new AutomationRadioButton(new ElementBuilder(element));
101+
return new RadioButton(new ElementBuilder(element));
102102
case Slider:
103-
return new AutomationSlider(new ElementBuilder(element));
103+
return new Slider(new ElementBuilder(element));
104104
case Spinner:
105-
return new AutomationSpinner(new ElementBuilder(element));
105+
return new Spinner(new ElementBuilder(element));
106106
case StatusBar:
107-
return new AutomationStatusBar(new ElementBuilder(element));
107+
return new StatusBar(new ElementBuilder(element));
108108
case Tab:
109-
return new AutomationTab(new ElementBuilder(element));
109+
return new Tab(new ElementBuilder(element));
110110
case TabItem:
111-
return new AutomationTabItem(new ElementBuilder(element));
111+
return new TabItem(new ElementBuilder(element));
112112
case Text:
113-
return new AutomationTextBox(new ElementBuilder(element));
113+
return new TextBox(new ElementBuilder(element));
114114
case ToolBar:
115-
return new AutomationToolBar(new ElementBuilder(element));
115+
return new ToolBar(new ElementBuilder(element));
116116
case Tree:
117-
return new AutomationTreeView(new ElementBuilder(element));
117+
return new TreeView(new ElementBuilder(element));
118118
case TreeItem:
119-
return new AutomationTreeViewItem(new ElementBuilder(element));
119+
return new TreeViewItem(new ElementBuilder(element));
120120
case Custom:
121-
return new AutomationCustom(new ElementBuilder(element));
121+
return new Custom(new ElementBuilder(element));
122122
case DataGrid:
123-
return new AutomationDataGrid(new ElementBuilder(element));
123+
return new DataGrid(new ElementBuilder(element));
124124
case Document:
125-
return new AutomationDocument(new ElementBuilder(element));
125+
return new Document(new ElementBuilder(element));
126126
case SplitButton:
127-
return new AutomationSplitButton(new ElementBuilder(element));
127+
return new SplitButton(new ElementBuilder(element));
128128
case Window:
129-
return new AutomationWindow(new ElementBuilder(element));
129+
return new Window(new ElementBuilder(element));
130130
case Pane:
131131
switch (className) {
132-
case AutomationReBar.CLASS_NAME:
133-
return new AutomationReBar(new ElementBuilder(element));
134-
case AutomationRibbonBar.CLASS_NAME:
135-
return new AutomationRibbonBar(new ElementBuilder(element));
136-
case AutomationRibbonCommandBar.CLASS_NAME:
137-
return new AutomationRibbonCommandBar(new ElementBuilder(element));
138-
case AutomationRibbonWorkPane.CLASS_NAME:
139-
return new AutomationRibbonWorkPane(new ElementBuilder(element));
140-
case AutomationNUIPane.CLASS_NAME:
141-
return new AutomationNUIPane(new ElementBuilder(element));
142-
case AutomationNetUIHWND.CLASS_NAME:
143-
return new AutomationNetUIHWND(new ElementBuilder(element));
132+
case ReBar.CLASS_NAME:
133+
return new ReBar(new ElementBuilder(element));
134+
case RibbonBar.CLASS_NAME:
135+
return new RibbonBar(new ElementBuilder(element));
136+
case RibbonCommandBar.CLASS_NAME:
137+
return new RibbonCommandBar(new ElementBuilder(element));
138+
case RibbonWorkPane.CLASS_NAME:
139+
return new RibbonWorkPane(new ElementBuilder(element));
140+
case NUIPane.CLASS_NAME:
141+
return new NUIPane(new ElementBuilder(element));
142+
case NetUIHWND.CLASS_NAME:
143+
return new NetUIHWND(new ElementBuilder(element));
144144
}
145-
return new AutomationPanel(new ElementBuilder(element));
145+
return new Panel(new ElementBuilder(element));
146146
case TitleBar:
147-
return new AutomationTitleBar(new ElementBuilder(element));
147+
return new TitleBar(new ElementBuilder(element));
148148
case AppBar:
149-
return new AutomationAppBar(new ElementBuilder(element));
149+
return new AppBar(new ElementBuilder(element));
150150
// No Custom controls, yet:
151151
case ScrollBar:
152152
case ToolTip:
@@ -160,7 +160,7 @@ static AutomationBase get(final AutomationBase parent,
160160
case SemanticZoom:
161161
default:
162162
// best try
163-
return new AutomationContainer(new ElementBuilder(element));
163+
return new Container(new ElementBuilder(element));
164164
}
165165
}
166166
}

src/main/java/mmarquee/automation/controls/AutomationButton.java renamed to src/main/java/mmarquee/automation/controls/Button.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
* @author Mark Humphreys
2626
* Date 02/02/2016.
2727
*/
28-
public class AutomationButton
28+
public class Button
2929
extends AutomationBase
30-
implements ImplementsClick, ImplementsFocus, ImplementsLegacyIAccessible {
30+
implements ImplementsClick,
31+
ImplementsFocus,
32+
ImplementsLegacyIAccessible {
3133
/**
3234
* The control type.
3335
*/
@@ -39,11 +41,11 @@ public class AutomationButton
3941
private LegacyIAccessible accessiblePattern;
4042

4143
/**
42-
* Constructor for the AutomationButton.
44+
* Constructor for the Button.
4345
*
4446
* @param builder The builder
4547
*/
46-
public AutomationButton(final ElementBuilder builder) {
48+
public Button(final ElementBuilder builder) {
4749
super(builder);
4850
}
4951

@@ -77,7 +79,8 @@ public String getValueFromIAccessible()
7779
throws PatternNotFoundException, AutomationException {
7880
if (this.accessiblePattern == null) {
7981
try {
80-
this.accessiblePattern = this.requestAutomationPattern(LegacyIAccessible.class);
82+
this.accessiblePattern =
83+
this.requestAutomationPattern(LegacyIAccessible.class);
8184
} catch (NullPointerException ex) {
8285
getLogger().info("No value pattern available");
8386
}
@@ -99,7 +102,8 @@ public void setValueFromIAccessible(final String value)
99102
throws AutomationException {
100103
if (this.accessiblePattern == null) {
101104
try {
102-
this.accessiblePattern = this.requestAutomationPattern(LegacyIAccessible.class);
105+
this.accessiblePattern =
106+
this.requestAutomationPattern(LegacyIAccessible.class);
103107
this.accessiblePattern.setCurrentValue(value);
104108
} catch (NullPointerException ex) {
105109
getLogger().info("No value pattern available");

src/main/java/mmarquee/automation/controls/AutomationCalendar.java renamed to src/main/java/mmarquee/automation/controls/Calendar.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,15 @@
2626
*
2727
* Implements IGridProvider, IScrollProvider, ITableProvider, IValueProvider
2828
*/
29-
public class AutomationCalendar extends AutomationBase implements ImplementsValue {
29+
public class Calendar extends AutomationBase
30+
implements ImplementsValue {
3031

3132
/**
32-
* Constructor for the AutomationCalendar.
33+
* Constructor for the Calendar.
3334
*
34-
* @param builder The element builder.
35-
* @throws AutomationException Automation library error.
36-
* @throws PatternNotFoundException Expected pattern not found.
35+
* @param builder The element builder
3736
*/
38-
public AutomationCalendar(final ElementBuilder builder)
39-
throws PatternNotFoundException, AutomationException {
37+
public Calendar(final ElementBuilder builder) {
4038
super(builder);
4139
}
4240
}

src/main/java/mmarquee/automation/controls/AutomationCheckBox.java renamed to src/main/java/mmarquee/automation/controls/CheckBox.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
* @author Mark Humphreys
2323
* Date 31/01/2016.
2424
*/
25-
public final class AutomationCheckBox
25+
public final class CheckBox
2626
extends AutomationBase
27-
implements ImplementsToggle, ImplementsFocus {
28-
27+
implements ImplementsToggle,
28+
ImplementsFocus {
2929

3030
/**
31-
* Constructor for the AutomationCheckBox.
31+
* Constructor for the CheckBox.
3232
*
3333
* @param builder The builder
3434
*/
35-
public AutomationCheckBox (final ElementBuilder builder) {
35+
public CheckBox(final ElementBuilder builder) {
3636
super (builder);
3737
}
3838

0 commit comments

Comments
 (0)