com.google.gwt.event.logical.shared.SelectionHandler Java Examples
The following examples show how to use
com.google.gwt.event.logical.shared.SelectionHandler.
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 File: BaseTree.java From EasyML with Apache License 2.0 | 6 votes |
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 File: EditorHarness.java From incubator-retired-wave with Apache License 2.0 | 6 votes |
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 #3
Source File: EditorHarness.java From swellrt with Apache License 2.0 | 6 votes |
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 #4
Source File: MaterialPopupMenuTest.java From gwt-material-addins with Apache License 2.0 | 6 votes |
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 #5
Source File: GeoDataImportDialog.java From geowe-core with GNU General Public License v3.0 | 6 votes |
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 #6
Source File: CopyElementDialog.java From geowe-core with GNU General Public License v3.0 | 6 votes |
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 #7
Source File: MaterialNavSectionTest.java From gwt-material with Apache License 2.0 | 6 votes |
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 #8
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * 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
Source File: GalleryTreeViewImpl.java From dashbuilder with Apache License 2.0 | 5 votes |
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 #10
Source File: MaterialStep.java From gwt-material-addins with Apache License 2.0 | 5 votes |
@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 #11
Source File: ExportDataDialog.java From geowe-core with GNU General Public License v3.0 | 5 votes |
private SelectionHandler<VectorFormat> getVectorComboSelectionHandler() { return new SelectionHandler<VectorFormat>() { @Override public void onSelection(SelectionEvent<VectorFormat> event) { epsgCombo.enable(); } }; }
Example #12
Source File: VectorFormatComboBox.java From geowe-core with GNU General Public License v3.0 | 5 votes |
private void createSelectionHandler() { addSelectionHandler(new SelectionHandler<VectorFormat>() { @Override public void onSelection(SelectionEvent<VectorFormat> event) { setValue(event.getSelectedItem(), true); } }); }
Example #13
Source File: GeoprocessComboBox.java From geowe-core with GNU General Public License v3.0 | 5 votes |
private void createSelectionHandler() { addSelectionHandler(new SelectionHandler<Geoprocess>() { @Override public void onSelection(SelectionEvent<Geoprocess> event) { setValue(event.getSelectedItem(), true); } }); }
Example #14
Source File: GeoprocessDialog.java From geowe-core with GNU General Public License v3.0 | 5 votes |
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 #15
Source File: GeoprocessDialog.java From geowe-core with GNU General Public License v3.0 | 5 votes |
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 #16
Source File: Menu.java From sc2gears with Apache License 2.0 | 5 votes |
/** * 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 #17
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * 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 #18
Source File: CourseFinderFreeTime.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<RequestedCourse> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #19
Source File: DebugPanelFilterWidget.java From core with GNU Lesser General Public License v2.1 | 4 votes |
public HandlerRegistration addSelectionHandler(SelectionHandler<Integer> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #20
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
/** * 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 #21
Source File: TabWorkspace.java From document-management-system with GNU General Public License v2.0 | 4 votes |
/** * 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 #22
Source File: StudentSchedule.java From unitime with Apache License 2.0 | 4 votes |
public void setSelectionHandler(SelectionHandler<Integer> handler) { iHandler = handler; }
Example #23
Source File: StudentSchedule.java From unitime with Apache License 2.0 | 4 votes |
public StudentSchedule(boolean online) { iOnline = online; iTabs = new UniTimeTabPanel(); iTabs.setDeckStyleName("unitime-TabPanel"); iAdvReqs = new WebTable(); iAdvReqs.setEmptyMessage(MESSAGES.emptyRequests()); iAdvReqs.setHeader(new WebTable.Row( new WebTable.Cell(MESSAGES.colPriority(), 1, "25px"), new WebTable.Cell(MESSAGES.colCourse(), 1, "75px"), new WebTable.Cell(MESSAGES.colTitle(), 1, "200px"), new WebTable.Cell(MESSAGES.colCredit(), 1, "20px"), new WebTable.Cell(MESSAGES.colPreferences(), 1, "100px"), new WebTable.Cell(MESSAGES.colCritical(), 1, "20px"), new WebTable.Cell(MESSAGES.colNotes(), 1, "300px"), new WebTable.Cell(MESSAGES.colChanges(), 1, "100px"))); iAdvReqs.setSelectSameIdRows(true); iAdvReqs.addStyleName("unitime-AdvisorCourseRequestsTable"); iTabs.add(iAdvReqs, MESSAGES.tabAdvisorRequests(), true); Character cha = UniTimeHeaderPanel.guessAccessKey(MESSAGES.tabAdvisorRequests()); if (cha != null) iTabAccessKeys.put(cha, 0); iRequests = new WebTable(); iRequests.setEmptyMessage(MESSAGES.emptyRequests()); iRequests.setHeader(new WebTable.Row( new WebTable.Cell(MESSAGES.colPriority(), 1, "25px"), new WebTable.Cell(MESSAGES.colCourse(), 1, "75px"), new WebTable.Cell(MESSAGES.colTitle(), 1, "200px"), new WebTable.Cell(MESSAGES.colCredit(), 1, "20px"), new WebTable.Cell(MESSAGES.colPreferences(), 1, "100px"), new WebTable.Cell(MESSAGES.colWarnings(), 1, "200px"), new WebTable.Cell(MESSAGES.colStatus(), 1, "20px"), new WebTable.Cell(MESSAGES.colCritical(), 1, "20px"), new WebTable.Cell(MESSAGES.colWaitList(), 1, "20px"), new WebTable.Cell(MESSAGES.colRequestTimeStamp(), 1, "50px"))); iTabs.add(iRequests, MESSAGES.tabRequests(), true); Character ch0 = UniTimeHeaderPanel.guessAccessKey(MESSAGES.tabRequests()); if (ch0 != null) iTabAccessKeys.put(ch0, 1); iAssignments = new WebTable(); iAssignments.setHeader(new WebTable.Row( new WebTable.Cell(MESSAGES.colSubject(), 1, "75px"), new WebTable.Cell(MESSAGES.colCourse(), 1, "75px"), new WebTable.Cell(MESSAGES.colSubpart(), 1, "50px"), new WebTable.Cell(MESSAGES.colClass(), 1, "75px"), new WebTable.Cell(MESSAGES.colLimit(), 1, "60px"), new WebTable.Cell(MESSAGES.colDays(), 1, "50px"), new WebTable.Cell(MESSAGES.colStart(), 1, "75px"), new WebTable.Cell(MESSAGES.colEnd(), 1, "75px"), new WebTable.Cell(MESSAGES.colDate(), 1, "75px"), new WebTable.Cell(MESSAGES.colRoom(), 1, "100px"), new WebTable.Cell(MESSAGES.colInstructor(), 1, "100px"), new WebTable.Cell(MESSAGES.colParent(), 1, "75px"), new WebTable.Cell(MESSAGES.colNoteIcon(), 1, "10px"), new WebTable.Cell(MESSAGES.colCredit(), 1, "75px"), new WebTable.Cell(MESSAGES.colEnrollmentTimeStamp(), 1, "75px") )); iAssignments.setEmptyMessage(MESSAGES.emptySchedule()); iTabs.add(iAssignments, MESSAGES.tabClasses(), true); Character ch1 = UniTimeHeaderPanel.guessAccessKey(MESSAGES.tabClasses()); if (ch1 != null) iTabAccessKeys.put(ch1, 2); iGrid = new TimeGrid(); iTabs.add(iGrid, MESSAGES.tabTimetable(), true); Character ch2 = UniTimeHeaderPanel.guessAccessKey(MESSAGES.tabTimetable()); if (ch2 != null) iTabAccessKeys.put(ch2, 3); iTabs.selectTab(SectioningStatusCookie.getInstance().getStudentTab()); iTabs.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { SectioningStatusCookie.getInstance().setStudentTab(event.getSelectedItem()); if (iHandler != null) iHandler.onSelection(event); } }); iTabs.addStyleName("unitime-StudentSchedule"); initWidget(iTabs); }
Example #24
Source File: FilterBox.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<Suggestion> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #25
Source File: CourseFinderDialog.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<RequestedCourse> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #26
Source File: UniTimeTabPanel.java From unitime with Apache License 2.0 | 4 votes |
public HandlerRegistration addSelectionHandler(SelectionHandler<Integer> handler) { return super.addSelectionHandler(handler); }
Example #27
Source File: CourseFinderCourses.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<RequestedCourse> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #28
Source File: TimeSelector.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<Integer> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #29
Source File: CourseFinderMultipleCourses.java From unitime with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<RequestedCourse> handler) { return addHandler(handler, SelectionEvent.getType()); }
Example #30
Source File: MaterialCollection.java From gwt-material with Apache License 2.0 | 4 votes |
@Override public HandlerRegistration addSelectionHandler(SelectionHandler<MaterialCollectionItem> selectionHandler) { return addHandler(selectionHandler, SelectionEvent.getType()); }