当前位置: 首页>>代码示例>>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;未经允许,请勿转载。