Package com.tensegrity.wpalo.client.serialization

Examples of com.tensegrity.wpalo.client.serialization.XObjectWrapper


      return (TreeNode) root.getItem(0).getModel();
    return null;
  }

  private final void createFolder(String name, final TreeNode parent) {
    XObjectWrapper wrappedXObj = (XObjectWrapper) parent.getXObject();
    XStaticFolder parentFolder = (XStaticFolder) wrappedXObj.getXObject();
    String sessionId = ((Workbench)Registry.get(Workbench.ID)).getUser().getSessionId();
    WPaloFolderServiceProvider.getInstance().createFolder(sessionId, name,
        parentFolder,
        new Callback<XStaticFolder>(constants.couldNotAddFolder()) {
          public void onSuccess(XStaticFolder folder) {
View Full Code Here


    reloadTree();
  }

  private final TreeNode createRootNode(XAccount xAccount) {
    //we have to adjust XObject type so that it gets loaded by corresponding child loader:
    XObjectWrapper wrappedAccount = new XObjectWrapper(xAccount);
    wrappedAccount.setType(ViewImportDialog.XOBJECT_TYPE);
    TreeNode root = new TreeNode(null, wrappedAccount);
    return root;
   
  }
View Full Code Here

    initComponent();
    this.doImport = doImport;
  }

  protected TreeItem createItem(TreeNode model) {
    XObjectWrapper wrappedXObject = (XObjectWrapper) model.getXObject();
    XObject xObj = wrappedXObject.getXObject();
    boolean isLeaf = doImport ?
        (xObj instanceof XView) : (xObj instanceof XCube);

    TreeItem item = new ViewTreeItem();
    item.setLeaf(isLeaf);
View Full Code Here

 
  public void setInputQuietly(Object input) {
  }

  private final XView getWrappedViewFrom(TreeNode node) {
    XObjectWrapper wrapper = (XObjectWrapper) node.getXObject();
    XFolderElement xFolderElement = (XFolderElement) wrapper.getXObject();
    XObject xObj = xFolderElement.getSourceObject();
    if (xObj instanceof XView)
      return (XView) xObj;
    return null;
  }
View Full Code Here

//    System.arraycopy(elements.toArray(new XObjectWrapper[0]), 0, xChildren, folders.size(), elements.size());   
    return xChildren;
  }
 
  private final XObjectWrapper wrap(XObject xObj) {
    XObjectWrapper wrapped= new XObjectWrapper(xObj);
    wrapped.setType(ViewBrowserModel.TYPE);
    wrapped.setHasChildren(xObj.hasChildren());
    return wrapped;
  }
View Full Code Here

    this.store = store;
    initialize();
  }

  final XObject getWrappedXObject(TreeNode node) {
    XObjectWrapper wrappedXObj = (XObjectWrapper)node.getXObject();
    return wrappedXObj.getXObject();
  }
View Full Code Here

    this.invisibleRoot = root;
    reload();
  }
 
  private final XObjectWrapper wrap(XObject xObj) {
    XObjectWrapper wrapped= new XObjectWrapper(xObj);
    wrapped.setType(TYPE);
    wrapped.setHasChildren(xObj.hasChildren());
    return wrapped;
  }
View Full Code Here

        List<XObject> views = new ArrayList<XObject>();
        addDefaultViewFor(cube, xCube.getAccountId(), views, user, userSession);
        for(String viewId : viewIds) {
          String viewName = cube.getCubeViewName(viewId);
          XView view = createXView(viewId, viewName, cube, xCube.getAccountId(), user);
          XObjectWrapper wrappedCandidate = wrap(view);
          wrappedCandidate.setHasChildren(false);
          views.add(wrappedCandidate);
       
        return views.toArray(new XObject[0]);
      }
      return new XObject[0];
View Full Code Here

  private final void addDefaultViewFor(Cube cube, String accountId,
      List<XObject> toViews, AuthUser user, UserSession session) {
    String viewId = null;
    String viewName = cube.getName() + session.translate("defaultView");
    XView view = createXView(viewId, viewName, cube, accountId, user);
    XObjectWrapper wrappedCandidate = wrap(view);
    wrappedCandidate.setHasChildren(false);
    toViews.add(wrappedCandidate);
  }
View Full Code Here

      if(account.getId().equals(id))
        return account;
    return null;
  }
  private final XObjectWrapper wrap(XObject xObj) {
    XObjectWrapper wrapped= new XObjectWrapper(xObj);
    wrapped.setType(ViewImportDialog.XOBJECT_TYPE);
    wrapped.setHasChildren(true);
    return wrapped;
  }
View Full Code Here

TOP

Related Classes of com.tensegrity.wpalo.client.serialization.XObjectWrapper

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.