本文整理匯總了Java中com.google.gwt.event.logical.shared.SelectionEvent.fire方法的典型用法代碼示例。如果您正苦於以下問題:Java SelectionEvent.fire方法的具體用法?Java SelectionEvent.fire怎麽用?Java SelectionEvent.fire使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.event.logical.shared.SelectionEvent
的用法示例。
在下文中一共展示了SelectionEvent.fire方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: selectTab
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
public void selectTab(int index, boolean fireEvents) {
if (index < 0 || index >= _tabs.size()) {
throw new AssertionError("Index out of bound.");
}
if (index == _selectedIndex) {
return;
}
if (fireEvents) {
BeforeSelectionEvent<Integer> event = BeforeSelectionEvent.fire(this, index);
if ((event != null) && event.isCanceled()) {
return;
}
}
_tabBar.selectTab(index);
_contentPanel.setContent(_tabs.get(index).content());
_selectedIndex = index;
if (fireEvents) {
SelectionEvent.fire(this, index);
}
}
示例2: show
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void show() {
dialogBox.show();
SelectionEvent.fire(tabPanel, currentTabIndex);
/*
dialogBox.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
dialogBox.setPopupPosition(
Window.getClientWidth() - offsetWidth, 0);
}
});
*/
}
示例3: doSingleSelect
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
protected void doSingleSelect(Node node, boolean suppressEvent) {
int index;
index = nodeStorage.indexOf(node);
if (index == -1 || isSelected(node)) {
return;
} else {
if (!suppressEvent) {
BeforeSelectionEvent<Node> evt = BeforeSelectionEvent.fire(this, node);
if (evt != null && evt.isCanceled()) {
return;
}
}
}
boolean change = false;
if (selectionStorage.size() > 0 && !isSelected(node)) {
doDeselect(Collections.singletonList(lastSelectedNode), true);
change = true;
}
if (selectionStorage.size() == 0) {
change = true;
}
selectionStorage.add(node);
lastSelectedNode = node;
onSelectChange(node, true);
setLastFocused(lastSelectedNode);
if (!suppressEvent) {
SelectionEvent.fire(this, node);
}
if (change && !suppressEvent) {
fireSelectionChange();
}
}
示例4: doMultiSelect
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
protected void doMultiSelect(List<Node> nodes, boolean keepExisting, boolean suppressEvent) {
boolean change = false;
if (!keepExisting && selectionStorage.size() > 0) {
change = true;
doDeselect(new ArrayList<>(selectionStorage), true);
}
for (Node node : nodes) {
if (tree.getNodeDescriptor(node) == null) {
continue;
}
boolean isSelected = isSelected(node);
if (!suppressEvent && !isSelected) {
BeforeSelectionEvent<Node> evt = BeforeSelectionEvent.fire(this, node);
if (evt != null && evt.isCanceled()) {
continue;
}
}
change = true;
lastSelectedNode = node;
selectionStorage.add(node);
setLastFocused(lastSelectedNode);
if (!isSelected) {
onSelectChange(node, true);
if (!suppressEvent) {
SelectionEvent.fire(this, node);
}
}
}
if (change && !suppressEvent) {
fireSelectionChange();
}
}
示例5: _fireSelectionEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
void _fireSelectionEvent(final Boolean oldSelectedValue,final Boolean selectedValue) {
// Fire selection event; this fires on selection and un-selection
SelectionEvent.fire(_tree,
this);
// Fire ValueChangeAt event: this fires when selection changes
ValueChangeAtEvent.fireIfNotEqual(_tree,
this,
oldSelectedValue,selectedValue);
}
示例6: onSelection
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
void onSelection(final T item,
final boolean fireEvents) {
if (curSelection != null) {
curSelection.setSelected(false);
}
curSelection = item;
if (curSelection != null) {
// Select the item and fire the selection event.
curSelection.setSelected(true);
if (fireEvents) {
SelectionEvent.fire(this,
curSelection);
}
}
}
示例7: onClick
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void onClick(final ClickEvent event) {
if (!hasFocus) {
fireFocusGained();
View view = getSelectedPart();
if (view != null) {
SelectionEvent.fire(UberTabPanel.this,
view.getPresenter().getDefinition());
}
}
}
示例8: selectPart
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public boolean selectPart(final PartDefinition part) {
if (!parts.contains(part)) {
//not necessary to check if current is part
return false;
}
if (currentPart != null) {
if (currentPart.getK1().equals(part)) {
return true;
}
parts.add(currentPart.getK1());
panelManager.onPartHidden(currentPart.getK1());
currentPart.getK2().getElement().getStyle().setDisplay(NONE);
}
currentPart = Pair.newPair(part,
partContentView.get(part));
currentPart.getK2().getElement().getStyle().setDisplay(BLOCK);
parts.remove(currentPart.getK1());
if (part.isSelectable()) {
titleDropDown.selectPart(part);
setupContextMenu();
header.setVisible(true);
} else {
header.setVisible(false);
}
scheduleResize();
resizePanelBody();
SelectionEvent.fire(ListBarWidgetImpl.this,
part);
return true;
}
示例9: showWidget
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
@Override
public void showWidget(Widget newWidget) {
Widget oldWidget = visibleWidget;
super.showWidget(newWidget);
if (oldWidget != newWidget) {
SelectionEvent.fire(this, newWidget);
}
}
示例10: onBrowserEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
/**
* @see com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt.user.client.Event)
*/
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
EventTarget target = event.getEventTarget();
Element elem = (Element) target.cast();
String nodeId = elem.getAttribute("data-nodeid"); //$NON-NLS-1$
if (nodeMap.containsKey(nodeId)) {
TraceNodeBean bean = nodeMap.get(nodeId);
SelectionEvent.fire(this, bean);
}
}
示例11: updateSelectedCell
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private void updateSelectedCell( Cell cell, boolean toggle )
{
if( toggle )
{
if( selectedCells.contains( cell ) )
{
cell.removeClassName( "selected" );
cell.getParentRow().removeClassName( "selected" );
selectedCells.remove( cell );
return;
}
}
else
{
if( selectedCells.size()==1 && cell==selectedCells.get( 0 ) )
return;
// clear current selection
for( Cell c : selectedCells )
{
c.removeClassName( "selected" );
c.getParentRow().removeClassName( "selected" );
}
selectedCells.clear();
}
if( cell != null )
{
selectedCells.add( cell );
cell.addClassName( "selected" );
cell.getParentRow().addClassName( "selected" );
cell.scrollIntoView();
}
SelectionEvent.fire( this, cell );
}
示例12: selectTab
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
/**
* Programmatically selects the specified tab.
*
* @param index the index of the tab to be selected
* @param fireEvents true to fire events, false not to
*/
public void selectTab(int index, boolean fireEvents) {
checkIndex(index);
if (index == selectedIndex) {
return;
}
// Fire the before selection event, giving the recipients a chance to
// cancel the selection.
if (fireEvents) {
BeforeSelectionEvent<Integer> event = BeforeSelectionEvent.fire(this,
index);
if ((event != null) && event.isCanceled()) {
return;
}
}
// Update the tabs being selected and unselected.
if (selectedIndex != -1) {
tabs.get(selectedIndex).setSelected(false);
}
deckPanel.showWidget(index);
tabs.get(index).setSelected(true);
selectedIndex = index;
// Fire the selection event.
if (fireEvents) {
SelectionEvent.fire(this, index);
}
}
示例13: fireSuggestionEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private void fireSuggestionEvent(Suggestion selectedSuggestion) {
SelectionEvent.fire(this, selectedSuggestion);
}
示例14: fireSuggestionEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private void fireSuggestionEvent(Integer selectedTimeSlot) {
SelectionEvent.fire(this, selectedTimeSlot);
}
示例15: fireSelectionEvent
import com.google.gwt.event.logical.shared.SelectionEvent; //導入方法依賴的package包/類
private void fireSelectionEvent(Suggestion suggestion) {
SelectionEvent.fire(this, suggestion);
}