Search in sources :

Example 1 with GwtTree

use of org.pentaho.ui.xul.gwt.tags.GwtTree in project pentaho-platform by pentaho.

the class MantleXul method enableUsersRolesTreeItem.

public void enableUsersRolesTreeItem(final boolean enabled) {
    Timer t = new Timer() {

        public void run() {
            if (container != null) {
                cancel();
                String usersRolesLabel = Messages.getString("users") + "/" + Messages.getString("roles");
                GwtTree adminCatTree = (GwtTree) container.getDocumentRoot().getElementById("adminCatTree");
                TreeItem usersRolesTreeItem = null;
                Tree adminTree = adminCatTree.getTree();
                Iterator<TreeItem> adminTreeItr = adminTree.treeItemIterator();
                while (adminTreeItr.hasNext()) {
                    usersRolesTreeItem = adminTreeItr.next();
                    if (usersRolesTreeItem.getText().equals(usersRolesLabel)) {
                        usersRolesTreeItem.setVisible(enabled);
                        break;
                    }
                }
            }
        }
    };
    t.scheduleRepeating(250);
}
Also used : Timer(com.google.gwt.user.client.Timer) TreeItem(com.google.gwt.user.client.ui.TreeItem) GwtTree(org.pentaho.ui.xul.gwt.tags.GwtTree) Tree(com.google.gwt.user.client.ui.Tree) GwtTree(org.pentaho.ui.xul.gwt.tags.GwtTree)

Example 2 with GwtTree

use of org.pentaho.ui.xul.gwt.tags.GwtTree in project pentaho-platform by pentaho.

the class MantleXul method selectAdminCatTreeTreeItem.

public void selectAdminCatTreeTreeItem(final String treeLabel) {
    GwtTree adminCatTree = (GwtTree) container.getDocumentRoot().getElementById("adminCatTree");
    Tree adminTree = adminCatTree.getTree();
    adminTree.setSelectedItem(null, true);
    Iterator<TreeItem> adminTreeItr = adminTree.treeItemIterator();
    while (adminTreeItr.hasNext()) {
        TreeItem treeItem = adminTreeItr.next();
        if (treeItem.getText().equals(treeLabel)) {
            adminTree.setSelectedItem(treeItem, true);
            break;
        }
    }
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) GwtTree(org.pentaho.ui.xul.gwt.tags.GwtTree) Tree(com.google.gwt.user.client.ui.Tree) GwtTree(org.pentaho.ui.xul.gwt.tags.GwtTree)

Example 3 with GwtTree

use of org.pentaho.ui.xul.gwt.tags.GwtTree in project pentaho-platform by pentaho.

the class MantleXul method customizeAdminStyle.

public void customizeAdminStyle() {
    Timer t = new Timer() {

        public void run() {
            if (container != null) {
                cancel();
                // call this method when Elements are added to DOM
                GwtTree adminCatTree = (GwtTree) container.getDocumentRoot().getElementById("adminCatTree");
                adminCatTree.getTree().removeStyleName("gwt-Tree");
                Panel adminContentPanel = (Panel) container.getDocumentRoot().getElementById("adminContentPanel").getManagedObject();
                adminContentPanel.setWidth("100%");
                for (int i = 0; i < adminCatTree.getTree().getItemCount(); i++) {
                    TreeItem treeItem = adminCatTree.getTree().getItem(i);
                    Element e = treeItem.getElement();
                    e.getStyle().clearPadding();
                    e.addClassName("adminCatTreeItem");
                    if (i == adminCatTree.getTree().getItemCount() - 1) {
                        e.addClassName("adminCatTreeItemLast");
                    }
                }
                MantleXul.this.selectAdminCatTreeTreeItem(Messages.getString("manageUsersAndRoles").replaceAll("&amp;", "&"));
            }
        }
    };
    t.scheduleRepeating(250);
}
Also used : IFrameTabPanel(org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel) Panel(com.google.gwt.user.client.ui.Panel) SimplePanel(com.google.gwt.user.client.ui.SimplePanel) DeckPanel(com.google.gwt.user.client.ui.DeckPanel) Timer(com.google.gwt.user.client.Timer) TreeItem(com.google.gwt.user.client.ui.TreeItem) GwtTree(org.pentaho.ui.xul.gwt.tags.GwtTree) Element(com.google.gwt.user.client.Element)

Aggregations

TreeItem (com.google.gwt.user.client.ui.TreeItem)3 GwtTree (org.pentaho.ui.xul.gwt.tags.GwtTree)3 Timer (com.google.gwt.user.client.Timer)2 Tree (com.google.gwt.user.client.ui.Tree)2 Element (com.google.gwt.user.client.Element)1 DeckPanel (com.google.gwt.user.client.ui.DeckPanel)1 Panel (com.google.gwt.user.client.ui.Panel)1 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)1 IFrameTabPanel (org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel)1