Java Code Examples for com.google.gwt.event.logical.shared.SelectionHandler

The following examples show how to use com.google.gwt.event.logical.shared.SelectionHandler. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: EasyML   Source File: BaseTree.java    License: Apache License 2.0 6 votes vote down vote up
public BaseTree() {
	super(new TreeImageResources(), true);

	this.addStyleName("bda-treedir");

	this.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			TreeItem item = event.getSelectedItem();
			Boolean state = item.getState();
			// [GWT Issue 3660] to avoid pass invoke onSection two times
			TreeItem parent = item.getParentItem();
			item.getTree().setSelectedItem(parent, false);
			if (parent != null)
				parent.setSelected(false);
			item.setState(!state);
		}
	});
}
 
Example 2
Source Project: gwt-material   Source File: MaterialNavSectionTest.java    License: Apache License 2.0 6 votes vote down vote up
public void testSelectionEvent() {
    MaterialNavSection widget = new MaterialNavSection();

    final boolean[] isSelectionEventFired = {false};
    widget.addSelectionHandler(selectionEvent -> isSelectionEventFired[0] = true);
    widget.fireEvent(new GwtEvent<SelectionHandler<?>>() {
        @Override
        public Type<SelectionHandler<?>> getAssociatedType() {
            return SelectionEvent.getType();
        }

        @Override
        protected void dispatch(SelectionHandler eventHandler) {
            eventHandler.onSelection(null);
        }
    });

    assertTrue(isSelectionEventFired[0]);
}
 
Example 3
Source Project: geowe-core   Source File: CopyElementDialog.java    License: GNU General Public License v3.0 6 votes vote down vote up
private ComboBox<VectorLayerInfo> initLayerCombo1() {
					
	VectorLayerProperties properties = GWT
			.create(VectorLayerProperties.class);

	layerStore1 = new ListStore<VectorLayerInfo>(properties.key());

	layerCombo1 = new ComboBox<VectorLayerInfo>(layerStore1,
			properties.name());
	layerCombo1.setEmptyText((UIMessages.INSTANCE.sbLayerComboEmptyText()));
	layerCombo1.setTypeAhead(true);
	layerCombo1.setTriggerAction(TriggerAction.ALL);
	layerCombo1.setForceSelection(true);
	layerCombo1.setEditable(false);
	layerCombo1.enableEvents();
	layerCombo1.setWidth(width);

	layerCombo1.addSelectionHandler(new SelectionHandler<VectorLayerInfo>() {
		@Override
		public void onSelection(SelectionEvent<VectorLayerInfo> event) {
			layerCombo1.setValue(event.getSelectedItem(), true);
		}
	});

	return layerCombo1;
}
 
Example 4
private SelectionHandler<Widget> getTabPanelSelectionHandler() {
	return new SelectionHandler<Widget>() {

		@Override
		public void onSelection(SelectionEvent<Widget> event) {
			if (UIMessages.INSTANCE.empty().equals(getActiveTab())) {
				dataFormatField.setVisible(false);
			} else {
				dataFormatField.setVisible(true);
			}
			if (UIMessages.INSTANCE.wfs().equals(getActiveTab())) {
				vectorFormatCombo.setValue(VectorFormat.GML_FORMAT);
			} else {
				vectorFormatCombo.setValue(null);
			}
			
			if (UIMessages.INSTANCE.gitHubResponseTitle().equals(getActiveTab())) {					
				layerName.setEnabled(false);
			} else {
				layerName.setEnabled(true);
			}
		}
	};
}
 
Example 5
Source Project: gwt-material-addins   Source File: MaterialPopupMenuTest.java    License: Apache License 2.0 6 votes vote down vote up
protected void checkSelectionHandler(MaterialPopupMenu popupMenu) {
    final boolean[] isSelectionFired = {false};
    popupMenu.setEnabled(true);
    popupMenu.addSelectionHandler(selectionEvent -> isSelectionFired[0] = true);
    popupMenu.fireEvent(new GwtEvent<SelectionHandler<?>>() {
        @Override
        public Type<SelectionHandler<?>> getAssociatedType() {
            return SelectionEvent.getType();
        }

        @Override
        protected void dispatch(SelectionHandler<?> eventHandler) {
            eventHandler.onSelection(null);
        }
    });
    assertTrue(isSelectionFired[0]);
}
 
Example 6
Source Project: swellrt   Source File: EditorHarness.java    License: Apache License 2.0 6 votes vote down vote up
void initContentOracle() {
  contentOracle = new MultiWordSuggestOracle();

  contentSuggestBox = new SuggestBox(contentOracle);
  contentSuggestBox.getElement().setId("content-box");

  // Some initial content xml strings
  contentOracle.add("");
  contentOracle.add("abcd");

  contentSuggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
    @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
      setFromContentBox();
    }
  });

  String[] extra = extendSampleContent();
  if (extra != null) {
    for (String content : extra) {
      contentOracle.add(content);
    }
  }
}
 
