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);
}
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;
}
}
}
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("&", "&"));
}
}
};
t.scheduleRepeating(250);
}
Aggregations