Search in sources :

Example 26 with RunnableEx

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();
        }
    });
}
Also used : Position(org.eclipse.jface.text.Position) ASTNode(org.eclipse.jdt.core.dom.ASTNode) RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 27 with RunnableEx

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);
}
Also used : RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 28 with RunnableEx

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);
}
Also used : RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 29 with RunnableEx

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);
}
Also used : RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 30 with RunnableEx

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();
}
Also used : RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Aggregations

RunnableEx (org.eclipse.wb.internal.core.utils.execution.RunnableEx)259 ContainerInfo (org.eclipse.wb.internal.swing.model.component.ContainerInfo)57 ComponentInfo (org.eclipse.wb.internal.swing.model.component.ComponentInfo)55 GridBagLayoutInfo (org.eclipse.wb.internal.swing.model.layout.gbl.GridBagLayoutInfo)42 AbstractGridBagLayoutInfo (org.eclipse.wb.internal.swing.model.layout.gbl.AbstractGridBagLayoutInfo)22 ObjectInfo (org.eclipse.wb.core.model.ObjectInfo)14 List (java.util.List)12 Expression (org.eclipse.jdt.core.dom.Expression)11 IAction (org.eclipse.jface.action.IAction)11 CompositeInfo (org.eclipse.wb.internal.swt.model.widgets.CompositeInfo)11 ControlInfo (org.eclipse.wb.internal.swt.model.widgets.ControlInfo)11 FormLayoutInfo (org.eclipse.wb.internal.swing.FormLayout.model.FormLayoutInfo)10 JavaInfo (org.eclipse.wb.core.model.JavaInfo)9 IMenuItemInfo (org.eclipse.wb.internal.core.model.menu.IMenuItemInfo)9 GridLayoutInfo (org.eclipse.wb.internal.xwt.model.layout.grid.GridLayoutInfo)9 MenuItemInfo (org.eclipse.wb.internal.xwt.model.widgets.menu.MenuItemInfo)9 JavaInfoMemento (org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento)8 AstEditor (org.eclipse.wb.internal.core.utils.ast.AstEditor)8 ControlInfo (org.eclipse.wb.internal.xwt.model.widgets.ControlInfo)8 JTextField (javax.swing.JTextField)7