Example 7
Source Project: incubator-retired-wave   Source File: EditorHarness.java    License: Apache License 2.0 6 votes vote down vote up
void initContentOracle() {
  contentOracle = new MultiWordSuggestOracle();

  contentSuggestBox = new SuggestBox(contentOracle);
  contentSuggestBox.getElement().setId("content-box");

  // Some initial content xml strings
  contentOracle.add("");
  contentOracle.add("abcd");

  contentSuggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
    @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
      setFromContentBox();
    }
  });

  String[] extra = extendSampleContent();
  if (extra != null) {
    for (String content : extra) {
      contentOracle.add(content);
    }
  }
}
 
Example 8
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 9
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 10
Source Project: sc2gears   Source File: Menu.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new Menu.
 */
public Menu( final MenuItem[] menuItems, final Panel pageContainer ) {
	this.menuItems     = menuItems;
	this.pageContainer = pageContainer;
	
	for ( final MenuItem mi : menuItems )
		addTab( mi.getLabel() );
	
	addSelectionHandler( new SelectionHandler< Integer >() {
		@Override
		public void onSelection( final SelectionEvent< Integer > event ) {
			menuItems[ event.getSelectedItem() ].onActivate( Menu.this );
		}
	} );
}
 
Example 11
Source Project: geowe-core   Source File: GeoprocessDialog.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void createComboLayer(final ComboBox<VectorLayerInfo> combo,
		final String numCombo, final TextButton validateButton) {
	clearLayerComboBox(combo);
	combo.setTypeAhead(true);
	combo.setTriggerAction(TriggerAction.ALL);
	combo.setForceSelection(true);
	combo.setEditable(false);
	combo.enableEvents();
	combo.setWidth(WIDTH_COMBO_LAYER);
	combo.setId(numCombo);

	combo.addSelectionHandler(new SelectionHandler<VectorLayerInfo>() {
		@Override
		public void onSelection(SelectionEvent<VectorLayerInfo> event) {
			combo.setValue(event.getSelectedItem(), true);
			List<VectorLayerInfo> updatedLayers = removeLayer(event
					.getSelectedItem());
			if (COMBO1_ID.equals(combo.getId())) {
				updateCombo(LAYER_COMBO_2, LAYER_STORE_2, updatedLayers);
			} else {
				updateCombo(LAYER_COMBO_1, LAYER_STORE_1, updatedLayers);
			}
		}
	});
	
	validateButton.setToolTip(UIMessages.INSTANCE
			.descriptionValidationToolText());

	final HorizontalPanel horizontalGroup = getHorizontalPanel();
	horizontalGroup.add(combo);
	horizontalGroup.add(validateButton);

	panel.add(new Label(UIMessages.INSTANCE.layerLabelText(numCombo)));
	panel.add(horizontalGroup);
}
 
Example 12
Source Project: geowe-core   Source File: GeoprocessDialog.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void createGeoprocessAndDistanceField(final Geoprocesses spatialOperation) {
	spatialOperationComboBox = new GeoprocessComboBox(
			spatialOperation.getAll());
	spatialOperationComboBox.setWidth(WIDTH_SPATIAL_OPERATION_COMBO);
	clearSpatialOperationComboBox();				
	spatialOperationComboBox
			.addSelectionHandler(new SelectionHandler<Geoprocess>() {
				@Override
				public void onSelection(SelectionEvent<Geoprocess> event) {
					spatialOperationComboBox.setValue(
							event.getSelectedItem(), true);

					if (event.getSelectedItem() instanceof BufferGeoprocess) {
						LAYER_COMBO_2.setValue(null);
						LAYER_COMBO_2.setEnabled(false);
						distanceTextField.setText("0");
						distanceTextField.setEnabled(true);
						distanceTextField.setVisible(true);
					} else {							
						LAYER_COMBO_2.setEnabled(true);
						distanceTextField.setText("");
						distanceTextField.setEnabled(false);
						distanceTextField.setVisible(false);
					}
				}
			});

	initDistanceTextField();
	final HorizontalPanel horizontalGroup = getHorizontalPanel();
	horizontalGroup.add(spatialOperationComboBox);
	horizontalGroup.add(distanceTextField);
	panel.add(horizontalGroup);
}
 
Example 13
private void createSelectionHandler() {
	addSelectionHandler(new SelectionHandler<Geoprocess>() {
		@Override
		public void onSelection(SelectionEvent<Geoprocess> event) {
			setValue(event.getSelectedItem(), true);
		}
	});
}
 
Example 14
private void createSelectionHandler() {
	addSelectionHandler(new SelectionHandler<VectorFormat>() {
		@Override
		public void onSelection(SelectionEvent<VectorFormat> event) {
			setValue(event.getSelectedItem(), true);
		}
	});
}
 
Example 15
Source Project: geowe-core   Source File: ExportDataDialog.java    License: GNU General Public License v3.0 5 votes vote down vote up
private SelectionHandler<VectorFormat> getVectorComboSelectionHandler() {
	return new SelectionHandler<VectorFormat>() {
		@Override
		public void onSelection(SelectionEvent<VectorFormat> event) {
				epsgCombo.enable();
		}
	};
}
 
