当前位置: 首页>>代码示例>>Java>>正文


Java SelectionEvent.getSelectedItem方法代码示例

本文整理汇总了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.");
            }
        }
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:OutputPanel.java

示例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);

}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:DatasetWidget.java

示例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()));
	}
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:23,代码来源:ExpressionView.java

示例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);
	}
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:23,代码来源:QTree.java

示例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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:41,代码来源:VariableMetadataActivity.java

示例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;
	}		
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:16,代码来源:ApproveRejectPopup.java

示例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());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:MenuBarView.java

示例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());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:13,代码来源:MenuBarView.java

示例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);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:8,代码来源:PermissionEditor.java

示例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();
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:13,代码来源:WgtGameLogs.java

示例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);
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:9,代码来源:CellRendererHelper.java

示例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();
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:9,代码来源:AbstractRecordPanel.java

示例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);
    }
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:8,代码来源:TollRatesViewGwtImpl.java

示例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;
        }
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:16,代码来源:FieldSelectorWidget.java

示例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);
                    }
                }
            }
        }
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:48,代码来源:MultiVariableSelectorActivity.java


注:本文中的com.google.gwt.event.logical.shared.SelectionEvent.getSelectedItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。