Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java')
-rw-r--r--bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java56
1 files changed, 28 insertions, 28 deletions
diff --git a/bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java b/bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java
index eedf507e..3828e2d3 100644
--- a/bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java
+++ b/bundles/org.eclipse.e4.core.macros/src/org/eclipse/e4/core/macros/internal/ComposableMacro.java
@@ -44,8 +44,8 @@ import org.eclipse.e4.core.macros.MacroPlaybackException;
private final int fPriority;
private IndexAndPriority(int index, int priority) {
- this.fIndex = index;
- this.fPriority = priority;
+ fIndex = index;
+ fPriority = priority;
}
}
@@ -93,40 +93,39 @@ import org.eclipse.e4.core.macros.MacroPlaybackException;
}
/**
- * Adds a macro instruction to be added to the current macro being recorded. The
- * difference between this method and
- * {@link #addMacroInstruction(IMacroInstruction)} is that it's meant to be used
- * when an event may trigger the creation of multiple macro instructions and
- * only one of those should be recorded.
+ * Adds a macro instruction to be added to the current macro being recorded.
+ * This method should be used when an event may trigger the creation of
+ * multiple macro instructions and only one of those should be recorded.
*
* @param macroInstruction
* the macro instruction to be added to the macro currently being
* recorded.
* @param event
- * the event that triggered the creation of the macro instruction to
- * be added. If there are multiple macro instructions added for the
- * same event, only the one with the highest priority will be kept
- * (if 2 events have the same priority, the last one will replace the
- * previous one).
+ * the event that triggered the creation of the macro instruction
+ * to be added. If there are multiple macro instructions added
+ * for the same event, only the one with the highest priority
+ * will be kept (if 2 events have the same priority, the last one
+ * will replace the previous one).
* @param priority
- * the priority of the macro instruction being added (to be compared
- * against the priority of other added macro instructions for the
- * same event).
- * @return true if the macro instruction was actually added and false otherwise.
+ * the priority of the macro instruction being added (to be
+ * compared against the priority of other added macro
+ * instructions for the same event).
+ * @return true if the macro instruction was actually added and false
+ * otherwise.
* @see #addMacroInstruction(IMacroInstruction)
*/
public boolean addMacroInstruction(IMacroInstruction macroInstruction, Object event, int priority) {
Assert.isNotNull(event);
- IndexAndPriority currentIndexAndPriority = this.fEventToPlacement.get(event);
+ IndexAndPriority currentIndexAndPriority = fEventToPlacement.get(event);
if (currentIndexAndPriority == null) {
- this.addMacroInstruction(macroInstruction);
- this.fEventToPlacement.put(event, new IndexAndPriority(this.fMacroInstructions.size() - 1, priority));
+ addMacroInstruction(macroInstruction);
+ fEventToPlacement.put(event, new IndexAndPriority(fMacroInstructions.size() - 1, priority));
return true;
}
if (priority >= currentIndexAndPriority.fPriority) {
checkMacroInstruction(macroInstruction);
fMacroInstructions.set(currentIndexAndPriority.fIndex, macroInstruction);
- this.fEventToPlacement.put(event, new IndexAndPriority(currentIndexAndPriority.fIndex, priority));
+ fEventToPlacement.put(event, new IndexAndPriority(currentIndexAndPriority.fIndex, priority));
return true;
}
return false;
@@ -137,7 +136,7 @@ import org.eclipse.e4.core.macros.MacroPlaybackException;
* after the macro is properly composed.
*/
public void clearCachedInfo() {
- this.fEventToPlacement.clear();
+ fEventToPlacement.clear();
}
@Override
@@ -149,20 +148,21 @@ import org.eclipse.e4.core.macros.MacroPlaybackException;
}
/**
- * Actually returns the bytes to be written to the disk to be loaded back later
- * on (the actual load and playback is later done by {@link SavedJSMacro}.
+ * Actually returns the bytes to be written to the disk to be loaded back
+ * later on (the actual load and playback is later done by
+ * {@link SavedJSMacro}).
*
- * @return an UTF-8 encoded array of bytes which can be used to rerun the macro
- * later on.
+ * @return an UTF-8 encoded array of bytes which can be used to rerun the
+ * macro later on.
*/
/* default */ byte[] toJSBytes() {
- final StringBuilder buf = new StringBuilder(this.fMacroInstructions.size() * 60);
+ final StringBuilder buf = new StringBuilder(fMacroInstructions.size() * 60);
buf.append("// Macro generated by the Eclipse macro record engine.\n"); //$NON-NLS-1$
buf.append("// The runMacro() function will be later run by the macro engine.\n"); //$NON-NLS-1$
buf.append("function runMacro(){\n"); //$NON-NLS-1$
- for (IMacroInstruction macroInstruction : this.fMacroInstructions) {
+ for (IMacroInstruction macroInstruction : fMacroInstructions) {
Map<String, String> map = macroInstruction.toMap();
Assert.isNotNull(map);
@@ -181,6 +181,6 @@ import org.eclipse.e4.core.macros.MacroPlaybackException;
* @return the number of macro instructions in this macro.
*/
public int getLength() {
- return this.fMacroInstructions.size();
+ return fMacroInstructions.size();
}
}

Back to the top