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

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


    };
  }

  @Override
  protected Command getResizeCommand(final ChangeBoundsRequest request) {
    return new EditCommand(m_layout) {
      @Override
      protected void executeEdit() throws Exception {
        for (EditPart editPart : request.getEditParts()) {
          IAbstractComponentInfo widget = (IAbstractComponentInfo) editPart.getModel();
          Rectangle bounds = widget.getModelBounds();
View Full Code Here


  @Override
  protected void updateTooltipCommand() {
    // EAST
    if (m_resizeDirection == IPositionConstants.EAST) {
      final double newWidth = getNewWidth();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          ColumnLayoutInfo.getColumnData(m_widget).setWidth(newWidth);
        }
      };
View Full Code Here

  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 {
        int newWidth = Math.max(newBounds.width, 0);
        m_column.setWidth(newWidth);
      }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void updateTooltipCommand() {
    if (m_resizeDirection == IPositionConstants.SOUTH) {
      prepareNewFlex();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          VBoxLayoutInfo.getVBoxData(m_widget).setFlex(m_flex);
        }
      };
View Full Code Here

  @Override
  protected void updateTooltipCommand() {
    // EAST
    if (m_resizeDirection == IPositionConstants.EAST) {
      final String newWidth = getNewWidth();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          AnchorLayoutInfo.getAnchorData(m_widget).setAnchorWidth(newWidth);
        }
      };
    }
    // SOUTH
    if (m_resizeDirection == IPositionConstants.SOUTH) {
      final String newHeight = getNewHeight();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          AnchorLayoutInfo.getAnchorData(m_widget).setAnchorHeight(newHeight);
        }
      };
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void updateTooltipCommand() {
    if (m_resizeDirection == IPositionConstants.EAST) {
      prepareNewFlex();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          HBoxLayoutInfo.getHBoxData(m_widget).setFlex(m_flex);
        }
      };
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command getCreateCommand(CreateRequest request) {
    if (m_target.m_valid) {
      final WidgetInfo component = (WidgetInfo) request.getNewObject();
      return new EditCommand(m_layout) {
        @Override
        protected void executeEdit() throws Exception {
          m_layout.command_CREATE(
              component,
              m_target.m_column,
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_ADD(
                component,
                m_target.m_column,
View Full Code Here

  @Override
  protected void updateTooltipCommand() {
    // EAST
    if (m_resizeDirection == IPositionConstants.EAST) {
      final double newWidth = getNewWidth();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          RowLayoutInfo.getRowData(m_widget).setWidth(newWidth);
        }
      };
    }
    // SOUTH
    if (m_resizeDirection == IPositionConstants.SOUTH) {
      final double newHeight = getNewHeight();
      m_command = new EditCommand(m_widget) {
        @Override
        protected void executeEdit() throws Exception {
          RowLayoutInfo.getRowData(m_widget).setHeight(newHeight);
        }
      };
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.