Package org.eclipse.gef.commands

Examples of org.eclipse.gef.commands.Command


    return new PasteRecordCommand(shiftCount);
  }

  @Override
  protected boolean calculateEnabled() {
    Command command = createPasteCommand();
    return command != null && command.canExecute();
  }
View Full Code Here


    return command != null && command.canExecute();
  }

  @Override
  public void run() {
    Command command = createPasteCommand();
    if (command != null && command.canExecute()) {
      execute(command);
      shiftCount++;
    }
  }
View Full Code Here

   * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
   */
  protected Command getCommand() {
    DesignRange range = getViewer().getRangeSelection();
    DOMRange dRange = DOMRangeHelper.toDOMRange(range);
    Command command;
    if (isApplied(dRange)) {
      // command = new UnapplyStyleCommand(getViewer(), _expectedTag,
      // null, null);
      // since the un-applystyle is not implemented yet,we do nothing
      // here.
View Full Code Here

    if (request instanceof LinkRequest) {
      LinkRequest req = (LinkRequest) request;
      String identifier = req.getIdentifier();
      DesignRange range = req.getDesignRange();
            // TODO: when part !instancof TextEditPart, viewer == null
      Command command = new MakeLinkCommand(identifier, viewer, part,
          range);
      return command;
    }
    return super.getCommand(request);
  }
View Full Code Here

    IHTMLGraphicalViewer viewer = getViewer();
    if (viewer.isInRangeMode()) {
      command = new CopyCommand(viewer);
      command.execute();
    } else {
      Command nodeCopy = new CopyNodeCommand(viewer);
      nodeCopy.execute();
    }
  }
View Full Code Here

   */
  public Command getCommand(Request request) {
    if (request instanceof PDDropRequest) {
      PDDropRequest r = (PDDropRequest) request;
      final String s = (String) r.getCurrentEvent().data;
      return new Command() {
        /*
         * (non-Javadoc)
         *
         * @see org.eclipse.gef.commands.Command#execute()
         */
 
View Full Code Here

        // customization
        updateTargetRequest();
        updateTargetEditPart();

        if (getTargetEditPart() != null) {
            Command command = getCommand();
            if (command != null && command.canExecute())
                if (customizeAndCheckExecute(command))
                {
                    getViewer().getEditDomain().getCommandStack().execute(command);
                }
            else
View Full Code Here

    StyledText text = null;
    if (_textEditor.getTextViewer() != null) {
      text = _textEditor.getTextViewer().getTextWidget();
    }
    text.setCaretOffset(_location);
    Command command = getCommand(event);
    if (command == null) {
      return;
    }
    command.execute();
  }
View Full Code Here

    // the tag create metadata. Get a tag creation provider?
    Map attributes = new LinkedHashMap();
    attributes.put("href", "")//$NON-NLS-1$//$NON-NLS-2$
    attributes.put("rel", "Stylesheet")//$NON-NLS-1$//$NON-NLS-2$
    attributes.put("type", "text/css")//$NON-NLS-1$//$NON-NLS-2$
    Command command = new AddSubNodeCommand(
        PDPlugin.getResourceString("ItemCreationEditPolicy.CommandLabel.CreateItem"),//$NON-NLS-1$
        _parentElement, IHTMLConstants.TAG_LINK, ITLDConstants.URI_HTML,
        attributes);
    command.execute();
  }
View Full Code Here

    // Assert.isTrue(_viewer != null && _viewer.isInRangeMode());
    DesignRange range = _viewer.getRangeSelection();
    if (range == null || !range.isValid()) {
      return;
    }
    Command command = getCommand();
    if (command != null) {
      command.execute();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gef.commands.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.