Package com.google.gdt.eclipse.designer.model.widgets.panels.grid

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.grid.CellConstraintsSupport$SetHorizontalAlignmentAction


  private static void setVerticalAlignment(final WidgetInfo widget,
      final RowInfo.Alignment alignment) {
    ExecutionUtils.run(widget, new RunnableEx() {
      @Override
      public void run() throws Exception {
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(widget);
        constraints.setVerticalAlignment(alignment);
      }
    });
  }
View Full Code Here


    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo button = panel.getChildrenWidgets().get(0);
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
        constraints.setVerticalAlignment(alignment);
      }
    });
    //
    String expectedSource =
        getTestSource(
View Full Code Here

    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo button = panel.getChildrenWidgets().get(0);
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
        constraints.setVerticalAlignment(RowInfo.Alignment.BOTTOM);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

        alignmentAction.run();
      }
    });
    // check result
    {
      CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
      assertSame(expectedHorizontalAlignment, constraints.getHorizontalAlignment());
      assertSame(expectedVerticalAlignment, constraints.getVerticalAlignment());
    }
  }
View Full Code Here

        "}");
    assertThat(panel.getColumns()).hasSize(2);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("2 1 [1] {(0,0)=(2,1)}", panel.getStatus().toString());
    // check constraints
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    assertEquals(0, constraints.getX());
    assertEquals(0, constraints.getY());
    assertEquals(2, constraints.getWidth());
    assertEquals(1, constraints.getHeight());
    // checks grid
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 2, 1), gridInfo.getComponentCells(button));
  }
View Full Code Here

  }

  @Override
  protected Figure createAlignmentFigure(IAbstractComponentInfo component, boolean horizontal) {
    IEditPartViewer viewer = getHost().getViewer();
    final CellConstraintsSupport constraints = HTMLTableInfo.getConstraints((WidgetInfo) component);
    if (horizontal) {
      return new AbstractPopupFigure(viewer, 9, 5) {
        @Override
        protected Image getImage() {
          return constraints.getHorizontalAlignment().getSmallImage();
        }

        @Override
        protected void fillMenu(IMenuManager manager) {
          constraints.fillHorizontalAlignmentMenu(manager);
        }
      };
    } else {
      return new AbstractPopupFigure(viewer, 5, 9) {
        @Override
        protected Image getImage() {
          return constraints.getVerticalAlignment().getSmallImage();
        }

        @Override
        protected void fillMenu(IMenuManager manager) {
          constraints.fillVerticalAlignmentMenu(manager);
        }
      };
    }
  }
View Full Code Here

   * Sets the horizontal alignment.
   */
  private void setHorizontalAlignment(final ColumnInfo.Alignment alignment) {
    ExecutionUtils.run(m_layout, new RunnableEx() {
      public void run() throws Exception {
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(m_component);
        constraints.setHorizontalAlignment(alignment);
      }
    });
  }
View Full Code Here

   * Sets the vertical alignment.
   */
  private void setVerticalAlignment(final RowInfo.Alignment alignment) {
    ExecutionUtils.run(m_layout, new RunnableEx() {
      public void run() throws Exception {
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(m_component);
        constraints.setVerticalAlignment(alignment);
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.grid.CellConstraintsSupport$SetHorizontalAlignmentAction

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.