Package com.google.gdt.eclipse.designer.gxt.model.layout

Examples of com.google.gdt.eclipse.designer.gxt.model.layout.LayoutInfo


          ComponentDescriptionHelper.getDescription(editor, layoutClass);
      ObjectInfoAction action = new ObjectInfoAction(this) {
        @Override
        protected void runEx() throws Exception {
          description.ensureLibraries(editor.getJavaProject());
          LayoutInfo layout =
              (LayoutInfo) JavaInfoUtils.createJavaInfo(
                  getEditor(),
                  layoutClass,
                  new ConstructorCreationSupport(creationId, true));
          setLayout(layout);
View Full Code Here


      // check if same implicit already exists
      if (initialize_removeImplicitLayout(layout)) {
        return;
      }
      // create layout model
      LayoutInfo implicitLayout;
      CreationSupport creationSupport = new ImplicitLayoutCreationSupport(this);
      if (layout == null) {
        implicitLayout = createDefaultImplicitLayout(editor, creationSupport);
      } else {
        Class<?> layoutClass = layout.getClass();
        implicitLayout =
            (LayoutInfo) JavaInfoUtils.createJavaInfo(editor, layoutClass, creationSupport);
      }
      // set variable support
      VariableSupport variableSupport = new ImplicitLayoutVariableSupport(implicitLayout);
      implicitLayout.setVariableSupport(variableSupport);
      // set association
      implicitLayout.setAssociation(new ImplicitObjectAssociation(this));
      // add as child
      addChildFirst(implicitLayout);
    }
  }
View Full Code Here

    putArbitraryValue(KEY_DONT_SET_IMPLICIT_LAYOUT, Boolean.TRUE);
    startEdit();
    try {
      // remove old layout
      {
        LayoutInfo oldLayout = getLayout();
        oldLayout.delete();
      }
      // prepare StatementGenerator
      StatementGenerator statementGenerator;
      if (JavaInfoUtils.hasTrueParameter(newLayout, "layout.setInBlock")) {
        statementGenerator = BlockStatementGenerator.INSTANCE;
View Full Code Here

  /**
   * Adds commands for coping this {@link LayoutContainerInfo}.
   */
  protected void clipboardCopy_addCommands(List<ClipboardCommand> commands) throws Exception {
    if (hasLayout()) {
      LayoutInfo layout = getLayout();
      if (layout.getCreationSupport() instanceof IImplicitCreationSupport) {
        // no need to set implicit layout
      } else {
        final JavaInfoMemento layoutMemento = JavaInfoMemento.createMemento(layout);
        commands.add(new ClipboardCommand() {
          private static final long serialVersionUID = 0L;

          @Override
          public void execute(JavaInfo javaInfo) throws Exception {
            LayoutContainerInfo composite = (LayoutContainerInfo) javaInfo;
            LayoutInfo newLayout = (LayoutInfo) layoutMemento.create(javaInfo);
            composite.setLayout(newLayout);
            layoutMemento.apply();
          }
        });
      }
View Full Code Here

  @Override
  protected void refreshEditPolicies() {
    super.refreshEditPolicies();
    // support for dropping components
    if (m_container.hasLayout()) {
      LayoutInfo layout = m_container.getLayout();
      if (m_currentLayout != layout) {
        LayoutEditPolicy policy = LayoutPolicyUtils.createLayoutEditPolicy(this, layout);
        if (policy != null) {
          m_currentLayout = layout;
          installEditPolicy(EditPolicy.LAYOUT_ROLE, policy);
View Full Code Here

  // Command
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected Command getCreateCommand(Object newObject, Object referenceObject) {
    final LayoutInfo newLayout = (LayoutInfo) newObject;
    return new EditCommand(m_container) {
      @Override
      protected void executeEdit() throws Exception {
        m_container.setLayout(newLayout);
      }
View Full Code Here

    //
    // Implementation
    //
    ////////////////////////////////////////////////////////////////////////////
    private void update() {
      LayoutInfo layout = m_container.getLayout();
      // check for new LayoutInfo, remove old SelectionEditPolicy's
      {
        if (m_layout != null && layout != m_layout) {
          undecorateChildren();
        }
View Full Code Here

    assertHierarchy(
        "{this: test.client.MyContainer} {this} {}",
        "  {implicit-layout: com.extjs.gxt.ui.client.widget.layout.FlowLayout} {implicit-layout} {}");
    // check layout
    assertTrue(container.hasLayout());
    LayoutInfo layout = container.getLayout();
    assertThat(layout).isInstanceOf(FlowLayoutInfo.class);
    // simulate LayoutInfo absence
    {
      container.removeChild(layout);
      try {
View Full Code Here

        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {}",
        "  {implicit-layout: default} {implicit-layout} {}");
    assertThat(container.getLayout()).isInstanceOf(DefaultLayoutInfo.class);
    // set FlowLayout
    {
      LayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.FlowLayout");
      container.setLayout(layout);
      assertEditor(
          "// filler filler filler",
          "public class Test extends LayoutContainer {",
          "  public Test() {",
          "    setLayout(new FlowLayout(5));",
          "  }",
          "}");
      assertHierarchy(
          "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FlowLayout(5))/}",
          "  {new: com.extjs.gxt.ui.client.widget.layout.FlowLayout} {empty} {/setLayout(new FlowLayout(5))/}");
      assertSame(layout, container.getLayout());
    }
    // set RowLayout
    {
      LayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.RowLayout");
      container.setLayout(layout);
      assertEditor(
          "// filler filler filler",
          "public class Test extends LayoutContainer {",
          "  public Test() {",
View Full Code Here

        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FlowLayout(5))/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.FlowLayout} {empty} {/setLayout(new FlowLayout(5))/}");
    assertThat(container.getLayout()).isInstanceOf(FlowLayoutInfo.class);
    // set RowLayout
    {
      LayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.RowLayout");
      container.setLayout(layout);
      assertEditor(
          "public class Test extends LayoutContainer {",
          "  public Test() {",
          "    setLayout(new RowLayout(Orientation.HORIZONTAL));",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gxt.model.layout.LayoutInfo

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.