Examples of Widget


Examples of org.beryl.gui.Widget

  private void doDelete(TreeItem item) throws GUIException {
    TreeItem parent = (TreeItem) item.getParent();
    WidgetUserObject object = (WidgetUserObject) item.getUserObject();
    object.element.getParentNode().removeChild(object.element);
    Widget parentWidget = object.widget.getParentWidget();

    if (object.widget.getParentWidget() != null) {
      object.widget.getParentWidget().removeChildWidget(object.widget);
      revalidate(parentWidget);
    } else {
View Full Code Here

Examples of org.beryl.gui.Widget

  /**
   * Removes and then re-inserts all children of the given widget's parent
   */
  public static void doReInsert(WidgetUserObject object) throws GUIException {
    ArrayList temp = new ArrayList(), tempAnchors = new ArrayList();
    Widget parentWidget = object.widget.getParentWidget();
    TreeItem parentNode = (TreeItem) object.treeNode.getParentWidget();

    for (int i=0, count=parentNode.getChildCount(); i<count; i++) {
      TreeItem node = (TreeItem) parentNode.getChild(i);
      WidgetUserObject nodeObj = (WidgetUserObject) node.getUserObject();
      temp.add(nodeObj.widget);
      tempAnchors.add(XMLUtils.getChild(nodeObj.element, "anchor"));
      parentWidget.removeChildWidget(nodeObj.widget);
    }
    for (int i=0; i<temp.size(); i++) {
      Object anchor = createAnchor((Widget) temp.get(i), (Element) tempAnchors.get(i));
      parentWidget.addChild((Widget) temp.get(i), anchor);
    }
    revalidate(parentWidget);
  }
View Full Code Here

Examples of org.beryl.gui.Widget

      parentTreeItem.addChild((Widget) temp.get(i), null);
    temp.clear();


    /* Update widget */   
    Widget parentWidget = object.widget.getParentWidget();
    int widgetIndex = parentWidget.getChildIndex(object.widget);
    if (widgetIndex == -1)
      throw new GUIException("Widget not found");
    for (int i=0, count=parentWidget.getChildCount(); i<count; i++) {
      Widget widget = (Widget) parentWidget.getChild(0);
      if (widget != object.widget)
        temp.add(widget);
      parentWidget.removeChildWidget(widget);
    }
    temp.add(widgetIndex + (up ? -1 : 1), object.widget);
View Full Code Here

Examples of org.beryl.gui.Widget

    for (int i = 0; i < object.treeNode.getChildCount(); i++) {
      TreeItem item = (TreeItem) object.treeNode.getChild(i);
      WidgetUserObject childObject = (WidgetUserObject) item.getUserObject();
      Element anchorNode = XMLUtils.getChild(childObject.element, "anchor");

      Widget childWidget = childObject.widget;
      object.widget.removeChildWidget(childWidget);
      object.widget.addChild(childWidget, WidgetTree.createAnchor(object.widget, anchorNode));
    }

    object.widget.revalidate();
View Full Code Here

Examples of org.beryl.gui.Widget

  private TableEditor colorEditor = null;

  public ColorAdapter() {
    colorEditor = new ButtonEditor("edit", this) {
      public Widget getEditor(Table table, Object value, TableRow row, String key) throws GUIException {
        Widget widget = super.getEditor(table, value, row, key);
        MapDataModel dataModel = widget.getDataModel();
        dataModel.setValue("frame", table.getParentWidgetByClass(Frame.class));
        return widget;
      }
     
    };
View Full Code Here

Examples of org.beryl.gui.Widget

  private TableEditor anchorEditor = null;

  public AnchorAdapter() {
    anchorEditor = new ButtonEditor("edit", this) {
      public Widget getEditor(Table table, Object value, TableRow row, String key) throws GUIException {
        Widget widget = super.getEditor(table, value, row, key);
        MapDataModel dataModel = widget.getDataModel();
        dataModel.setValue("row", row);
        dataModel.setValue("frame", table.getParentWidgetByClass(Frame.class));
        return widget;
      }
    };
View Full Code Here

Examples of org.beryl.gui.Widget

      new MessageDialog(e);
    }
  }

  private void loadCustomComponent(String layoutName, String name, Validator validator) throws GUIException {
    Widget widget = WidgetFactory.getInstance().constructWidget(getClass(), name, this, dataModel, group);
    if (validator != null) {
      ((LabeledWidget) widget).getDataWidget().addValidator(validator);
    }

    ArrayList components = (ArrayList) customComponents.get(layoutName);
View Full Code Here

Examples of org.beryl.gui.Widget

      }
    }

    try {
      for (int i = 0; i < activeComponents.size(); i++) {
        Widget widget = (Widget) activeComponents.get(i);

        widget.recursiveValidate();
      }
      okButton.setEnabled(true);
    } catch (ValidationException ex) {
      okButton.setEnabled(false);
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Widget

    TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);

    /* For each selected Element */
    Object[] selectedElements = selection.toArray();
    for (Object selectedElement : selectedElements) {
      Widget widget = findItem(selectedElement);
      if (widget instanceof TreeItem) {
        TreeItem item = (TreeItem) widget;
        TreeItemAdapter parent = new TreeItemAdapter(item).getParent();

        int index = parent.indexOf(item);
View Full Code Here

Examples of org.eclipse.swt.widgets.Widget

  void setSelection(Event e) {
    if (e == null)
      return;

    Widget w = e.widget;
    if (w.isDisposed())
      return;

    SelectionEvent selEvent = new SelectionEvent(e);

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