本文整理汇总了Java中org.eclipse.gef.requests.GroupRequest.getEditParts方法的典型用法代码示例。如果您正苦于以下问题:Java GroupRequest.getEditParts方法的具体用法?Java GroupRequest.getEditParts怎么用?Java GroupRequest.getEditParts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.GroupRequest
的用法示例。
在下文中一共展示了GroupRequest.getEditParts方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
protected Command getOrphanChildrenCommand(GroupRequest request) {
CompoundCommand result = new CompoundCommand();
List<EditPart> list = request.getEditParts();
result.setDebugLabel("Orphan children");
for (EditPart part : list) {
ORMOrphanChildCommand orphan = new ORMOrphanChildCommand();
orphan.setChild((Shape) part.getModel());
orphan.setParent((Model) this.getHost().getModel());
orphan.setLabel("Reparenting");
result.add(orphan);
}
return result.unwrap();
}
示例2: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Command getOrphanChildrenCommand(GroupRequest request) {
List<EditPart> parts = request.getEditParts();
for (int i = 0; i < parts.size(); i++) {
EditPart part = parts.get(i);
//System.out.println("THe part is something here..." + part);
// We will just return and do nothing at all.
if (part instanceof TabbedBarButtonEditPart) {
return null;
}
}
CompoundCommand result = new CompoundCommand("Moving from one part to another");
for (int i = 0; i < parts.size(); i++) {
if (parts.get(i).getModel() instanceof TitaniumUIBoundedElement) {
TitaniumOrphanChildCommand c = new TitaniumOrphanChildCommand();
c.setChild((TitaniumUIBoundedElement)parts.get(i).getModel());
c.setParent((Container) getHost().getModel());
result.add(c);
} else {
OrphanChildCommand orphan = new OrphanChildCommand();
orphan.setChild((ElementImpl)parts.get(i).getModel());
orphan.setParent((Container) getHost().getModel());
result.add(orphan);
}
}
return result.unwrap();
}
示例3: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand(GroupRequest request) {
TitleBarEditPart host = (TitleBarEditPart)getHost();
List parts = request.getEditParts();
CompoundCommand result = new CompoundCommand("Moving from title bar part to another");
for (int i = 0; i < parts.size(); i++) {
final EditPart ep = (EditPart)parts.get(i);
if (ep.getModel() instanceof TitaniumUIElement) {
DeleteTitleBarChildCommand dtbc = new DeleteTitleBarChildCommand(host.getTitleBar(), (TitaniumUIBoundedElement)ep.getModel());
result.add(dtbc);
}
}
return result.unwrap();
}
示例4: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
public Command getOrphanChildrenCommand(GroupRequest request) {
List<?> parts = request.getEditParts();
JSSCompoundCommand result = new JSSCompoundCommand("orphans", null); //$NON-NLS-1$
for (int i = 0; i < parts.size(); i++) {
ANode child = (ANode) ((EditPart) parts.get(i)).getModel();
result.setReferenceNodeIfNull(child);
result.add(OutlineTreeEditPartFactory.getOrphanCommand((ANode) getHost().getModel(), child));
}
return result.unwrap();
}
示例5: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand(GroupRequest request) {
List<?> parts = request.getEditParts();
JSSCompoundCommand result = new JSSCompoundCommand("orphans", null); //$NON-NLS-1$
for (int i = 0; i < parts.size(); i++) {
ANode child = (ANode) ((EditPart) parts.get(i)).getModel();
result.setReferenceNodeIfNull(child);
result.add(StyleTreeEditPartFactory.getOrphanCommand((ANode) getHost().getModel(), child));
}
return result.unwrap();
}
示例6: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
protected Command getOrphanChildrenCommand(GroupRequest request)
{
@SuppressWarnings("rawtypes")
List toRemove = request.getEditParts();
Dataset[] datasets = new Dataset[toRemove.size()];
int i = 0;
for (Object o : toRemove)
{
datasets[i++] = (Dataset) ((DatasetEditPart) o).getModel();
}
return new DeleteDatasetsFromAxisCommand((DependentAxis) getHost()
.getModel(), datasets);
}
示例7: getOrphanChildrenCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand( GroupRequest request )
{
List parts = request.getEditParts( );
CompoundCommand result = new CompoundCommand( "Move in layout" );//$NON-NLS-1$
for ( int i = 0; i < parts.size( ); i++ )
{
DeleteCommand command = new DeleteCommand( ( (EditPart) parts.get( i ) ).getModel( ) );
command.setClear( false );
result.add( command );
}
return result.unwrap( );
}
示例8: getAddCommand
import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
protected Command getAddCommand(final GroupRequest request)
{
@SuppressWarnings("rawtypes")
final List toAdd = request.getEditParts();
final Command res;
if (toAdd.size() == 0)
{
res = null;
}
else
{
final Object first = toAdd.get(0);
if (first instanceof ScatterSetEditPart)
{
ScatterSetEditPart scatterSetEditPart = ((ScatterSetEditPart) first);
ScatterSet scatterSet = scatterSetEditPart.getModel();
Chart from = scatterSetEditPart.getChart();
ScatterSetContainerEditPart container =
(ScatterSetContainerEditPart) getHost();
Chart to = (Chart) container.getParent().getModel();
res = new MoveScatterSetCommand(scatterSet, from, to);
}
else if (first instanceof DatasetEditPart)
{
// find the landing side
final AxisLandingPadEditPart landingPadEditPart =
(AxisLandingPadEditPart) getHost();
final ChartPaneEditPart.AxisLandingPad pad =
(ChartPaneEditPart.AxisLandingPad) landingPadEditPart.getModel();
// find out which list (min/max) this axis is currently on
final EList<DependentAxis> destination = pad
.getPos() == ChartPanePosition.MIN ? pad.getChart().getMinAxes()
: pad.getChart().getMaxAxes();
if (destination != null)
{
CompoundCommand compoundCommand = new CompoundCommand();
res = compoundCommand;
if (first instanceof DatasetEditPart)
{
// ok, it's a dataset. we need to wrap it into an axis before
// we can add it to the chart
DatasetEditPart datasetEditPart = (DatasetEditPart) first;
AxisEditPart parent = (AxisEditPart) datasetEditPart.getParent();
Dataset dataset = (Dataset) datasetEditPart.getModel();
DependentAxis parentAxis = (DependentAxis) parent.getModel();
// take a copy of the parent axis, since we know it's suitable
DependentAxis newAxis = EcoreUtil.copy(parentAxis);
newAxis.getDatasets().clear();
compoundCommand.add(new AddAxisToChartCommand(destination,
newAxis));
compoundCommand.add(new AddDatasetsToAxisCommand(newAxis, dataset));
}
}
else
{
// we don't have a target location
res = null;
}
}
else
{
// it's not a type that we're interested in
res = null;
}
}
return res;
}