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


Java EventBus.addHandler方法代碼示例

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


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

示例1: ApplicationController

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public ApplicationController( @Nonnull final RosterTypeRepository rosterTypeRepository,
                              @Nonnull final RosterRepository rosterRepository,
                              @Nonnull final PersonRepository personRepository,
                              @Nonnull final RosterService rosterService,
                              @Nonnull final FrontendContext frontendContext,
                              @Nonnull final EntityChangeBroker broker,
                              @Nonnull final EventBus eventBus )
{
  AppData.controller = this;
  _rosterTypeRepository = rosterTypeRepository;
  _rosterRepository = rosterRepository;
  _personRepository = personRepository;
  _rosterService = rosterService;
  _frontendContext = frontendContext;
  _broker = broker;
  _loginUI = new ReactWidget( React.createElement( Login_.TYPE ) );
  _rosterListUI = new RosterListUI( this );
  _rosterUI = new RosterUI( this );
  _mainPanel = new SimplePanel();
  gotoLoginActivity();
  broker.addChangeListener( this );
  eventBus.addHandler( MetaDataSubscribeCompletedEvent.TYPE, e -> goToRosterListActivity() );
}
 
開發者ID:realityforge,項目名稱:replicant-example,代碼行數:25,代碼來源:ApplicationController.java

示例2: AddRelationshipPopup

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public AddRelationshipPopup(final OntoBrowserServiceAsync service,
		final EventBus eventBus) {
	this.service = service;
	this.eventBus = eventBus;
			
	dialogBox.setText("Add Relationship");
	dialogBox.setGlassEnabled(false);
	dialogBox.setAnimationEnabled(true);
	
	recentlyViewedDataProvider.addDataDisplay(recentlyViewTable);
	recentlyCreatedDataProvider.addDataDisplay(recentlyCreatedTable);
	
	addRelationshipTypes();
	setupTable(recentlyViewTable);
	setupTable(recentlyCreatedTable);
	addDialogWidgets();
	
	addButton.addClickHandler(this);
					
	eventBus.addHandler(ViewTermEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:22,代碼來源:AddRelationshipPopup.java

示例3: CodeListView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public CodeListView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus,service);
	
	Image emptyListWidget = new Image(ImageResources.INSTANCE.spinner());
	emptyListWidget.setStyleName("float-right");
	list.setEmptyListWidget(emptyListWidget);
	list.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
	list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
	list.setSelectionModel(selection);
	selection.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
		public void onSelectionChange(SelectionChangeEvent event) {
			Term selected = selection.getSelectedObject();
			if(selected != null) {
				History.newItem(selected.getReferenceId());
			}
		}
	});
			
	codelistContainer.add(list);
	
	initWidget(codelistContainer);
	addStyleName("padded-border vert-scroll");
	eventBus.addHandler(ViewTermEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:25,代碼來源:CodeListView.java

示例4: TermDetailsView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public TermDetailsView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus, service);
	
	for(int i = 0; i < LABELS.length; i++) {
		grid.setText(i, 0, LABELS[i] + ":");
	}
			
	CellFormatter cellFormatter = grid.getCellFormatter(); 
	for(int row = 0; row < grid.getRowCount(); row++) {
		cellFormatter.addStyleName(row, 0, "label");
	}
	
	panel.add(grid);
	initWidget(panel);
	addStyleName("padded-border vert-scroll fixed-height");
	
	eventBus.addHandler(ViewTermEvent.TYPE, this);
	eventBus.addHandler(TermUpdatedEvent.TYPE, this);
	eventBus.addHandler(TermDeletedEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:21,代碼來源:TermDetailsView.java

示例5: SVGView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public SVGView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus,service);
			
	if(supportsSVG()) {
		panel.getElement().setId("svgPanel");
		//svgContainer.getElement().getStyle().setOverflow(Overflow.AUTO);
		svgContainer.addClickHandler(this);
		
		panel.add(svgContainer);
		initWidget(panel);
		addStyleName("padded-border");
		eventBus.addHandler(ViewTermEvent.TYPE, this);
	} else {
		Label label = new Label("Your web browser does not support SVG");
		label.addStyleName("centered");
		initWidget(label);
	}
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:19,代碼來源:SVGView.java

