本文整理匯總了Java中com.google.gwt.event.logical.shared.SelectionEvent.getSelectedItem方法的典型用法代碼示例。如果您正苦於以下問題:Java SelectionEvent.getSelectedItem方法的具體用法?Java SelectionEvent.getSelectedItem怎麽用?Java SelectionEvent.getSelectedItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.event.logical.shared.SelectionEvent
的用法示例。
在下文中一共展示了SelectionEvent.getSelectedItem方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
DatasetWidget datasetWidget = datasetButton.getDatasetWidget();
boolean isFromMyDatasetWidget = event.getSource().equals(datasetWidget);
if (isFromMyDatasetWidget) {
TreeItem item = event.getSelectedItem();
Object variableUserObject = item.getUserObject();
if (variableUserObject instanceof VariableSerializable) {
VariableSerializable variable = (VariableSerializable) variableUserObject;
// Remove extra variable UserLists before
// applyVariableChange
// TODO: Replace this with a higher level method or use
// events
variableControls.removeListBoxesExceptFirst();
if ( variable.getAttributes().get("grid_type").equals(vizGalVariable.getAttributes().get("grid_type") )) {
applyVariableChange(variable, true);
} else {
Window.alert("LAS cannot compare data on a grid with in-situ data.");
}
}
}
}
示例2: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem item = event.getSelectedItem();
currentlySelected = item;
TreeItem child = item.getChild(0);
if ( child != null && child.getText().equals(DatasetWidget.LOADING) ) {
CategorySerializable cat = (CategorySerializable) item.getUserObject();
Util.getRPCService().getCategories(cat.getID(), null, categoryCallback);
}
// Open the item. Work around double firing bug.
// http://code.google.com/p/google-web-toolkit/issues/detail?id=3660&q=Tree%20selection&colspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars
TreeItem selItem = event.getSelectedItem();
TreeItem parent = selItem.getParentItem();
selItem.getTree().setSelectedItem(parent, false); // null is ok
if(parent != null)
parent.setSelected(false); // not compulsory
selItem.setState(!selItem.getState(), false);
}
示例3: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<TreeItem> event)
{
TreeItem itemSelected = event.getSelectedItem();
if (itemSelected.getUserObject() == null)
{
return;
}
String type = (String) itemSelected.getUserObject();
if (type.equals("table"))
{
loadExpressionCollectionViewForTable(itemSelected.getText());
}
else if (type.equals("person"))
{
loadExpressionCollectionViewForPerson(itemSelected.getText());
}
else if (type.equals("target"))
{
loadExpressionCollectionViewForTarget(Double.parseDouble(itemSelected.getText()));
}
}
示例4: fireItemClickEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private void fireItemClickEvent(final SelectionEvent<TreeItem> event) {
// When a qaml is listening to a tree with its id, and when clicks on parent tree , as the parent tree is also an item
// we dont have to do implicit click handling of item. otherwise 2 times the event will be executed.
if (isRootItem(event.getSelectedItem())) {
return;
}
if (rootItem instanceof QTreeItem) {
final Label rootItemlabel =((QTreeItem)rootItem).getLabel();
ClickEvent clickEvent = new ClickEvent() {
// This is to make sure that we are making the item id and value available as src-id and src-value
@Override
public Object getSource() {
if (event.getSelectedItem() instanceof QTreeItem) {
return ((QTreeItem)event.getSelectedItem()).getLabel();
}
return rootItemlabel;
}
};
rootItemlabel.fireEvent(clickEvent);
}
}
示例5: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
/**
* @see com.google.gwt.event.logical.shared.SelectionHandler#onSelection(com.google.gwt.event.logical.shared.SelectionEvent)
*/
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
if ( (view != null) && (event != null) ) {
Object source = event.getSource();
// Only proceed if the source was from the same panel
if ( (source != null) && (source instanceof HasName) ) {
String sourceName = ((HasName) source).getName();
if ( view.getName().equalsIgnoreCase(sourceName) ) {
TextBox breadcrumbs = view.getBreadcrumbs();
TreeItem selectedItem = event.getSelectedItem();
if ( selectedItem != null ) {
String selectedItemText = selectedItem.getText();
// Only bother to update the bread crumbs if the
// user
// has
// selected an item that has actually loaded
if ( !selectedItemText.equalsIgnoreCase(DatasetWidget.LOADING) ) {
// Update bread crumbs by walking the meta data
// categories GUI tree already in memory
TreeItem parentItem = selectedItem.getParentItem();
if ( parentItem != null ) {
// First clear bread crumbs so events fire
// even
// when there is no change in
// breadcrumbsText
// characters, but set boolean fireEvents to
// false to avoid unnecessary event firing.
breadcrumbs.setValue("", false);
String breadcrumbsText = getBreadcrumbsText(parentItem);
breadcrumbs.setValue(breadcrumbsText, true);
}
}
}
}
}
}
}
示例6: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<Integer> event) {
busyIndicator.busy();
switch(currentTabIndex = event.getSelectedItem()) {
case 0:
ApproveRejectPopup.this.service.loadPendingTerms(termTab);
break;
case 1:
ApproveRejectPopup.this.service.loadPendingRelationships(relationshipTab);
break;
case 2:
ApproveRejectPopup.this.service.loadPendingSynonyms(synonymTab);
break;
}
}
示例7: onSelectionFileDropdown
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@UiHandler({"dpFile", "dpNew", "dpView", "dpEdit", "dpFormat"})
void onSelectionFileDropdown(SelectionEvent<Widget> selection) {
if(selection.getSelectedItem() instanceof MaterialLink){
MaterialToast.fireToast("Triggered : " + ((MaterialLink)selection.getSelectedItem()).getText());
}else if(selection.getSelectedItem() instanceof MaterialCheckBox){
MaterialToast.fireToast("Checked : " + ((MaterialCheckBox)selection.getSelectedItem()).getText());
}
}
示例8: onSelectionMode
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@UiHandler("dpMode")
void onSelectionMode(SelectionEvent<Widget> selection) {
for(Widget w : dpMode.getItems()){
if(w instanceof MaterialCheckBox){
((MaterialCheckBox) w).setValue(false);
}
}
if(selection.getSelectedItem() instanceof MaterialCheckBox){
((MaterialCheckBox) selection.getSelectedItem()).setValue(true);
MaterialToast.fireToast("Checked : " + ((MaterialCheckBox) selection.getSelectedItem()).getText());
}
}
示例9: onAddGroupByEnter
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@UiHandler("groupToAdd")
void onAddGroupByEnter(SelectionEvent<GroupReference> event) {
GroupReference ref = event.getSelectedItem();
if (ref != null) {
addGroup(ref);
}
}
示例10: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<TreeItem> p_event)
{
if( p_event.getSelectedItem() instanceof TreeItemEvent )
{
GameEngine.model().timePlay( ((TreeItemEvent)p_event.getSelectedItem()).getEvent() );
}
if( p_event.getSelectedItem() instanceof TreeItemAdditionalEvent )
{
GameEngine.model().loadAdditionalEvents();
}
}
示例11: handleSetModifiedForSelectionEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private static void handleSetModifiedForSelectionEvent(final HasDataGridMethods parentWidget, final DataContainerGVO rowValue, final ColumnDefinition<DataContainerGVO, String> columnDef, final UIObject uiObject, SelectionEvent event) {
Object value = event.getSelectedItem();
if(value instanceof QMultiWordSuggestion) {
value = ((QMultiWordSuggestion)value).getDisplayString();
}
Object source = event.getSource();
handleSetModified(parentWidget, rowValue, columnDef, uiObject, value);
}
示例12: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<Integer> event) {
if (event.getSelectedItem() == 0) {
activePanel.onShown();
} else if (event.getSelectedItem() == 1) {
inactivePanel.onShown();
}
}
示例13: onTabSelected
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@UiHandler("tabPanel")
protected void onTabSelected(SelectionEvent<Integer> event) {
if (presenter != null) {
int index = event.getSelectedItem();
presenter.onTabSelected(index);
}
}
示例14: createField
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private Field createField( final SelectionEvent<Integer> selectionEvent ) {
if ( selectionEvent.getSelectedItem() == FieldData.TYPE_FACT ) {
return new FactAssignmentField( field.getName(), helper.getFieldType() );
} else {
if ( selectionEvent.getSelectedItem() == FieldData.TYPE_COLLECTION ) {
CollectionFieldData collectionFieldData = new CollectionFieldData();
collectionFieldData.setName( field.getName() );
return collectionFieldData;
} else {
FieldData fieldData = new FieldData( field.getName(), "" );
fieldData.setNature( selectionEvent.getSelectedItem() );
return fieldData;
}
}
}
示例15: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
if ( (view != null) && (event != null) ) {
Object source = event.getSource();
// Only proceed if the source was from the same panel or from
// the comparePanel
if ( (source != null) && (source instanceof HasName) ) {
String sourceName = ((HasName) source).getName();
String viewName = view.getName();
if ( ((viewName != null) && viewName.equalsIgnoreCase(sourceName)) || CONSTANTS.comparePanelName().equalsIgnoreCase(sourceName) ) { //$NON-NLS-1$
// Get variables from the tree
TreeItem selectedItem = event.getSelectedItem();
if ( selectedItem != null ) {
Object userObject = selectedItem.getUserObject();
if ( (userObject != null) && (userObject instanceof VariableSerializable) ) {
VariableSerializable selectedVariable = (VariableSerializable) userObject;
// Find all siblings if any
Vector<VariableSerializable> variables = new Vector<VariableSerializable>();
// Vector<TreeItem> children = new
// Vector<TreeItem>();
int selectedIndex = 0;
TreeItem parent = selectedItem.getParentItem();
if ( parent == null ) {
// There are no reachable siblings without a
// parent, so just use the selectedVariable
// and leave selectedIndex == 0
variables.add(selectedVariable);
// children.add(selectedItem);
} else {
for ( int i = 0; i < parent.getChildCount(); i++ ) {
TreeItem child = parent.getChild(i);
userObject = child.getUserObject();
if ( (userObject != null) && (userObject instanceof VariableSerializable) ) {
variables.add((VariableSerializable) userObject);
// children.add(child);
}
}
selectedIndex = variables.indexOf(selectedVariable);
}
// Add the variables to the view
view.setVariables(variables, selectedIndex);
}
}
}
}
}
}