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


Java SelectionHandler類代碼示例

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


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

示例1: TreePanel

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例2: BaseTree

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例3: initLayerCombo1

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例4: getTabPanelSelectionHandler

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例5: initContentOracle

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例6: getDeleteSelectionHandler

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例7: TableInfoPanel

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例8: testSelectionEvent

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例9: init

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的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

示例10: AddMemberBox

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
public AddMemberBox(final String buttonLabel, String hint, SuggestOracle suggestOracle) {
  addPanel = new FlowPanel();
  addMember = new Button(buttonLabel);

  suggestBox = new RemoteSuggestBox(suggestOracle);
  suggestBox.setStyleName(Gerrit.RESOURCES.css().addMemberTextBox());
  suggestBox.setVisibleLength(50);
  suggestBox.setHintText(hint);
  suggestBox.addSelectionHandler(
      new SelectionHandler<String>() {
        @Override
        public void onSelection(SelectionEvent<String> event) {
          addMember.fireEvent(new ClickEvent() {});
        }
      });

  addPanel.add(suggestBox);
  addPanel.add(addMember);

  initWidget(addPanel);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:22,代碼來源:AddMemberBox.java

示例11: LazyStackPanel

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
public LazyStackPanel() {

        initWidget(flexTable);

        flexTable.setStyleName("guvnor-lazyStackPanel");

        addSelectionHandler(new SelectionHandler<LazyStackPanelRow>() {

            public void onSelection(SelectionEvent<LazyStackPanelRow> event) {
                LazyStackPanelRow row = event.getSelectedItem();
                if (row.isExpanded()) {
                    row.compress();
                } else {
                    row.expand();
                }
            }
        });
    }
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:19,代碼來源:LazyStackPanel.java

示例12: onModuleLoad

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
/**
 * This is the entry point method.
 */
public void onModuleLoad() {
  HorizontalPanel mainPanel = new HorizontalPanel();

  final MiddlePanel mPanel = new MiddlePanel();

  Tree menu = new Tree();
  menu.addSelectionHandler(new SelectionHandler<TreeItem>() {
    public void onSelection(SelectionEvent<TreeItem> event) {
      mPanel.set((MenuItem) event.getSelectedItem());
    }
  });

  initMenu(menu);
  mainPanel.add(menu);
  mainPanel.add(mPanel);
  menu.setSelectedItem(menu.getItem(0));
  mainPanel.setStyleName("mvp4gshowcase");
  RootPanel.get()
           .add(mainPanel);
}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:24,代碼來源:Mvp4gShowCase.java

示例13: ButtonGroup

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
public ButtonGroup() {
	super();
	addSelectionHandler(new SelectionHandler<UIObject>() {

		@Override
		public void onSelection(SelectionEvent<UIObject> event) {
			if (onItemSelected != null) {
				try {
					JavaScriptObject jsItem = event.getSelectedItem() instanceof HasPublished ? ((HasPublished)event.getSelectedItem()).getPublished() : null; 
					Utils.executeScriptEventVoid(published, onItemSelected, EventsPublisher.publishItemEvent(published, jsItem));
				} catch (Exception e) {
					Logger.getLogger(EventsExecutor.class.getName()).log(Level.SEVERE, null, e);
				}
			}
		}

	});
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:19,代碼來源:ButtonGroup.java

示例14: setItemSelected

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
public void setItemSelected(JavaScriptObject aValue) {
	if (itemSelected != aValue) {
		if (selectedItemReg != null) {
			selectedItemReg.removeHandler();
			selectedItemReg = null;
		}
		itemSelected = aValue;
		if (component instanceof HasSelectionHandlers<?>) {
			selectedItemReg = ((HasSelectionHandlers<Object>) component).addSelectionHandler(new SelectionHandler<Object>() {

				@Override
				public void onSelection(SelectionEvent<Object> event) {
					JavaScriptObject published = ((HasPublished) event.getSource()).getPublished();
					Object oItem = event.getSelectedItem();
					if (oItem instanceof HasPublished)
						oItem = ((HasPublished) oItem).getPublished();
					executeEvent(itemSelected, EventsPublisher.publishItemEvent(published, oItem instanceof JavaScriptObject ? (JavaScriptObject) oItem : null));
				}

			});
		}
	}
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:24,代碼來源:EventsExecutor.java

示例15: setExchangePlaces

import com.google.gwt.event.logical.shared.SelectionHandler; //導入依賴的package包/類
@Override
public void setExchangePlaces(List<ExchangePlaceDTO> places) {
	if (places != null && places.size() > 0) {
		for (final ExchangePlaceDTO place : places) {
			MenuItem placeItem = new MenuItem(place.getLabel());
			Menu subMenu = new Menu();
			placeItem.setSubMenu(subMenu);
			currencyMenu.add(placeItem);

			for (final String currencyCode : place.getCurrencyCodes()) {
				MenuItem currencyItem = new MenuItem(currencyCode);
				currencyItem.addSelectionHandler(new SelectionHandler<Item>() {
					public void onSelection(SelectionEvent<Item> event) {
						presenter.loadCurrencyDetails(place, currencyCode);
					}
				});
				subMenu.add(currencyItem);
			}
		}
		currencyButton.setEnabled(true);
	}
}
 
開發者ID:Stratehm,項目名稱:multipool-stats-backend,代碼行數:23,代碼來源:AbstractPoolView.java


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