Package org.eclipse.wb.core.gef.command

Examples of org.eclipse.wb.core.gef.command.EditCommand


  }

  @Override
  protected Command getAddCommand(ChangeBoundsRequest request) {
    final List<EditPart> editParts = request.getEditParts();
    return new EditCommand(m_panel) {
      @Override
      protected void executeEdit() throws Exception {
        placementsSupport.commitAdd();
        for (W widget : toWidgets(editParts)) {
          Rectangle bounds = widget.getModelBounds();
View Full Code Here


  }

  @Override
  protected Command getResizeCommand(final ChangeBoundsRequest request) {
    final List<EditPart> editParts = request.getEditParts();
    return new EditCommand(m_panel) {
      @Override
      protected void executeEdit() throws Exception {
        List<W> widgets = toWidgets(editParts);
        for (W widget : widgets) {
          Rectangle bounds = widget.getModelBounds();
View Full Code Here

      m_tooltip += "\nRelease Ctrl to set size in pixels";
    } else {
      m_tooltip += "\nPress Ctrl to set size in percents";
    }
    // command
    m_command = new EditCommand(m_object) {
      @Override
      protected void executeEdit() throws Exception {
        IUIObjectSizeSupport sizeSupport = m_object.getSizeSupport();
        if (m_resizeDirection == IPositionConstants.EAST) {
          sizeSupport.setSize(newWidth, null);
View Full Code Here

  private Figure m_resizeFeedback;
  private TextFeedback m_textFeedback;

  private Command getResizeCommand(ChangeBoundsRequest request) {
    final Rectangle newBounds = request.getTransformedRectangle(getHostFigure().getBounds());
    return new EditCommand(m_column) {
      @Override
      protected void executeEdit() throws Exception {
        Property widthProperty = m_column.getWidthProperty();
        if (widthProperty != null) {
          widthProperty.setValue(newBounds.width + "px");
View Full Code Here

  // Span
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command createSpanCommand(final boolean horizontal, final Rectangle cells) {
    return new EditCommand(m_layout) {
      @Override
      protected void executeEdit() throws Exception {
        m_layout.command_CELLS(m_component, cells);
      }
    };
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command getMoveCommand(Object moveObject, Object referenceObject) {
    final W component = getWidget(moveObject);
    final W reference = getWidget(referenceObject);
    return new EditCommand(m_panel) {
      @Override
      protected void executeEdit() throws Exception {
        m_panel.command_MOVE2(component, reference);
      }
    };
View Full Code Here

  protected Command getMoveCommand(ChangeBoundsRequest request) {
    if (m_target.m_valid && request.getEditParts().size() == 1) {
      EditPart moveEditPart = request.getEditParts().get(0);
      if (moveEditPart.getModel() instanceof WidgetInfo) {
        final WidgetInfo component = (WidgetInfo) moveEditPart.getModel();
        return new EditCommand(m_layout) {
          @Override
          protected void executeEdit() throws Exception {
            m_layout.command_MOVE(
                component,
                m_target.m_column,
View Full Code Here

  protected Command getAddCommand(ChangeBoundsRequest request) {
    if (m_target.m_valid && request.getEditParts().size() == 1) {
      EditPart moveEditPart = request.getEditParts().get(0);
      if (moveEditPart.getModel() instanceof WidgetInfo) {
        final WidgetInfo component = (WidgetInfo) moveEditPart.getModel();
        return new EditCommand(m_layout) {
          @Override
          protected void executeEdit() throws Exception {
            m_layout.command_MOVE(
                component,
                m_target.m_column,
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command getCreateCommand(CreateRequest request) {
    final WidgetInfo component = (WidgetInfo) request.getNewObject();
    return new EditCommand(m_canvas) {
      @Override
      protected void executeEdit() throws Exception {
        placementsSupport.commitAdd();
        Rectangle widgetModelBounds = component.getModelBounds();
        m_canvas.command_absolute_CREATE(component, null);
View Full Code Here

  }

  @Override
  protected Command getMoveCommand(ChangeBoundsRequest request) {
    final List<EditPart> editParts = request.getEditParts();
    return new EditCommand(m_canvas) {
      @Override
      protected void executeEdit() throws Exception {
        ArrayList<IAbstractComponentInfo> models = Lists.newArrayList();
        for (EditPart editPart : editParts) {
          models.add((IAbstractComponentInfo) editPart.getModel());
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.gef.command.EditCommand

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.