use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class LayoutTest method test_LayoutData_deleteIt_hasChildElement_dontDelete.
public void test_LayoutData_deleteIt_hasChildElement_dontDelete() throws Exception {
parse("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <FormLayout/>", " </Shell.layout>", " <Button wbp:name='button'>", " <Button.layoutData>", " <FormData width='100'>", " <FormData.left>", " <FormAttachment offset='50'/>", " </FormData.left>", " </FormData>", " </Button.layoutData>", " </Button>", "</Shell>");
// remove "width" attribute, but there is "left" sub-element, so FormData should not be deleted
ExecutionUtils.run(m_lastObject, new RunnableEx() {
@Override
public void run() throws Exception {
ControlInfo button = getObjectByName("button");
XmlObjectInfo rowData = LayoutInfo.getLayoutData(button);
rowData.removeAttribute("width");
}
});
assertXML("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <FormLayout/>", " </Shell.layout>", " <Button wbp:name='button'>", " <Button.layoutData>", " <FormData>", " <FormData.left>", " <FormAttachment offset='50'/>", " </FormData.left>", " </FormData>", " </Button.layoutData>", " </Button>", "</Shell>");
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class GridLayoutTest method test_MOVE_ROW_before.
// //////////////////////////////////////////////////////////////////////////
//
// MOVE ROW
//
// //////////////////////////////////////////////////////////////////////////
public void test_MOVE_ROW_before() throws Exception {
parse("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Button wbp:name='button_00'/>", " <Label/>", " <Label/>", " <Button wbp:name='button_11'/>", "</Shell>");
refresh();
//
ExecutionUtils.run(m_lastObject, new RunnableEx() {
@Override
public void run() throws Exception {
GridLayoutInfo layout = getObjectByName("layout");
layout.command_MOVE_ROW(1, 0);
}
});
assertXML("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Label/>", " <Button wbp:name='button_11'/>", " <Button wbp:name='button_00'/>", " <Label/>", "</Shell>");
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class GridLayoutTest method test_deleteRow.
public void test_deleteRow() throws Exception {
parse("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Button>", " <Button.layoutData>", " <GridData verticalSpan='3'/>", " </Button.layoutData>", " </Button>", " <Button text='0'/>", " <Button text='1'/>", " <Button text='2'/>", "</Shell>");
refresh();
//
ExecutionUtils.run(m_lastObject, new RunnableEx() {
@Override
public void run() throws Exception {
GridLayoutInfo layout = getObjectByName("layout");
layout.command_deleteRow(1, true);
}
});
assertXML("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Button>", " <Button.layoutData>", " <GridData verticalSpan='2'/>", " </Button.layoutData>", " </Button>", " <Button text='0'/>", " <Button text='2'/>", "</Shell>");
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class GridLayoutTest method test_deleteColumn.
public void test_deleteColumn() throws Exception {
parse("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='3'/>", " </Shell.layout>", " <Button>", " <Button.layoutData>", " <GridData horizontalSpan='3'/>", " </Button.layoutData>", " </Button>", " <Button text='0'/>", " <Button text='1'/>", " <Button text='2'/>", "</Shell>");
refresh();
//
ExecutionUtils.run(m_lastObject, new RunnableEx() {
@Override
public void run() throws Exception {
GridLayoutInfo layout = getObjectByName("layout");
layout.command_deleteColumn(1, true);
}
});
assertXML("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Button>", " <Button.layoutData>", " <GridData horizontalSpan='2'/>", " </Button.layoutData>", " </Button>", " <Button text='0'/>", " <Button text='2'/>", "</Shell>");
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class GridLayoutTest method test_deleteColumn_deleteAlsoEmptyRows.
public void test_deleteColumn_deleteAlsoEmptyRows() throws Exception {
parse("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout' numColumns='2'/>", " </Shell.layout>", " <Button wbp:name='button_00'/>", " <Label/>", " <Label/>", " <Button wbp:name='button_11'/>", "</Shell>");
refresh();
//
ExecutionUtils.run(m_lastObject, new RunnableEx() {
@Override
public void run() throws Exception {
GridLayoutInfo layout = getObjectByName("layout");
layout.command_deleteColumn(1, true);
}
});
assertXML("// filler filler filler filler filler", "<Shell>", " <Shell.layout>", " <GridLayout wbp:name='layout'/>", " </Shell.layout>", " <Button wbp:name='button_00'/>", "</Shell>");
}
Aggregations