示例6: ReplaceTermPopup

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public ReplaceTermPopup(final OntoBrowserServiceAsync service,
		final EventBus eventBus) {
	this.service = service;
	this.eventBus = eventBus;
			
	dialogBox.setText("Confirm term obsoletion");
	dialogBox.setGlassEnabled(false);
	dialogBox.setAnimationEnabled(true);
	
	recentlyViewedDataProvider.addDataDisplay(recentlyViewTable);
	recentlyCreatedDataProvider.addDataDisplay(recentlyCreatedTable);
	
	setupTable(recentlyViewTable);
	setupTable(recentlyCreatedTable);
	addDialogWidgets();
	
	commentsField.getElement().getParentElement().addClassName("text-area-right-padded");
	commentsField.setWidth("100%");
	commentsField.setVisibleLines(2);
	
	obsoleteButton.addClickHandler(this);

	eventBus.addHandler(ViewTermEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:25,代碼來源:ReplaceTermPopup.java

示例7: RelatedTermsView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public RelatedTermsView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus, service);
					
	table.addStyleName("gwt-CellTable");
	table.setWidth("100%");
	table.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
	table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
	table.setSelectionModel(new NoSelectionModel<Relationship>());
	
	table.addColumn(new RelationshipColumn(), "Relationship");
	table.addColumn(new RelatedTermColumn(), "Related Term");
	table.addColumn(new StatusColumn(), "Status");
			
	panel.add(table);
	initWidget(panel);
	addStyleName("padded-border vert-scroll fixed-height");
	
	eventBus.addHandler(ViewTermEvent.TYPE, this);
	eventBus.addHandler(RelationshipUpdatedEvent.TYPE, this);
	eventBus.addHandler(RelationshipDeletedEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:22,代碼來源:RelatedTermsView.java

示例8: PlaceHandler

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public PlaceHandler(
    PlaceHierarchyProvider placeHierarchyProvider,
    MasterPage masterPage,
    AuthManager authManager,
    HistoryProvider historyProvider,
    EventBus eventBus,
    ConnectionFailedHandler connectionFailedHandler) {
    this.placeHierarchyProvider = placeHierarchyProvider;
    this.masterPage = masterPage;
    this.authManager = authManager;
    this.historyProvider = historyProvider;
    this.eventBus = eventBus;
    this.connectionFailedHandler = connectionFailedHandler;

    historyProvider.addHandler(this);
    eventBus.addHandler(PlaceRequestEvent.TYPE, this);

    placeHierarchyProvider.createPlaceHierarchy();
}
 
開發者ID:inepex,項目名稱:ineform,代碼行數:20,代碼來源:PlaceHandler.java

示例9: TermSynonymsView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public TermSynonymsView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus, service);
	this.linkedTermsView = new ControlledVocabularyTermLinksView(service);
			
	SynonymColumn synonymColumn = new SynonymColumn();
	
	synonymColumn.setFieldUpdater(new FieldUpdater<Synonym, String>() {
		@Override
		public void update(int index, Synonym synonym, String value) {
			ControlledVocabularyTerm term = synonym.getControlledVocabularyTerm();
			if(term != null) {
				linkedTermsView.show(term);
			}
		}
	});
	synonymColumn.setCellStyleNames("clickable-text nowrap");
			
	table.addStyleName("gwt-CellTable");
	table.setWidth("100%");
	table.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
	table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
	table.setSelectionModel(new NoSelectionModel<Synonym>());
	
	table.addColumn(synonymColumn, "Synonym");
	table.addColumn(new TypeColumn(), "Type");
	table.addColumn(new ContextColumn(), "Context");
	table.addColumn(new SourceColumn(), "Source");
	table.addColumn(new ReferenceIdColumn(), "Id");
	table.addColumn(new StatusColumn(), "Status");
	
	panel.add(table);
	
	initWidget(panel);
	addStyleName("padded-border vert-scroll fixed-height");
	
	eventBus.addHandler(ViewTermEvent.TYPE, this);
	eventBus.addHandler(SynonymUpdatedEvent.TYPE, this);
	eventBus.addHandler(SynonymDeletedEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:40,代碼來源:TermSynonymsView.java

示例10: SearchInputView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public SearchInputView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus,service);
	
	DOM.setElementAttribute(searchInput.getElement(), 
			"placeholder", "Search");
	
	searchInput.addKeyDownHandler(this);	
	
	initWidget(searchInput);
	addStyleName("search");
	eventBus.addHandler(SearchEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:13,代碼來源:SearchInputView.java

示例11: SearchOptionsView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public SearchOptionsView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus, service);
	
	ontologiesDropBox.addItem("all");
	ontologiesDropBox.addChangeHandler(this);
	includeSynonyms.addClickHandler(this);		
	
	initWidget(createPanel());
	addStyleName("padded-border");
	
	eventBus.addHandler(SearchEvent.TYPE, this);
	service.loadRootTerms(new AsyncCallback<List<Term>>() {			
		@Override
		public void onSuccess(List<Term> terms) {				
			for(Term term : terms) {
				Ontology ontology = term.getOntology();
				String name = ontology.getName();
				ontologiesDropBox.addItem(name);
			}
		}
		
		@Override
		public void onFailure(Throwable caught) {
			GWT.log("Failed to load root terms", caught);
			ErrorView.instance().onUncaughtException(caught);
		}
	});
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:29,代碼來源:SearchOptionsView.java

示例12: SearchResultsView

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public SearchResultsView(EventBus eventBus,
		OntoBrowserServiceAsync service, 
		SearchOptionsProvider searchOptions) {
	super(eventBus,service);
	this.searchOptions = searchOptions;
					
	initWidget(createPanel());
	addStyleName("search-results padded-border vert-scroll");
	
	eventBus.addHandler(SearchEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:12,代碼來源:SearchResultsView.java

示例13: ApproveRejectSynonymComposite

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public ApproveRejectSynonymComposite(OntoBrowserServiceAsync service,
		EventBus eventBus, Curator curator, BusyIndicatorHandler busyIndicatorHandler) {
	super(Entity.TERM_SYNONYM, service, eventBus, curator, busyIndicatorHandler, 
			new EditSynonymPopup(service, eventBus));
	this.linkedTermsView = new ControlledVocabularyTermLinksView(service);
	eventBus.addHandler(SynonymUpdatedEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:8,代碼來源:ApproveRejectSynonymComposite.java

示例14: start

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
@Override
public void start(AcceptsOneWidget acceptsOneWidget, EventBus eventBus) {
    setView(App.getClientFactory().getManageNotesView());
    super.start(acceptsOneWidget, eventBus);
    populateNoteListFilter();
    getView().disableBulkActions();
    eventBus.addHandler(NotesLoadedEvent.TYPE, new NotesLoadedEventHandler() {
        @Override
        public void onNotesLoaded(List<Note> items) {
            NoteList currentList = App.getNoteListService().getNoteList(getView().getNoteListFilter().getSelectedValue().id);
            getView().getNotesTable().inputNotes(filterNotes(currentList));
            App.getEventBus().fireEvent(new ShowMessageEvent("NEW! Double click a note to edit!"));
        }
    });
    eventBus.addHandler(NoteListsModifiedEvent.TYPE, new NoteListsModifiedEventHandler() {
        @Override
        public void onNoteListsModified(Map<Long, NoteList> noteLists) {
            populateNoteListFilter();
        }
    });
    eventBus.addHandler(NoteListAddedEvent.TYPE, new NoteListAddedHandler() {
        @Override
        public void onNoteListAdded(ArrayList<NoteList> allLists, NoteList noteList) {
            populateNoteListFilter();
        }
    });
    App.getClientNoteItemService().findNotes(getView());
    getView().show();
}
 
開發者ID:turbomanage,項目名稱:listmaker,代碼行數:30,代碼來源:ManageNotesActivity.java

示例15: AddSynonymPopup

import com.google.gwt.event.shared.EventBus; //導入方法依賴的package包/類
public AddSynonymPopup(OntoBrowserServiceAsync service,
		EventBus eventBus) {
	this.service = service;
	this.eventBus = eventBus;
	synonymField.setMaxLength(MAX_LEN);
	synonymField.setVisibleLength(VIS_LEN);
	synonymField.addKeyPressHandler(this);
	synonymField.addKeyUpHandler(this);
	synonymField.addValueChangeHandler(this);
	
	for(Synonym.Type type : Synonym.Type.values()) {
		typeDropBox.addItem(type.toString(), type.name());
	}
	typeDropBox.setSelectedIndex(typeDropBox.getItemCount()-1);
	
	sourceDropBox.addChangeHandler(this);
	referenceIdField.setMaxLength(MAX_LEN);
	referenceIdField.setVisibleLength(VIS_LEN);
	referenceIdField.setEnabled(false);
	referenceIdField.addKeyPressHandler(this);
	referenceIdField.addKeyUpHandler(this);
	referenceIdField.addValueChangeHandler(this);
	
	dialogBox.setText("Add Synonym");
	dialogBox.setGlassEnabled(true);
	dialogBox.setAnimationEnabled(true);
	dialogBox.addStyleName("gwt-ModalDialogBox");
			
	addDialogWidgets();
	
	service.loadPublicDatasources(new AsyncCallback<List<Datasource>>() {
		@Override
		public void onFailure(Throwable caught) {
			GWT.log("Failed to load public datasources", caught);
			ErrorView.instance().onUncaughtException(caught);
		}

		@Override
		public void onSuccess(List<Datasource> datasources) {
			Collections.sort(datasources, new DatasourceAcronymComparator());
			sourceDropBox.addItem("", "");
			for(Datasource datasource : datasources) {
				String label = datasource.getAcronym() + " - " + datasource.getName();
				sourceDropBox.addItem(label, datasource.getAcronym());
			}
			sourceDropBox.setSelectedIndex(0);
		}
	});
	
	addButton.addClickHandler(this);
	addButton.setEnabled(false);
			
	eventBus.addHandler(ViewTermEvent.TYPE, this);
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:55,代碼來源:AddSynonymPopup.java


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