Package com.tensegrity.palo.gwt.core.client.models

Examples of com.tensegrity.palo.gwt.core.client.models.XObject


      public void componentSelected(ComponentEvent ce) {
        final TreeItem ti = ReportStructureEditor.view.getTree().getSelectedItem();
        if (ti == null) {
          return;
        }
        XObject remObj = ((TreeNode) ti.getModel()).getXObject();
        if (!(remObj instanceof XReportFolder)) {
          return;
        }
               
        List <TreeItem> items = reportsTree.getSelectedItems();
        if (items == null || items.size() == 0) {
          return;
        }
       
        List <XObject> objs = new ArrayList <XObject> ();
        for (TreeItem it: items) {
          XObject obj = ((TreeNode) it.getModel()).getXObject();
          if (obj == null) {
            continue;
          }
          if (!(obj instanceof XTemplate) &&
            !(obj instanceof XWorkbook) &&
View Full Code Here


      public void componentSelected(ComponentEvent ce) {
        final TreeItem item = reportsTree.getSelectedItem();
        if (item == null) {
          return;
        }
        final XObject parent = ((TreeNode) item.getModel()).getXObject();
        RequestNameDialog rnd = new RequestNameDialog(
            "Create new static folder",
            "Name",
            new ResultListener<String>(){
              public void requestCancelled() {               
              }

              public void requestFinished(String result) {
                WPaloServiceProvider.getInstance().
                  createStaticFolder(result, parent, user, new Callback<XStaticReportFolder>(){
                    public void onSuccess(XStaticReportFolder folder) {
                      if (folder == null) {
                        return;
                      }
                      treeLoader.loadChildren((TreeNode) item.getModel());
                    }});
              }
            });
        rnd.show();
      }
    });
    toolbar.add(addStaticFolder);
    TextToolItem addDynamicFolder = new TextToolItem("", "icon-create-dynamic-folder");
    addDynamicFolder.setToolTip("Create a new dynamic folder");
    addDynamicFolder.addSelectionListener(new SelectionListener<ComponentEvent>(){
      public void componentSelected(ComponentEvent ce) {
        final TreeItem item = reportsTree.getSelectedItem();
        if (item == null) {
          return;
        }
        final XObject parent = ((TreeNode) item.getModel()).getXObject();
        RequestNameDialog rnd = new RequestNameDialog(
            "Create new dynamic folder",
            "Name",
            new ResultListener<String>(){
              public void requestCancelled() {               
View Full Code Here

  public void componentSelected(ComponentEvent ce) {
    final TreeItem item = reportsTree.getSelectedItem();
    if (item == null) {
      return;
    }
    final XObject parent = ((TreeNode) item.getModel()).getXObject();
    if (parent == null) {
      return;
    }
    String title = "";
    if (parent instanceof XApplication) {
View Full Code Here

      public void componentSelected(ComponentEvent ce) {
        final TreeItem ti = ReportStructureEditor.view.getTree().getSelectedItem();
        if (ti == null) {
          return;
        }
        final XObject remObj = ((TreeNode) ti.getModel()).getXObject();
        if (!(remObj instanceof XDynamicReportFolder)) {
          return;
        }
               
        TreeItem item = listTree.getSelectedItem();
        if (item == null) {
          return;
        }
       
        final XObject obj = ((TreeNode) item.getModel()).getXObject();
        if (obj == null) {
          return;
        }
        if (!(obj instanceof XDimension) &&
          !(obj instanceof XSubset) &&
View Full Code Here

            ((Workbench) Registry.get(Workbench.ID)).showWaitCursor(constants.displayingElementTree(), true);
            try {
              final SelectElementDialog menu = new SelectElementDialog(view, xAxisHierarchy, state);
              menu.addSelectionListener(new Listener<SelectionEvent>() {
                public void handleEvent(SelectionEvent se) {
                  XObject selection = se.getSelection();
                  XElement selectedElement = null;
                  if (selection instanceof XElement) {
                    selectedElement = (XElement) selection;
                  } else if(selection instanceof XElementNode) {
                    XElementNode node = (XElementNode) selection;
View Full Code Here

      super(tree, store);
    }

    protected TreeItem createItem(TreeNode model) {
      TreeItem item = super.createItem(model)
      XObject xObj = model.getXObject();
      //check type:
      String type = xObj.getType();
      if (type.equals(XUser.TYPE)) {
        if ("admin".equals(((XUser) xObj).getLogin())) {
          item.setTextStyle("italic");
        }
      } else if (type.equals(XGroup.TYPE)) {
View Full Code Here

    super(tree, store);
  }

  protected TreeItem createItem(TreeNode model) {
    TreeItem item = super.createItem(model)
    XObject xObj = model.getXObject();
    //check type:
    String name = xObj.getName();
    if(name == null || name.equals(""))
      item.setText(constants.notDefined());
    //set icon:
    String type = xObj.getType();
    if(type.equals(XAccount.TYPE)) {
      XAccount xAcc = (XAccount) xObj;
      item.setText(xAcc.getUser().getLogin()+" - "+xAcc.getConnection().getName());
      item.setIconStyle("icon-account");
    }
View Full Code Here

//                  ((Workbench) Registry.get(Workbench.ID)).hideWaitCursor();
                  tree.loaded(le);
                  return false;
                }
                TreeNode tn = kids.get(index);
                XObject xObj = tn.getXObject();

                String name;
                String image = "";
                if (xObj instanceof XElementNode) {
                  int count = ((XElementNode) xObj)
                      .getChildCount();
                  image = "<img paddingTop=\"2px\" width=\"16\" height=\"14\" src=\"icons/element_";
                  XElementType xElemType =     
                    ((XElementNode) xObj).getElement().getElementType();
                  if (XElementType.CONSOLIDATED.equals(xElemType)) {
                    image += "con2.png\">&nbsp;";
                  } else if (XElementType.NUMERIC.equals(xElemType)) {
                    image += "num2.png\">&nbsp;";
                  } else if (XElementType.STRING.equals(xElemType)) {
                    image += "str2.png\">&nbsp;";
                  } else {
                    image = "";
                  }
                  name = count == 0 ? xObj.getName() : xObj
                      .getName()
                      + " <i><font color=\"gray\">("
                      + count + ")</i></font>";
                } else {
                  name = xObj.getName();
                }

                SelectingFastMSTreeItem item = new SelectingFastMSTreeItem(image + name, tree);
               
                if (tn.hasChildren()) {
View Full Code Here

        });
      }
      break;
    case WPaloEvent.DELETED_ITEM:
      if (event.data instanceof TreeNode) {
        XObject target = ((TreeNode) event.data).getXObject();
        if (target != null && target instanceof XUser) {
          HashSet <String> allIds = new HashSet<String>();
          for (String accountId: ((XUser) target).getAccountIDs()) {
            allIds.add(accountId);
          }
View Full Code Here

        final TreeNode node = (TreeNode) item.getModel();
        if(node == null)
          return;
       
        String confirmMsg = constants.deleteMessageHeader();
        XObject xObj = node.getXObject();
        String type = xObj.getType();
        if (type.equals(XAccount.class.getName())) {
          XAccount acc = (XAccount) xObj;
          XUser usr = acc.getUser();
          String name;
          if (usr != null && usr.getName() != null && !usr.getName().isEmpty()) {
View Full Code Here

TOP

Related Classes of com.tensegrity.palo.gwt.core.client.models.XObject

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.