本文整理汇总了Java中org.eclipse.gef.requests.GroupRequest类的典型用法代码示例。如果您正苦于以下问题:Java GroupRequest类的具体用法?Java GroupRequest怎么用?Java GroupRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupRequest类属于org.eclipse.gef.requests包,在下文中一共展示了GroupRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
DwFeatureEditPart editPart = (DwFeatureEditPart)getHost();
DwGraphicalFeatureModelViewer viewer = (DwGraphicalFeatureModelViewer)editPart.getEditor();
DwFeatureWrapped wrappedFeature = (DwFeatureWrapped)getHost().getModel();
if(!viewer.isLastDateSelected())
return null;
Command deleteCommand = null;
if(viewer.getCurrentSelectedDate().equals(new Date(Long.MIN_VALUE))){
deleteCommand = new DwFeatureDeletePermanentlyCommand(viewer, getHost());
((DwFeatureDeletePermanentlyCommand)deleteCommand).setFeature(wrappedFeature);
}else{
deleteCommand = new DwFeatureDeleteCommand(viewer, getHost());
((DwFeatureDeleteCommand)deleteCommand).setFeature(wrappedFeature);
}
return deleteCommand;
}
示例2: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command createDeleteCommand(final GroupRequest request) {
if (getHost() instanceof DeleteableEditPart) {
final DeleteableEditPart editPart = (DeleteableEditPart) getHost();
if (!editPart.isDeleteable()) {
return null;
}
} else {
return null;
}
final ERDiagram diagram = (ERDiagram) getHost().getRoot().getContents().getModel();
return this.createDeleteCommand(diagram, getHost().getModel());
}
示例3: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command createDeleteCommand(GroupRequest request) {
if (this.getHost() instanceof DeleteableEditPart) {
DeleteableEditPart editPart = (DeleteableEditPart) this.getHost();
if (!editPart.isDeleteable()) {
return null;
}
} else {
return null;
}
ERDiagram diagram = (ERDiagram) this.getHost().getRoot().getContents()
.getModel();
return this.createDeleteCommand(diagram, this.getHost().getModel());
}
示例4: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
protected Command createDeleteCommand(GroupRequest deleteRequest) {
Object parent = getHost().getParent().getModel();
Object child = getHost().getModel();
if (parent instanceof Window
&& child instanceof TitleBar){
return new DeleteTitleBarCommand((Window) parent,
(TitleBar) child);
} else if (parent instanceof TitleBar){
return new DeleteTitleBarChildCommand((TitleBar) parent,
(TitaniumUIBoundedElement) child);
} else if (parent instanceof Container
&& child instanceof Element) {
return new DeleteElementCommand((Container) parent, (Element) child);
} else if (parent instanceof TitaniumUIContainer
&& child instanceof TitaniumUIElement) {
return new DeleteTitaniumElementCommand((TitaniumUIContainer) parent,
(TitaniumUIBoundedElement) child);
}
return super.createDeleteCommand(deleteRequest);
}
示例5: getDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
*/
@Override
protected Command getDeleteCommand(GroupRequest request) {
Command command;
if (getHost() instanceof AbstractChildCompartmentEditPart) {
if (!(getHost() instanceof AttributeEditPart) && !(getHost() instanceof OperationEditPart)) {
return null;
}
}
command = new DeleteNodeCommand();
((DeleteNodeCommand) command).setParent(getHost().getParent().getModel());
((DeleteNodeCommand) command).setNode(getHost().getModel());
return command;
}
示例6: getDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
*/
@Override
protected Command getDeleteCommand(GroupRequest request) {
if (getHost() instanceof LifeLineNameHeaderEditPart) {
return null;
}
if (getHost() instanceof AbstractChildCompartmentEditPart) {
return null;
} else {
DeleteLifeLineCommand command = new DeleteLifeLineCommand();
((DeleteLifeLineCommand) command).setDiagram(SequenceUtil.getDiagram(getHost()));
((DeleteLifeLineCommand) command).setLifeLineNode((LifeLineNode) getHost().getModel());
return command;
}
}
示例7: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
return new DeleteCommand(getModel());
}
});
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new TableNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new TableLayoutEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
@Override
protected void hideSelection() {
getFigure().hideSelectedBorder();
}
@Override
protected void showSelection() {
getFigure().showSelectedBorder();
}
});
}
示例8: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* Search for every AMcollection (superclass of the row of the table)
* and create a delete cell command for everyone of its children
*/
@Override
public Command createDeleteCommand(List objects) {
if (objects.isEmpty())
return null;
if (!(objects.get(0) instanceof EditPart))
return null;
GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
deleteReq.setEditParts(objects);
JSSCompoundCommand compoundCmd = new JSSCompoundCommand(getText(), null);
for (int i = 0; i < objects.size(); i++) {
EditPart object = (EditPart) objects.get(i);
if (object.getModel() instanceof AMCollection && !(object.getModel() instanceof MTableDetail)) {
AMCollection model = (AMCollection) object.getModel();
compoundCmd.setReferenceNodeIfNull(model);
createDeleteCommands(model.getChildren(), compoundCmd);
}
}
return compoundCmd;
}
示例9: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.CONTAINER_ROLE, new AxisContainerEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
DependentAxis dataset = (DependentAxis) getHost().getModel();
Chart parent = (Chart) dataset.eContainer();
DeleteAxisFromChartCommand cmd =
new DeleteAxisFromChartCommand(parent, dataset);
return cmd;
}
});
}
示例10: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
Dataset dataset = (Dataset) getHost().getModel();
DependentAxis parent = (DependentAxis) getHost().getParent().getModel();
DeleteDatasetsFromAxisCommand cmd =
new DeleteDatasetsFromAxisCommand(parent, dataset);
return cmd;
}
});
}
示例11: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.CONTAINER_ROLE, new ChartContainerEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
Chart chart = getModel();
ChartSet parent = chart.getParent();
DeleteChartCommand deleteChartCommand =
new DeleteChartCommand(parent, chart);
return deleteChartCommand;
}
});
}
示例12: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
// TODO: implement
// 1. do not use this scatter set in the current chart
// 2. if scatter set used only here, then delete scatter set from shared axis
return new DeleteScatterSetCommand(getModel(), getChart());
}
});
}
示例13: createDeleteCommand
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
* Create a command to remove the selected objects.
*
* @param objects
* The objects to be deleted.
* @return The command to remove the selected objects.
*/
public Command createDeleteCommand(List objects) {
if (objects.isEmpty())
return null;
if (!(objects.get(0) instanceof EditPart))
return null;
GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
deleteReq.setEditParts(objects);
CompoundCommand compoundCmd = new CompoundCommand(
GEFMessages.DeleteAction_ActionDeleteCommandName);
for (int i = 0; i < objects.size(); i++) {
EditPart object = (EditPart) objects.get(i);
Command cmd = object.getCommand(deleteReq);
if (cmd != null)
compoundCmd.add(cmd);
}
return compoundCmd;
}
示例14: 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();
}
示例15: createEditPolicies
import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
// mark & unmark commands
installEditPolicy("Mark and Unmark", new CodeElementMarkEditPolicy());
// delete command
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
Object container = getHost().getParent().getModel();
Object ce = getHost().getModel();
if (container instanceof Shape && ce instanceof CodeElement)
return new DeleteCodeElementCommand((Shape) container, (CodeElement) ce);
return super.createDeleteCommand(deleteRequest);
}
});
}