use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class VisitedLinesHighlighter method setVisitedNodes.
// //////////////////////////////////////////////////////////////////////////
//
// Access
//
// //////////////////////////////////////////////////////////////////////////
public void setVisitedNodes(Collection<ASTNode> nodes) throws Exception {
// unmanage previous positions
for (Position position : m_linePositions) {
m_positionManager.unmanagePosition(position);
}
// prepare lines
Set<Integer> lines = Sets.newHashSet();
for (ASTNode node : nodes) {
int line = m_document.getLineOfOffset(node.getStartPosition());
lines.add(line);
}
// create new positions
m_linePositions.clear();
for (Integer line : lines) {
int lineOffset = m_document.getLineOffset(line);
Position position = new Position(lineOffset);
m_linePositions.add(position);
m_positionManager.managePosition(position);
}
// paint
ExecutionUtils.runAsync(new RunnableEx() {
@Override
public void run() throws Exception {
m_textWidget.redraw();
}
});
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class ElementVisibilityCommand method addToCommandList.
@Override
public void addToCommandList(final List<Command> commands) {
ExecutionUtils.runIgnore(new RunnableEx() {
@Override
public void run() throws Exception {
removeCommands(commands, ElementVisibilityCommand.class, m_id);
}
});
commands.add(this);
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class FactoryEditCommand method addToCommandList.
// //////////////////////////////////////////////////////////////////////////
//
// Access
//
// //////////////////////////////////////////////////////////////////////////
@Override
public void addToCommandList(final List<Command> commands) {
ExecutionUtils.runIgnore(new RunnableEx() {
@Override
public void run() throws Exception {
removeCommands(commands, FactoryEditCommand.class, m_id);
}
});
commands.add(this);
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class CategoryEditCommand method addToCommandList.
// //////////////////////////////////////////////////////////////////////////
//
// Access
//
// //////////////////////////////////////////////////////////////////////////
@Override
public void addToCommandList(final List<Command> commands) {
ExecutionUtils.runIgnore(new RunnableEx() {
@Override
public void run() throws Exception {
removeCommands(commands, CategoryEditCommand.class, m_id);
}
});
commands.add(this);
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class Command method toString.
/**
* @return the {@link String} that contains information about this {@link Command}. It will be
* passed back to constructor during reading.
*/
@Override
public final String toString() {
m_stringBuffer = new StringBuffer();
m_stringBuffer.append("\t<");
// use ID as tag
ExecutionUtils.runRethrow(new RunnableEx() {
@Override
public void run() throws Exception {
String id = (String) Command.this.getClass().getField("ID").get(null);
m_stringBuffer.append(id);
}
});
//
addAttributes();
m_stringBuffer.append("/>");
return m_stringBuffer.toString();
}
Aggregations