Skip to content

Commit 48d5a4b

Browse files
eclipse-pde-botlaeubi
authored andcommitted
Perform clean code of ui/org.eclipse.pde.spy.core
1 parent 7691121 commit 48d5a4b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ private MWindow prepareSpyWindow(MApplication appli, EModelService modelService)
8787

8888
// If window already in application, it is already prepared -> Return it
8989
List<MWindow> existingWindow = modelService.findElements(appli, E4_SPIES_WINDOW, MWindow.class, null);
90-
if (existingWindow.size() >= 1)
90+
if (existingWindow.size() >= 1) {
9191
return existingWindow.get(0);
92+
}
9293

9394
// No spy window in main windows for the moment... extract the structure
9495
// from the

ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ public void bindSpyKeyBinding(MBindingTable spyBindingTable, String keySequence,
133133

134134

135135
// Search for the key binding if already present
136-
for (MKeyBinding kb : spyBindingTable.getBindings())
136+
for (MKeyBinding kb : spyBindingTable.getBindings()) {
137137
if (keySequence.equals(kb.getKeySequence())) {
138138
// A binding with this key sequence is already present. Check if
139139
// command is the same
140-
if (kb.getCommand().getElementId().equals(cmd.getElementId()))
140+
if (kb.getCommand().getElementId().equals(cmd.getElementId())) {
141141
return;
142-
else {
142+
} else {
143143
// Must log an error : key binding already exists in this
144144
// table but with another command
145145
System.out.println("WARNING : Cannot bind the command '" + cmd.getElementId()
@@ -148,6 +148,7 @@ public void bindSpyKeyBinding(MBindingTable spyBindingTable, String keySequence,
148148
return;
149149
}
150150
}
151+
}
151152

152153
// Key binding is not yet in table... can add it now.
153154
MKeyBinding binding = modelService.createModelElement(MKeyBinding.class);
@@ -180,10 +181,11 @@ private MBindingTable getBindingTable() {
180181
// Then can add the KeyBinding if not already added
181182

182183
MBindingTable spyBindingTable = null;
183-
for (MBindingTable bt : application.getBindingTables())
184+
for (MBindingTable bt : application.getBindingTables()) {
184185
if (E4_SPIES_BINDING_TABLE.equals(bt.getElementId())) {
185186
spyBindingTable = bt;
186187
}
188+
}
187189

188190
// Binding table has not been yet added... Create it and bind it to
189191
// org.eclipse.ui.contexts.dialogAndWindow binding context

0 commit comments

Comments
 (0)