Java 类org.eclipse.gef.RequestConstants 实例源码

项目:Hydrograph    文件:ComponentEditPart.java   
@Override
public void performRequest(Request req) {

    // Opens Property Window only on Double click.
    if (req.getType().equals(RequestConstants.REQ_OPEN)) {
        ComponentFigure componentFigure=this.getComponentFigure();
        componentFigure.terminateToolTipTimer();
        ELTPropertyWindow propertyWindow = new ELTPropertyWindow(getModel());
        propertyWindow.open();

        if(Constants.SUBJOB_COMPONENT.equalsIgnoreCase(getCastedModel().getComponentName())){
            SubJobUtility subJobUtility=new SubJobUtility();
            subJobUtility.updateSubjobPropertyAndGetSubjobContainer(this,null,null,true);
        } 
        if(propertyWindow.isPropertyChanged()){
            updateSubjobVersion();
        }
        updateComponentView(propertyWindow);
        super.performRequest(req);
    }
}
项目:DarwinSPL    文件:DwFeatureEditorEditPart.java   
/**
 * This method is used to enable direct name editing in the feature
 */
@Override public void performRequest(Request req) {
    if(!editor.isLastDateSelected())
        return;

    if(req.getType() == RequestConstants.REQ_DIRECT_EDIT) {

    }
    if(req.getType() == RequestConstants.REQ_OPEN){
        DwFeatureWrapped feature = (DwFeatureWrapped)getModel();
        Date date = editor.getCurrentSelectedDate();

        if(feature.calculateVariationTypeCircleBounds(date).contains(((SelectionRequest)req).getLocation())){

            HyFeatureType type = HyEvolutionUtil.getValidTemporalElement(feature.getWrappedModelElement().getTypes(), date);

            HyFeatureTypeEnum newType = type.getType() == HyFeatureTypeEnum.MANDATORY ? HyFeatureTypeEnum.OPTIONAL : HyFeatureTypeEnum.MANDATORY;

            DwFeatureChangeTypeCommand command = new DwFeatureChangeTypeCommand(feature.getWrappedModelElement(), newType, editor);
            editor.executeCommand(command);
            this.refreshVisuals();
        }else{
            performDirectEditing();
        }
    }
}
项目:ermasterr    文件:ERDiagramAlignmentAction.java   
private Command createAlignmentCommand() {
    final AlignmentRequest request = new AlignmentRequest(RequestConstants.REQ_ALIGN);
    request.setAlignmentRectangle(calculateAlignmentRectangle(request));
    request.setAlignment(alignment);
    final List editparts = getOperationSet(request);
    if (editparts.size() < 2)
        return null;

    final CompoundCommand command = new CompoundCommand();
    command.setDebugLabel(getText());
    for (int i = 0; i < editparts.size(); i++) {
        final EditPart editpart = (EditPart) editparts.get(i);
        command.add(editpart.getCommand(request));
    }
    return command;
}
项目:ermasterr    文件:WordOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Word word = (Word) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final WordDialog dialog = new WordDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), word, false, diagram);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final EditWordCommand command = new EditWordCommand(word, dialog.getWord(), diagram);
            execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:TablespaceOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Tablespace tablespace = (Tablespace) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final TablespaceDialog dialog = EclipseDBManagerFactory.getEclipseDBManager(diagram).createTablespaceDialog();

        if (dialog == null) {
            ERDiagramActivator.showMessageDialog("dialog.message.tablespace.not.supported");
        } else {
            dialog.init(tablespace, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                final EditTablespaceCommand command = new EditTablespaceCommand(diagram, tablespace, dialog.getResult());
                execute(command);
            }
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:ViewOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final View view = (View) getModel();
    final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final View copyView = view.copyData();

        final ViewDialog dialog = new ViewDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getViewer(), copyView);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final CompoundCommand command = ViewEditPart.createChangeViewPropertyCommand(diagram, view, copyView);

            execute(command.unwrap());
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:GroupOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final ColumnGroup columnGroup = (ColumnGroup) getModel();
    final ERDiagram diagram = getDiagram();

    final GroupSet groupSet = diagram.getDiagramContents().getGroups();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final GroupDialog dialog = new GroupDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), groupSet, diagram, groupSet.indexOf(columnGroup));

        if (dialog.open() == IDialogConstants.OK_ID) {
            final List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();

            final Command command = new ChangeGroupCommand(diagram, groupSet, newColumnGroups);

            execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:GroupSetOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final ERDiagram diagram = getDiagram();

    final GroupSet groupSet = diagram.getDiagramContents().getGroups();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final GroupManageDialog dialog = new GroupManageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), groupSet, diagram, false, -1);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();

            final Command command = new ChangeGroupCommand(diagram, groupSet, newColumnGroups);

            execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:IndexOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Index index = (Index) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final IndexDialog dialog = new IndexDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), index, index.getTable());

        if (dialog.open() == IDialogConstants.OK_ID) {
            final ChangeIndexCommand command = new ChangeIndexCommand(diagram, index, dialog.getResultIndex());

            execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:SequenceOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    try {
        final Sequence sequence = (Sequence) getModel();
        final ERDiagram diagram = getDiagram();

        if (request.getType().equals(RequestConstants.REQ_OPEN)) {
            final SequenceDialog dialog = new SequenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), sequence, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                final EditSequenceCommand command = new EditSequenceCommand(diagram, sequence, dialog.getResult());
                execute(command);
            }
        }

        super.performRequest(request);

    } catch (final Exception e) {
        ERDiagramActivator.showExceptionDialog(e);
    }
}
项目:ermasterr    文件:TableOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final ERTable table = (ERTable) getModel();
    final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final ERTable copyTable = table.copyData();

        final TableDialog dialog = new TableDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getViewer(), copyTable);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final CompoundCommand command = ERTableEditPart.createChangeTablePropertyCommand(diagram, table, copyTable);

            execute(command.unwrap());
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:RelationOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Relation relation = (Relation) getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final Relation copy = relation.copy();

        final RelationDialog dialog = new RelationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(relation, copy);
            execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:TriggerOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Trigger trigger = (Trigger) getModel();
    final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final TriggerDialog dialog = new TriggerDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), trigger);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final EditTriggerCommand command = new EditTriggerCommand(diagram, trigger, dialog.getResult());
            getViewer().getEditDomain().getCommandStack().execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:CommentConnectionEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Relation relation = (Relation) getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final Relation copy = relation.copy();

        final RelationDialog dialog = new RelationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(relation, copy);
            getViewer().getEditDomain().getCommandStack().execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermasterr    文件:RelationEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(final Request request) {
    final Relation relation = (Relation) getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final Relation copy = relation.copy();

        final RelationDialog dialog = new RelationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(relation, copy);
            getViewer().getEditDomain().getCommandStack().execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:ERDiagramAlignmentAction.java   
private Command createAlignmentCommand() {
    AlignmentRequest request = new AlignmentRequest(
            RequestConstants.REQ_ALIGN);
    request.setAlignmentRectangle(calculateAlignmentRectangle(request));
    request.setAlignment(alignment);
    List editparts = getOperationSet(request);
    if (editparts.size() < 2)
        return null;

    CompoundCommand command = new CompoundCommand();
    command.setDebugLabel(getText());
    for (int i = 0; i < editparts.size(); i++) {
        EditPart editpart = (EditPart) editparts.get(i);
        command.add(editpart.getCommand(request));
    }
    return command;
}
项目:ermaster-k    文件:WordOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Word word = (Word) this.getModel();
    ERDiagram diagram = this.getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        WordDialog dialog = new WordDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), word, false,
                diagram);

        if (dialog.open() == IDialogConstants.OK_ID) {
            EditWordCommand command = new EditWordCommand(word,
                    dialog.getWord(), diagram);
            this.execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:TablespaceOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Tablespace tablespace = (Tablespace) this.getModel();
    ERDiagram diagram = this.getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        TablespaceDialog dialog = EclipseDBManagerFactory
                .getEclipseDBManager(diagram).createTablespaceDialog();

        if (dialog == null) {
            ERDiagramActivator
                    .showMessageDialog("dialog.message.tablespace.not.supported");
        } else {
            dialog.init(tablespace, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                EditTablespaceCommand command = new EditTablespaceCommand(
                        diagram, tablespace, dialog.getResult());
                this.execute(command);
            }
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:ViewOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    View view = (View) this.getModel();
    ERDiagram diagram = (ERDiagram) this.getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        View copyView = view.copyData();

        ViewDialog dialog = new ViewDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), this.getViewer(),
                copyView);

        if (dialog.open() == IDialogConstants.OK_ID) {
            CompoundCommand command = ViewEditPart
                    .createChangeViewPropertyCommand(diagram, view,
                            copyView);

            this.execute(command.unwrap());
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:GroupOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    ColumnGroup columnGroup = (ColumnGroup) this.getModel();
    ERDiagram diagram = this.getDiagram();

    GroupSet groupSet = diagram.getDiagramContents().getGroups();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        GroupDialog dialog = new GroupDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), groupSet, diagram,
                groupSet.indexOf(columnGroup));

        if (dialog.open() == IDialogConstants.OK_ID) {
            List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();

            Command command = new ChangeGroupCommand(diagram, groupSet,
                    newColumnGroups);

            this.execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:GroupSetOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    ERDiagram diagram = this.getDiagram();

    GroupSet groupSet = diagram.getDiagramContents().getGroups();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        GroupManageDialog dialog = new GroupManageDialog(PlatformUI
                .getWorkbench().getActiveWorkbenchWindow().getShell(),
                groupSet, diagram, false, -1);

        if (dialog.open() == IDialogConstants.OK_ID) {
            List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();

            Command command = new ChangeGroupCommand(diagram, groupSet,
                    newColumnGroups);

            this.execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:IndexOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Index index = (Index) this.getModel();
    ERDiagram diagram = this.getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        IndexDialog dialog = new IndexDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), index,
                index.getTable());

        if (dialog.open() == IDialogConstants.OK_ID) {
            ChangeIndexCommand command = new ChangeIndexCommand(diagram,
                    index, dialog.getResultIndex());

            this.execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:SequenceOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    try {
        Sequence sequence = (Sequence) this.getModel();
        ERDiagram diagram = this.getDiagram();

        if (request.getType().equals(RequestConstants.REQ_OPEN)) {
            SequenceDialog dialog = new SequenceDialog(PlatformUI
                    .getWorkbench().getActiveWorkbenchWindow().getShell(),
                    sequence, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                EditSequenceCommand command = new EditSequenceCommand(
                        diagram, sequence, dialog.getResult());
                this.execute(command);
            }
        }

        super.performRequest(request);

    } catch (Exception e) {
        ERDiagramActivator.showExceptionDialog(e);
    }
}
项目:ermaster-k    文件:TableOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    ERTable table = (ERTable) this.getModel();
    ERDiagram diagram = (ERDiagram) this.getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        ERTable copyTable = table.copyData();

        TableDialog dialog = new TableDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), this.getViewer(),
                copyTable);

        if (dialog.open() == IDialogConstants.OK_ID) {
            CompoundCommand command = ERTableEditPart
                    .createChangeTablePropertyCommand(diagram, table,
                            copyTable);

            this.execute(command.unwrap());
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:RelationOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Relation relation = (Relation) this.getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        Relation copy = relation.copy();

        RelationDialog dialog = new RelationDialog(PlatformUI
                .getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(
                    relation, copy);
            this.execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:TriggerOutlineEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Trigger trigger = (Trigger) this.getModel();
    ERDiagram diagram = (ERDiagram) this.getRoot().getContents().getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        TriggerDialog dialog = new TriggerDialog(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getShell(), trigger);

        if (dialog.open() == IDialogConstants.OK_ID) {
            EditTriggerCommand command = new EditTriggerCommand(diagram,
                    trigger, dialog.getResult());
            this.getViewer().getEditDomain().getCommandStack()
                    .execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:CommentConnectionEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Relation relation = (Relation) this.getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        Relation copy = relation.copy();

        RelationDialog dialog = new RelationDialog(PlatformUI
                .getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(
                    relation, copy);
            this.getViewer().getEditDomain().getCommandStack()
                    .execute(command);
        }
    }

    super.performRequest(request);
}
项目:ermaster-k    文件:RelationEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
    Relation relation = (Relation) this.getModel();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        Relation copy = relation.copy();

        RelationDialog dialog = new RelationDialog(PlatformUI
                .getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

        if (dialog.open() == IDialogConstants.OK_ID) {
            ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(
                    relation, copy);
            this.getViewer().getEditDomain().getCommandStack()
                    .execute(command);
        }
    }

    super.performRequest(request);
}
项目:ForgedUI-Eclipse    文件:ContainerHighlightEditPolicy.java   
public void showTargetFeedback(Request request) {
    if (request.getType().equals(RequestConstants.REQ_MOVE)
            || request.getType().equals(RequestConstants.REQ_ADD)
            //|| request.getType().equals(RequestConstants.REQ_CLONE)
            || request.getType().equals(RequestConstants.REQ_CREATE)) {

        List<Element> children = new ArrayList<Element>();
        if (request instanceof ChangeBoundsRequest) { 
            ChangeBoundsRequest req = (ChangeBoundsRequest)request;
            List<?> editParts = req.getEditParts();
            for (Object editPart : editParts) {
                children.add((Element) ((EditPart)editPart).getModel());
            }
        } else if (request instanceof CreateRequest){
            children.add((Element) ((CreateRequest)request).getNewObject());
        } else {
            //what is this???
        }

        showHighlight(children);
    }

}
项目:PDFReporter-Studio    文件:HtmlFigureEditPart.java   
@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_OPEN.equals(req.getType())) {
        if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
            JRExpressionEditor wizard = new JRExpressionEditor();
            MHtml m = (MHtml) getModel();
            wizard.setValue((JRDesignExpression) m
                    .getPropertyValue(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION));
            ExpressionContext ec=ModelUtils.getElementExpressionContext((JRDesignElement)m.getValue(), m);
            wizard.setExpressionContext(ec);
            WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(Display.getDefault()
                    .getActiveShell(), wizard);
            if (dialog.open() == Dialog.OK) {
                SetValueCommand cmd = new SetValueCommand();
                cmd.setTarget((IPropertySource) getModel());
                cmd.setPropertyId(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION);
                cmd.setPropertyValue(wizard.getValue());
                getViewer().getEditDomain().getCommandStack().execute(cmd);
            }
        }
    } else
        super.performRequest(req);
}
项目:PDFReporter-Studio    文件:ChartEditPart.java   
@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_OPEN.equals(req.getType())) {
        Command cmd = null;
        MChart mchart = (MChart) getModel();
        if (mchart.getValue().getChartType() == JRChart.CHART_TYPE_MULTI_AXIS)
            return;
        INode parent = mchart.getParent();
        if (parent instanceof MFrame)
            cmd = new EditChartCommand((MFrame) parent, mchart);
        if (parent instanceof MBand)
            cmd = new EditChartCommand((MBand) parent, mchart);
        if (parent instanceof MElementGroup)
            cmd = new EditChartCommand((MElementGroup) parent, mchart);

        getViewer().getEditDomain().getCommandStack().execute(cmd);

    } else
        super.performRequest(req);
}
项目:PDFReporter-Studio    文件:SpiderChartEditPart.java   
@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_OPEN.equals(req.getType())) {
        Command cmd = null;
        MSpiderChart mchart = (MSpiderChart) getModel();
        INode parent = mchart.getParent();
        if (parent instanceof MFrame)
            cmd = new EditSpiderChartCommand((MFrame) parent, mchart);
        if (parent instanceof MBand)
            cmd = new EditSpiderChartCommand((MBand) parent, mchart);
        if (parent instanceof MElementGroup)
            cmd = new EditSpiderChartCommand((MElementGroup) parent, mchart);

        getViewer().getEditDomain().getCommandStack().execute(cmd);

    } else
        super.performRequest(req);
}
项目:PDFReporter-Studio    文件:DeleteRowAction.java   
/**
 * 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;
}
项目:PDFReporter-Studio    文件:StaticTextFigureEditPart.java   
public void performRequest(Request request) {

        if (request.getType() == RequestConstants.REQ_OPEN) {

            if (manager == null) {
                manager = new TextEditManager(this, new LabelCellEditorLocator(getFigure()));
            }
            manager.show();
        }

        /*
         * if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) { if (manager == null) { manager = new
         * DirectEditManager(this, TextCellEditor.class, new LabelCellEditorLocator(getFigure()), null) {
         * 
         * @Override protected void initCellEditor() { MStaticText model = (MStaticText) getModel();
         * getCellEditor().setValue(model.getPropertyValue(JRBaseStaticText.PROPERTY_TEXT));
         * getCellEditor().getControl().setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); } }; }
         * manager.show(); }
         */
    }
