Examples of JavaInfoMemento


Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

    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

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

        "    {opaque} {field-initializer: m_myBundle} {/GWT.create(MyImageBundle.class)/ /new Tree(m_myBundle)/}");
    frame.refresh();
    // copy Tree into bytes
    {
      WidgetInfo tree = frame.getChildrenWidgets().get(0);
      JavaInfoMemento memento = JavaInfoMemento.createMemento(tree);
      m_clipboardTreeBytes = JavaInfoMementoTransfer.convertObjectToBytes(memento);
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

            "}"));
    waitForAutoBuild();
  }

  private void addTreeFromMemento(final RootPanelInfo frame) throws Exception {
    final JavaInfoMemento memento =
        (JavaInfoMemento) JavaInfoMementoTransfer.convertBytesToObject(m_clipboardTreeBytes);
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo newTree = (WidgetInfo) memento.create(frame);
        frame.command_CREATE2(newTree, null);
        memento.apply();
      }
    });
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

      public void clipboardCopy(JavaInfo javaInfo, List<ClipboardCommand> commands)
          throws Exception {
        if (javaInfo == AbstractCellTableInfo.this) {
          List<ColumnInfo> columns = getColumns();
          for (ColumnInfo column : columns) {
            final JavaInfoMemento columnMemento = JavaInfoMemento.createMemento(column);
            final Object headerValue = column.getHeaderProperty().getValue();
            commands.add(new ClipboardCommand() {
              private static final long serialVersionUID = 0L;

              @Override
              public void execute(JavaInfo javaInfo) throws Exception {
                AbstractCellTableInfo cellTable = (AbstractCellTableInfo) javaInfo;
                ColumnInfo column = (ColumnInfo) columnMemento.create(cellTable);
                cellTable.addColumn(column);
                column.getHeaderProperty().setValue(headerValue);
              }
            });
          }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

        "  {new: com.extjs.gxt.ui.client.widget.layout.FlowLayout} {empty} {/setLayout(new FlowLayout())/}",
        "  {new: test.client.MyContainer} {local-unique: inner} {/new MyContainer()/ /add(inner)/}",
        "    {implicit-layout: com.extjs.gxt.ui.client.widget.layout.RowLayout} {implicit-layout} {}",
        "    {virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.FlowData} {virtual-layout-data} {}");
    // prepare memento
    JavaInfoMemento memento;
    {
      LayoutContainerInfo inner = (LayoutContainerInfo) container.getWidgets().get(0);
      memento = JavaInfoMemento.createMemento(inner);
    }
    // create new Widget
    WidgetInfo newWidget = (WidgetInfo) memento.create(container);
    container.getLayout().command_CREATE(newWidget, null);
    memento.apply();
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new FlowLayout());",
        "    {",
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

        "  {new: com.extjs.gxt.ui.client.widget.layout.FlowLayout} {empty} {/setLayout(new FlowLayout())/}",
        "  {new: com.extjs.gxt.ui.client.widget.LayoutContainer} {local-unique: inner} {/new LayoutContainer()/ /add(inner)/ /inner.setLayout(new RowLayout(Orientation.VERTICAL))/}",
        "    {new: com.extjs.gxt.ui.client.widget.layout.RowLayout} {empty} {/inner.setLayout(new RowLayout(Orientation.VERTICAL))/}",
        "    {virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.FlowData} {virtual-layout-data} {}");
    // prepare memento
    JavaInfoMemento memento;
    {
      LayoutContainerInfo inner = (LayoutContainerInfo) container.getWidgets().get(0);
      memento = JavaInfoMemento.createMemento(inner);
    }
    // create new Widget
    WidgetInfo newWidget = (WidgetInfo) memento.create(container);
    container.getLayout().command_CREATE(newWidget, null);
    memento.apply();
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new FlowLayout());",
        "    {",
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

    IMenuPolicy policy = MenuObjectInfoUtils.getMenuInfo(bar).getPolicy();
    // Object can not be pasted (not list of memento at all)
    assertFalse(policy.validatePaste(new Object()));
    // RootPanel can not be pasted (even it memento)
    {
      JavaInfoMemento memento = JavaInfoMemento.createMemento(button);
      List<JavaInfoMemento> mementos = ImmutableList.of(memento);
      assertFalse(policy.validatePaste(mementos));
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

    MenuBarInfo bar = getJavaInfoByName("bar");
    // create new item
    List<JavaInfoMemento> mementos;
    {
      MenuItemInfo existingItem = bar.getItems().get(0);
      JavaInfoMemento memento = JavaInfoMemento.createMemento(existingItem);
      mementos = ImmutableList.of(memento);
    }
    // paste "newItem"
    {
      IMenuPolicy policy = MenuObjectInfoUtils.getMenuInfo(bar).getPolicy();
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

    IMenuPolicy policy = MenuObjectInfoUtils.getMenuInfo(bar).getPolicy();
    // Object can not be pasted (not list of memento at all)
    assertFalse(policy.validatePaste(new Object()));
    // MenuBar can not be pasted (even if it has memento)
    {
      JavaInfoMemento memento = JavaInfoMemento.createMemento(bar);
      List<JavaInfoMemento> mementos = ImmutableList.of(memento);
      assertFalse(policy.validatePaste(mementos));
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.clipboard.JavaInfoMemento

    MenuBarInfo bar = (MenuBarInfo) container.getWidgets().get(0);
    // prepare mementos
    List<JavaInfoMemento> mementos;
    {
      MenuBarItemInfo existingItem = bar.getItems().get(0);
      JavaInfoMemento memento = JavaInfoMemento.createMemento(existingItem);
      mementos = ImmutableList.of(memento);
    }
    // paste
    {
      IMenuPolicy policy = MenuObjectInfoUtils.getMenuInfo(bar).getPolicy();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.