本文整理汇总了Java中com.google.gwt.user.client.ui.Tree.addItem方法的典型用法代码示例。如果您正苦于以下问题:Java Tree.addItem方法的具体用法?Java Tree.addItem怎么用?Java Tree.addItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Tree
的用法示例。
在下文中一共展示了Tree.addItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Mailboxes
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Constructs a new mailboxes widget.
*/
public Mailboxes() {
Images images = GWT.create(Images.class);
tree = new Tree(images);
TreeItem root = new TreeItem(
imageItemHTML(images.home(), "[email protected]"));
tree.addItem(root);
addImageItem(root, "Inbox", images.inbox());
addImageItem(root, "Drafts", images.drafts());
addImageItem(root, "Templates", images.templates());
addImageItem(root, "Sent", images.sent());
addImageItem(root, "Trash", images.trash());
root.setState(true);
initWidget(tree);
}
示例2: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例3: ExpressionView
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Instantiates a new expression view.
*/
public ExpressionView()
{
super();
setSpacing(5);
Button btnRefresh = new Button("Refresh");
btnRefresh.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
refreshButtonPressed();
}
});
add(btnRefresh);
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setSpacing(10);
add(horizontalPanel);
horizontalPanel.setSize("517px", "279px");
Tree tree = new Tree();
tree.addSelectionHandler(this);
horizontalPanel.add(tree);
trtmByPerson = new TreeItem(SafeHtmlUtils.fromString("By Person"));
tree.addItem(trtmByPerson);
trtmByTable = new TreeItem(SafeHtmlUtils.fromString("By Table"));
tree.addItem(trtmByTable);
trtmByTarget = new TreeItem(SafeHtmlUtils.fromString("By Target"));
tree.addItem(trtmByTarget);
verticalPanel = new VerticalPanel();
horizontalPanel.add(verticalPanel);
}
示例4: createTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
private Tree createTree() {
Tree tree = new Tree();
/*TreeItem widgets =*/ tree.addItem("Widgets");
/*TreeItem lists =*/ tree.addItem("Lists and Menus");
TreeItem popups = tree.addItem("Popups");
popups.addItem(createTreeItem("Message Box", new CwMessageBox()));
/*TreeItem tables =*/ tree.addItem("Tables");
return tree;
}
示例5: setTreeOfChanges
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void setTreeOfChanges(final RefactoringPreview changes) {
showDiffPanel(false);
final SelectionModel<RefactoringPreview> selectionModel = new SingleSelectionModel<>();
selectionModel.addSelectionChangeHandler(
event -> {
RefactoringPreview selectedNode =
(RefactoringPreview) ((SingleSelectionModel) selectionModel).getSelectedObject();
delegate.onSelectionChanged(selectedNode);
});
Tree tree = new Tree();
tree.getElement().setId("tree-of-changes");
for (RefactoringPreview parentChange : changes.getChildrens()) {
TreeItem treeItem = new TreeItem();
containerChanges.put(treeItem, parentChange);
createTreeElement(treeItem, parentChange.getText(), parentChange.getChildrens());
tree.addItem(treeItem);
}
tree.addSelectionHandler(
event -> {
if (selectedElement != null) {
selectedElement.getStyle().setProperty("background", "transparent");
}
selectedElement = event.getSelectedItem().getWidget().getElement();
selectedElement.getStyle().setProperty("background", getEditorSelectionColor());
});
treePanel.add(tree);
}
示例6: addItem
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
private TreeItem addItem(Tree tree, ScreenMenuItem widget) {
TreeItem childItem = new TreeItem();
childItem.setWidget(widget);
tree.addItem(childItem);
widget.addClickListener(this);
return(childItem);
}
示例7: addItem
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
private TreeItem addItem(Tree tree, ScreenMenuItem widget) {
TreeItem childItem = new TreeItem();
childItem.setWidget(widget);
tree.addItem(childItem);
widget.addClickListener(this);
return(childItem);
}
示例8: Mailboxes
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Constructs a new mailboxes widget with a bundle of images.
*/
public Mailboxes() {
tree = new Tree(images);
TreeItem root = new TreeItem(imageItemHTML(images.home(),
"[email protected]"));
tree.addItem(root);
this.root = root;
root.setState(true);
initWidget(tree);
}
示例9: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Enables or disables move button ( evalues security to move to folder with permissions )
if (rootItem.equals(item)) {
Main.get().categoriesPopup.enable(false);
} else {
Main.get().categoriesPopup.enable(true);
}
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例10: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Enables or disables move button ( evalues security to move to folder with permissions )
if (rootItem.equals(item)) {
Main.get().wizardPopup.categoriesWidget.enable(false);
} else {
Main.get().wizardPopup.categoriesWidget.enable(true);
}
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例11: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
// Enables or disables move button ( evalues security to move to folder with permissions )
if (rootItem.equals(actualItem)) {
Main.get().mainPanel.desktop.navigator.thesaurusTree.thesaurusSelectPopup.enable(false);
} else {
Main.get().mainPanel.desktop.navigator.thesaurusTree.thesaurusSelectPopup.enable(true);
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例12: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Enables or disables move button ( evalues security to move to folder with permissions )
if (rootItem.equals(item)) {
Main.get().mainPanel.desktop.navigator.categoriesTree.categoriesSelectPopup.enable(false);
} else {
Main.get().mainPanel.desktop.navigator.categoriesTree.categoriesSelectPopup.enable(true);
}
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例13: FolderSelectTree
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
* Folder Tree
*/
public FolderSelectTree() {
tree = new Tree();
rootItem.setStyleName("okm-TreeItem");
rootItem.setUserObject(new GWTFolder());
rootItem.setSelected(true);
rootItem.setState(true);
tree.setStyleName("okm-Tree");
tree.addItem(rootItem);
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
boolean refresh = true;
TreeItem item = event.getSelectedItem();
// Enables or disables move button ( evalues security to move to folder with permissions )
evaluateSecurityToAction(item);
// Case that not refreshing tree and file browser ( right click )
if (actualItem.equals(item)) {
refresh = false;
} else {
// Disables actual item because on changing active node by
// application this it's not changed automatically
if (!actualItem.equals(item)) {
actualItem.setSelected(false);
actualItem = item;
} else {
refresh = false;
}
}
if (refresh) {
refresh(true);
}
}
});
actualItem = tree.getItem(0);
initWidget(tree);
}
示例14: AggregateUI
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/***********************************
***** INITIALIZATION ******
***********************************/
private AggregateUI() {
/*
* CRITICAL NOTE: Do not do **anything** in this constructor that might
* cause something underneath to call AggregateUI.get()
*
* The singleton is not yet assigned!!!
*/
singleton = null;
timer = new RefreshTimer(this);
// define the not-secure message info...
notSecureMsgLabel = new Label();
notSecureMsgLabel.setStyleName("not_secure_message");
notSecurePanel = new FlowPanel();
notSecurePanel.add(notSecureMsgLabel);
notSecurePanel.setVisible(false);
// define the error message info...
errorMsgLabel = new Label();
errorMsgLabel.setStyleName("error_message");
// put the not-secure and error messages in an error panel
errorPanel = new FlowPanel();
errorPanel.add(errorMsgLabel);
errorPanel.setVisible(false);
// create tab datastructures
tabMap = new HashMap<Tabs, AggregateTabBase>();
tabPosition = new ArrayList<Tabs>();
wrappingLayoutPanel = new FlowPanel(); // vertical
wrappingLayoutPanel.setStylePrimaryName(UIConsts.VERTICAL_FLOW_PANEL_STYLENAME);
layoutPanel = new HorizontalPanel();
mainNav = new DecoratedTabPanel();
mainNav.getElement().setId("mainNav");
mainNav.addSelectionHandler(new RefreshSelectionHandler<Integer>());
// add to layout
layoutPanel.add(mainNav);
layoutPanel.getElement().setId("layout_panel");
wrappingLayoutPanel.add(layoutPanel);
helpPanel = new ScrollPanel();
// Create help panel
Tree helpTree = new Tree();
rootItem = new TreeItem();
helpTree.addItem(rootItem);
helpTree.addOpenHandler(new RefreshOpenHandler<TreeItem>());
helpTree.addCloseHandler(new RefreshCloseHandler<TreeItem>());
helpTree.getElement().setId("help_tree");
helpPanel.add(helpTree);
helpPanel.getElement().setId("help_panel");
helpPanel.setVisible(false);
wrappingLayoutPanel.add(helpPanel);
settingsBar = new NavLinkBar();
RootPanel.get("not_secure_content").add(notSecurePanel);
RootPanel.get("error_content").add(errorPanel);
RootPanel.get("dynamic_content").add(
new HTML("<img src=\"images/odk_color.png\" id=\"odk_aggregate_logo\" class=\"gwt-Image\" />"));
RootPanel.get("dynamic_content").add(settingsBar);
RootPanel.get("dynamic_content").add(wrappingLayoutPanel);
}
示例15: initMenu
import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
private void initMenu(Tree menu) {
//EmployeeAdmin
String d1 = "The GWT PureMvc example (as shown <a href=\"http://employeeadm.appspot.com/\" target=\"blank\">here</a>) but implemented with the Mvp4g framework.";
menu.addItem(new MenuItem(d1,
"mvp4gexea",
"EmployeeAdmin",
"EmployeeAdminEventBus",
false));
//EmployeeAdmin with GXT
String d2 = "Same example as EmployeeAdmin but implemented with GXT using different approaches (<a href=\"http://groups.google.com/group/mvp4g/browse_thread/thread/5ba8664afbbda1f7\" target=\"blank\">see Mvp4g and GXT post</a>).";
menu.addItem(new MenuItem(d2,
"mvp4gexeagxt",
"EmployeeAdminWithGXT",
"EmployeeAdminWithGXTEventBus",
false));
//Mvp4gHistory
String d3 = "This example shows how history is managed thanks to a Place Service. (<a href=\"http://code.google.com/p/mvp4g/wiki/PlaceService\" target=\"blank\">see the wiki page for more information</a>).<br/>"
+ "<img src=\"beware.gif\" height=15 width=15/> You need to open this application <a href=\"http://mvp4ghistory.appspot.com\" target=\"blank\">mvp4gexhi.appspot.com</a> in a new window in order to see url modifications.";
menu.addItem(new MenuItem(d3,
"mvp4gexhi",
"Mvp4gHistory",
"MyEventBus",
false));
String d4 = "This example demonstrates how you can divide your application into modules and take advantage of GWT Code splitting feature (<a href=\"http://code.google.com/p/mvp4g/wiki/MultiModules\" target=\"blank\">see the wiki page for more information</a>)<br/>"
+ "It also illustrates all the features available with Mvp4g.<br/>"
+ "<img src=\"beware.gif\" height=15 width=15/> You need to open this application <a href=\"http://mvp4gmodules.appspot.com\" target=\"blank\">mvp4gexmo.appspot.com</a> in a new window in order to see url modifications.";
menu.addItem(new MenuItem(d4,
"mvp4gexmo",
"Mvp4gModules",
"main/MainEventBus",
false));
String d5 = "This example shows the GWT Mail example converted with Mvp4g. It illustrates how Mvp4g can be used with UiBinder.";
menu.addItem(new MenuItem(d5,
"mvp4gexma",
"MailWithMvp4g",
"MailEventBus",
false));
}