项目:erflute    文件:ERDiagramAlignmentAction.java   
private Command createAlignmentCommand() {
    final AlignmentRequest request = new AlignmentRequest(RequestConstants.REQ_ALIGN);
    request.setAlignmentRectangle(calculateAlignmentRectangle(request));
    request.setAlignment(alignment);
    final List<?> editparts = getOperationSet(request);
    if (editparts.size() < 2)
        return null;

    final CompoundCommand command = new CompoundCommand();
    command.setDebugLabel(getText());
    for (int i = 0; i < editparts.size(); i++) {
        final EditPart editpart = (EditPart) editparts.get(i);
        command.add(editpart.getCommand(request));
    }
    return command;
}
项目:erflute    文件:WordOutlineEditPart.java   
@Override
public void performRequest(Request request) {
    final Word word = (Word) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final WordDialog dialog = new WordDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), word, false, diagram);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final EditWordCommand command = new EditWordCommand(word, dialog.getWord(), diagram);
            execute(command);
        }
    }

    super.performRequest(request);
}
项目:erflute    文件:TablespaceOutlineEditPart.java   
@Override
public void performRequest(Request request) {
    final Tablespace tablespace = (Tablespace) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final TablespaceDialog dialog = EclipseDBManagerFactory.getEclipseDBManager(diagram).createTablespaceDialog();

        if (dialog == null) {
            Activator.showMessageDialog("dialog.message.tablespace.not.supported");
        } else {
            dialog.init(tablespace, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                final EditTablespaceCommand command = new EditTablespaceCommand(diagram, tablespace, dialog.getResult());
                execute(command);
            }
        }
    }

    super.performRequest(request);
}
项目:erflute    文件:ViewOutlineEditPart.java   
@Override
public void performRequest(Request request) {
    final ERView view = (ERView) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final ERView copyView = view.copyData();

        final ViewDialog dialog =
                new ViewDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getViewer(), copyView, diagram
                        .getDiagramContents().getColumnGroupSet());

        if (dialog.open() == IDialogConstants.OK_ID) {
            final CompoundCommand command = ViewEditPart.createChangeViewPropertyCommand(diagram, view, copyView);

            execute(command.unwrap());
        }
    }

    super.performRequest(request);
}
项目:erflute    文件:ColumnGroupOutlineEditPart.java   
@Override
public void performRequest(Request request) {
    final ColumnGroup columnGroup = (ColumnGroup) getModel();
    final ERDiagram diagram = getDiagram();
    final ColumnGroupSet groupSet = diagram.getDiagramContents().getColumnGroupSet();
    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        final ColumnGroupDialog dialog = new ColumnGroupDialog(shell, groupSet, diagram, groupSet.indexOf(columnGroup));
        if (dialog.open() == IDialogConstants.OK_ID) {
            final List<CopyColumnGroup> newColumnGroups = dialog.getCopyColumnGroups();
            final Command command = new ChangeColumnGroupCommand(diagram, groupSet, newColumnGroups);
            execute(command);
        }
    }
    super.performRequest(request);
}
项目:erflute    文件:IndexOutlineEditPart.java   
@Override
public void performRequest(Request request) {
    final ERIndex index = (ERIndex) getModel();
    final ERDiagram diagram = getDiagram();

    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
        final IndexDialog dialog = new IndexDialog(
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), index, index.getTable());

        if (dialog.open() == IDialogConstants.OK_ID) {
            final ChangeIndexCommand command = new ChangeIndexCommand(diagram, index, dialog.getResultIndex());
            execute(command);
        }
    }

    super.performRequest(request);
}