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


Java SelectionEvent.getSource方法代码示例

本文整理汇总了Java中com.google.gwt.event.logical.shared.SelectionEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java SelectionEvent.getSource方法的具体用法?Java SelectionEvent.getSource怎么用?Java SelectionEvent.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.event.logical.shared.SelectionEvent的用法示例。


在下文中一共展示了SelectionEvent.getSource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSelection

import com.google.gwt.event.logical.shared.SelectionEvent; //导入方法依赖的package包/类
@Override
public void onSelection(SelectionEvent event) {
	DatasetWidget source = (DatasetWidget) event.getSource();
	Object uo = source.getCurrentlySelected();
	if ( uo instanceof VariableSerializable ) {
		VariableSerializable v = (VariableSerializable) uo;
		xSecondName = v.getDSName();
		xSecondID = v.getDSID();
		xSecondVarID = v.getID();
		xSecondDataset.setText(xSecondName);
		set.add(0);
		setBackground(1);
		Util.getRPCService().getGrid(xSecondID, xSecondVarID, gridCallback);

	} else if ( uo instanceof CategorySerializable) {
		CategorySerializable c = (CategorySerializable) uo;
		// Category children, open it up.
		
		// Variable children, dagnabit.  We need the variable, so let's go get it.
		Util.getRPCService().getCategories(c.getID(), null, categoryCallback);
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:ClimateAnalysis.java

示例2: onSelection

import com.google.gwt.event.logical.shared.SelectionEvent; //导入方法依赖的package包/类
public void onSelection(SelectionEvent<Integer> ise) {
    TabBar tb = (TabBar) ise.getSource();
    int idx = tb.getSelectedTab();
    if (idx == cSelIdx) {
        tb.selectTab(-1, false);
        dropdown.close();
    } else {
        if (!tb.equals(leftToolbar)) {
            leftToolbar.selectTab(-1, false);
        }
        if (!tb.equals(centerToolbar)) {
            centerToolbar.selectTab(-1, false);
        }
        if (!tb.equals(rightToolbar)) {
            rightToolbar.selectTab(-1, false);
        }

        TabHolder th = findTab(idx, tb);
        if (th != null) {
            th.button.activate();
        }
    }
    buttonClicked = false;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:25,代码来源:Toolbar.java

示例3: 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

示例4: 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

示例5: 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.getSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。