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

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


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


          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

  private void initialize_createImplicitLayout() throws Exception {
    if (hasLayout()) {
      AstEditor editor = getEditor();
      Object layout = ReflectionUtils.invokeMethod(getObject(), "getLayout()");
      // create implicit layout model
      LayoutInfo implicitLayout;
      CreationSupport creationSupport = new ImplicitLayoutCreationSupport(this);
      if (layout == null) {
        implicitLayout = createDefaultImplicitLayout(creationSupport);
      } else {
        implicitLayout =
            (LayoutInfo) JavaInfoUtils.createJavaInfo(editor, layout.getClass(), creationSupport);
      }
      // initialize layout model
      {
        // set variable support
        {
          VariableSupport variableSupport = new ImplicitLayoutVariableSupport(implicitLayout);
          implicitLayout.setVariableSupport(variableSupport);
        }
        // set association
        implicitLayout.setAssociation(new ImplicitObjectAssociation(this));
        // add as child
        addChild(implicitLayout);
      }
    }
  }
View Full Code Here

    putArbitraryValue(KEY_DONT_SET_IMPLICIT_LAYOUT, Boolean.TRUE);
    startEdit();
    try {
      // remove old layout
      {
        LayoutInfo oldLayout = getLayout();
        oldLayout.delete();
      }
      // set new layout
      VariableSupport variableSupport =
          new EmptyInvocationVariableSupport(newLayout, "%parent%.setLayout(%child%)", 0);
      JavaInfoUtils.add(
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

  // 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

  @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

  @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

            "      add(label_2);",
            "    }",
            "  }",
            "}");
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.BorderLayout");
      panel.setLayout(layout);
    }
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(label_1, new BorderLayoutData(RegionPosition.CENTER))/ /add(label_2, new BorderLayoutData(RegionPosition.CENTER))/ /setLayout(new BorderLayout())/}",
        "  {new: com.gwtext.client.widgets.layout.BorderLayout} {empty} {/setLayout(new BorderLayout())/}",
View Full Code Here

        "  {new: com.gwtext.client.widgets.Panel} {local-unique: container} {/new Panel()/ /rootPanel.add(container)/}",
        "    {implicit-layout: default} {implicit-layout} {}");
    ContainerInfo container = (ContainerInfo) frame.getChildrenWidgets().get(0);
    assertTrue(container.hasLayout());
    //
    LayoutInfo layout = container.getLayout();
    assertInstanceOf(DefaultLayoutInfo.class, layout);
    // layouts are not displayed in tree
    {
      IObjectPresentation presentation = layout.getPresentation();
      assertFalse(presentation.isVisible());
    }
    // "default" layout has no LayoutData
    try {
      ReflectionUtils.invokeMethod(
          layout,
          "getDefaultVirtualDataObject(com.google.gdt.eclipse.designer.model.widgets.WidgetInfo)",
          (WidgetInfo) null);
      fail();
    } catch (NotImplementedException e) {
    }
    // layout has GWTState same as RootPanel
    assertThat(layout.getState()).isSameAs(frame.getState());
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gwtext.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.