當前位置: 首頁>>代碼示例>>Java>>正文


Java SelectionEvent類代碼示例

本文整理匯總了Java中com.google.gwt.event.logical.shared.SelectionEvent的典型用法代碼示例。如果您正苦於以下問題:Java SelectionEvent類的具體用法?Java SelectionEvent怎麽用?Java SelectionEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SelectionEvent類屬於com.google.gwt.event.logical.shared包,在下文中一共展示了SelectionEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
@Override
public void onClick( final ClickEvent event ) {
    final FormStylePopup pop = new FormStylePopup( TestScenarioConstants.INSTANCE.ChooseAFieldToAdd() );
    final FactFieldSelector selector = createAddNewField( pop );
    pop.addAttribute( TestScenarioConstants.INSTANCE.ChooseAFieldToAdd(),
                      selector );
    pop.add( new ModalFooterOKCancelButtons( new Command() {
        @Override
        public void execute() {
            SelectionEvent.fire( selector,
                                 selector.getSelectedText() );
        }
    }, new Command() {
        @Override
        public void execute() {
            pop.hide();
        }
    }
    ) );

    pop.show();
}
 
開發者ID:kiegroup,項目名稱:drools-wb,代碼行數:23,代碼來源:AddFieldClickHandler.java

示例2: TreePanel

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
public TreePanel(GwtTree main) {
	this.main = main;
	
	this.addSelectionHandler(new SelectionHandler<TreeItem>() {
		
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			Object obj = event.getSelectedItem().getUserObject();
			if (obj instanceof CompanyItem) {
				TreePanel.this.main.showCompany(((CompanyItem)obj).getId());
			} else if (obj instanceof DepartmentItem) {
				TreePanel.this.main.showDepartment(((DepartmentItem)obj).getId());
			} else if (obj instanceof EmployeeItem) {
				TreePanel.this.main.showEmployee(((EmployeeItem)obj).getId());
			}
		}
	});
}
 
開發者ID:amritbhat786,項目名稱:DocIT,代碼行數:19,代碼來源:TreePanel.java

示例3: BaseTree

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
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);
		}
	});
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:20,代碼來源:BaseTree.java

示例4: initLayerCombo1

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
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;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:27,代碼來源:CopyElementDialog.java

示例5: getTabPanelSelectionHandler

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
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);
			}
		}
	};
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:25,代碼來源:GeoDataImportDialog.java

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

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

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

示例9: init

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
/**
 * @return view
 */
public VariableMetadataView init() {
    final VariableMetadataView view = clientFactory.getVariableMetadataView(name);
    view.setPresenter(this);

    // Listen to BreadcrumbValueChangeEvent events in order to update this
    // view's bread crumbs when the comparePanel's bread crumbs change
    updateBreadcrumbsTreeItemSelectionHandler = new UpdateBreadcrumbsTreeItemSelectionHandler(view);
    eventBus.addHandler(SelectionEvent.getType(), updateBreadcrumbsTreeItemSelectionHandler);

    BreadcrumbValueChangeEventHandler = new BreadcrumbValueChangeEvent.Handler() {
        @Override
        public void onValueChange(BreadcrumbValueChangeEvent event) {
            if ( !view.isOnComparePanel() ) {
                // Since this view is NOT on the comparePanel, it should
                // prepare to update its bread crumbs
                // TODO: set a potential new bread crumb value, instead of
                // changing it now
                view.getBreadcrumbs().setValue(event.getValue());
            }
        }
    };
    eventBus.addHandler(BreadcrumbValueChangeEvent.TYPE, BreadcrumbValueChangeEventHandler);
    return view;
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:28,代碼來源:VariableMetadataActivity.java

示例10: initContentOracle

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
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);
    }
  }
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:24,代碼來源:EditorHarness.java

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

示例12: getDeleteSelectionHandler

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
private SelectionHandler<MenuItem> getDeleteSelectionHandler() {
  if (deleteSelectionHandler == null) {
    deleteSelectionHandler = new SelectionHandler<MenuItem>() {
      @Override
      public void onSelection(SelectionEvent<MenuItem> event) {
        getPresenter().onDelete();
      }
    };
  }
  return deleteSelectionHandler;
}
 
開發者ID:ctripcorp,項目名稱:dataworks-zeus,代碼行數:12,代碼來源:FileMenu.java

示例13: TableInfoPanel

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
public TableInfoPanel(TableManagerPresenter c) {
	this.presenter = c;
	this.context = presenter.getPlatformContext();
	setBodyBorder(false);
	add(getTableInfoTab(), new TabItemConfig("基本信息"));
	add(getColumnInfoTab(), new TabItemConfig("字段信息"));
	add(getPtTab(), new TabItemConfig("分區信息"));

	addSelectionHandler(new SelectionHandler<Widget>() {

		@Override
		public void onSelection(SelectionEvent<Widget> event) {
			if (getConfig(event.getSelectedItem()).getText().equals("分區信息")) {
				if (isPartitionLoaded() == false) {
					getPtTab().load(table);
					setPartitionLoaded(true);
				}
			}
		}
	});
}
 
開發者ID:ctripcorp,項目名稱:dataworks-zeus,代碼行數:22,代碼來源:TableInfoPanel.java

示例14: testSelectionEvent

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
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]);
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:20,代碼來源:MaterialNavSectionTest.java

示例15: init

import com.google.gwt.event.logical.shared.SelectionEvent; //導入依賴的package包/類
private void init(RootPanel root) {
  _deckPanel = new DeckPanel();
  _tree = createTree();
  _tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
    public void onSelection(SelectionEvent<TreeItem> event) {
      TreeItem item = event.getSelectedItem();
      if(item.getUserObject() != null) {
        ContentWidget widget = (ContentWidget)item.getUserObject();
        widget.init();
        int i = _deckPanel.getWidgetIndex(widget);
        if(i != -1) _deckPanel.showWidget(i);
      }
    }
  });

  FlexTable table = new FlexTable();
  table.setWidget(0, 0, _tree);
  table.setWidget(0, 1, _deckPanel);
  table.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP);

  root.add(table);
}
 
開發者ID:sanderberents,項目名稱:gwtlib,代碼行數:23,代碼來源:ShowcaseEntryPoint.java


注:本文中的com.google.gwt.event.logical.shared.SelectionEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。