Package org.eclipse.emf.common.command

Examples of org.eclipse.emf.common.command.Command


        getViewSite().getShell().getDisplay().asyncExec(new Runnable() {

          @Override
          public void run() {
            update();
            Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
            if (mostRecentCommand != null) {
              setSelectionToViewer(mostRecentCommand.getAffectedObjects());
            }
            if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed() && propertySheetPage.getCurrentTab() != null) {
              propertySheetPage.refresh();
            }
          }
View Full Code Here


    }
  }

  @Override
  public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
    Command redoCommand = editingDomain.getCommandStack().getRedoCommand();
    if (redoCommand != null && redoCommand.getLabel() != null) {
      element.setText("&Redo " + redoCommand.getLabel());
    } else {
      element.setText("&Redo");
    }

  }
View Full Code Here

      return null;
  }
 
  @Override
  public void setEnabled(Object evaluationContext) {
    Command pasteFromClipboardCommand = null;
    setBaseEnabled(false);
    Object obj = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
    if (obj instanceof IStructuredSelection) {
      IStructuredSelection selection = (IStructuredSelection) obj;
      if (selection.size() == 1) {
View Full Code Here

    return null;
  }
 
  @Override
  public void setEnabled(Object evaluationContext) {
    Command createDestinationDataStoreEntryCommand = null;
    Command createDestinationDataCommand = null;
    setBaseEnabled(false);
    Object obj = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
    if (obj instanceof IStructuredSelection) {
      obj = ((IStructuredSelection)obj).getFirstElement();
      if (obj instanceof DestinationDataStore){
View Full Code Here

    return null;
  }

  @Override
  public void setEnabled(Object evaluationContext) {
    Command cutToClipboardCommand = null;
    setBaseEnabled(false);
    Object obj = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
    if (obj instanceof IStructuredSelection) {
      IStructuredSelection selection = (IStructuredSelection) obj;
      if (selection.size() == 1) {
View Full Code Here

    }
  }

  @Override
  public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
    Command undoCommand = editingDomain.getCommandStack().getUndoCommand();
    if (undoCommand != null && undoCommand.getLabel() != null) {
      element.setText("&Undo " + undoCommand.getLabel());
    } else {
      element.setText("&Undo");
    }

  }
View Full Code Here

    return null;
  }
 
  @Override
  public void setEnabled(Object evaluationContext) {
    Command createServerDataStoreEntryCommand = null;
    Command createServerDataCommand = null;
    setBaseEnabled(false);
    Object obj = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
    if (obj instanceof IStructuredSelection) {
      obj = ((IStructuredSelection)obj).getFirstElement();
      if (obj instanceof ServerDataStore){
View Full Code Here

      public void notifyChanged(Notification notification) {
        System.out.println("Changed.");
        String newContent = TracingUtil.createProxyContent(
            (EObject) target, names);
        if (!newContent.equals(value.getTheValue())) {
          Command cmd = SetCommand
              .create(domain,
                  object,
                  ReqIF10Package.Literals.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES,
                  newContent);
          domain.getCommandStack().execute(cmd);
View Full Code Here

        .getTheValue();
    String currentContent = buildProxyContent(element);
    if (proxyContent.equals(currentContent))
      return;
    // Content differs: Update the Value.
    Command cmd = SetCommand.create(domain, proxyValue,
        ReqIF10Package.Literals.ATTRIBUTE_VALUE_STRING__THE_VALUE,
        currentContent);
    domain.getCommandStack().execute(cmd);
  }
View Full Code Here

      if (tokenizer.hasMoreTokens())
        sb.append("\n");
      linenumber++;
    }
    // Content differs: Update the Value.
    Command cmd = SetCommand.create(domain, proxyValue,
        ReqIF10Package.Literals.ATTRIBUTE_VALUE_STRING__THE_VALUE,
        sb.toString());
    domain.getCommandStack().execute(cmd);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.command.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.