Example 16
Source Project: gwt-material-addins   Source File: MaterialStep.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(final SelectionHandler<MaterialStep> handler) {
    return this.addHandler(new SelectionHandler<MaterialStep>() {
        @Override
        public void onSelection(SelectionEvent<MaterialStep> event) {
            if (isEnabled()) {
                handler.onSelection(event);
            }
        }
    }, SelectionEvent.getType());
}
 
Example 17
Source Project: dashbuilder   Source File: GalleryTreeViewImpl.java    License: Apache License 2.0 5 votes vote down vote up
private Tree initNavigationTree() {
    Tree navTree = new Tree();

    List<GalleryTreeNode> mainNodes = galleryTree.getMainNodes();
    populateNavigationTree(mainNodes, navTree);

    navTree.addSelectionHandler(new SelectionHandler<TreeItem>() {
        public void onSelection(SelectionEvent<TreeItem> event) {
            TreeItem ti = event.getSelectedItem();
            GalleryTreeNode node = (GalleryTreeNode) ti.getUserObject();
            treeItemClicked(ti, node);
        }
    });
    return navTree;
}
 
Example 18
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 19
/**
 * Tab Workspace
 */
public TabWorkspace() {
	widgetExtensionList = new ArrayList<TabWorkspaceExtension>();
	workHandlerExtensionList = new ArrayList<WorkspaceHandlerExtension>();
	tabBar = new TabBar();
	tabBar.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int index = indexCorrectedChangeViewIndex(event.getSelectedItem().intValue());

			switch (index) {
				case UIDockPanelConstants.DESKTOP:
					Main.get().mainPanel.setView(UIDockPanelConstants.DESKTOP);
					if (Main.get().activeFolderTree != null) { // On start up is null
						Main.get().activeFolderTree.centerActulItemOnScroll(); // Center the actual item every time
					}
					break;

				case UIDockPanelConstants.SEARCH:
					Main.get().mainPanel.setView(UIDockPanelConstants.SEARCH);
					break;

				case UIDockPanelConstants.DASHBOARD:
					Main.get().mainPanel.setView(UIDockPanelConstants.DASHBOARD);
					break;

				case UIDockPanelConstants.ADMINISTRATION:
					Main.get().mainPanel.setView(UIDockPanelConstants.ADMINISTRATION);
					break;

				default:
					Main.get().mainPanel.setView(index);
					break;
			}

			fireEvent(HasWorkspaceEvent.STACK_CHANGED);
			tabVisited[index] = true;
		}
	});

	initWidget(tabBar);
}
 
Example 20
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 21
/**
 * The Document tab
 */
public TabDocument() {
	doc = new GWTDocument();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	document = new Document();
	notes = new Notes(Notes.DOCUMENT_NOTE);
	version = new VersionScrollTable();
	security = new SecurityScrollTable();
	preview = new Preview(null);
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();
	widgetExtensionList = new ArrayList<TabDocumentExtension>();
	docHandlerExtensionList = new ArrayList<DocumentHandlerExtension>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			final int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			preview.cleanPreview(); // Always clean preview tab

			if (tabIndex == PREVIEW_TAB) {
				Timer previewTimer = new Timer() {
					@Override
					public void run() {
						previewDocument(false);
					}
				};
				previewTimer.schedule(500);
			}

			fireEvent(HasDocumentEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	document.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}
 
Example 22
/**
 * The Document tab
 */
public TabMail() {
	widgetExtensionList = new ArrayList<TabMailExtension>();
	mailHandlerExtensionList = new ArrayList<MailHandlerExtension>();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	mail = new Mail();
	notes = new Notes(Notes.MAIL_NOTE);
	mailViewer = new MailViewer();
	security = new SecurityScrollTable();
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			fireEvent(HasMailEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	mail.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	mailViewer.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}
 
Example 23
/**
 * TabFolder
 */
public TabFolder() {
	widgetExtensionList = new ArrayList<TabFolderExtension>();
	folderHandlerExtensionList = new ArrayList<FolderHandlerExtension>();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	folder = new Folder();
	security = new SecurityScrollTable();
	notes = new Notes(Notes.FOLDER_NOTE);
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			fireEvent(HasFolderEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	folder.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}
 
Example 24
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 25
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 26
public HandlerRegistration addSelectionHandler(SelectionHandler<TreeItem> handler) {
	return addHandler(handler, SelectionEvent.getType());
}
 
Example 27
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setHTML(Util.imageItemHTML("img/menuitem_childs.gif", "root_schema", "top"));
	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);
}
 
Example 28
Source Project: gwt-material   Source File: MaterialTab.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(SelectionHandler<Integer> handler) {
    return addHandler(handler, SelectionEvent.getType());
}
 
Example 29
Source Project: gwt-material   Source File: MaterialCollection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(SelectionHandler<MaterialCollectionItem> selectionHandler) {
    return addHandler(selectionHandler, SelectionEvent.getType());
}
 
Example 30
Source Project: gwt-material-addins   Source File: JsonTable.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(SelectionHandler<Element> selectionHandler) {
    return addHandler(selectionHandler, SelectionEvent.getType());
}