org.eclipse.e4.ui.di.UIEventTopic Java Examples

The following examples show how to use org.eclipse.e4.ui.di.UIEventTopic. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FaelleView.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Optional
@Inject
void compatitbility(
	@UIEventTopic(ElexisEventTopics.PERSISTENCE_EVENT_COMPATIBILITY + "*") Object object){
	if (object instanceof ICoverage
		|| (object instanceof Class && object.equals(ICoverage.class))) {
		// refresh from database if modified by po
		if (actPatient != null) {
			if (object instanceof ICoverage) {
				CoreModelServiceHolder.get().refresh((ICoverage) object, true);
			}
			CoreModelServiceHolder.get().refresh(actPatient, true);
		}
		refreshTableViewer();
	}
}
 
Example #2
Source File: CoreUiUtil.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
@Optional
public void subscribeAppStartupComplete(
	@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) Event event, UISynchronize sync){
	
	synchronized (lock) {
		Object property = event.getProperty("org.eclipse.e4.data");
		if (property instanceof MApplication) {
			MApplication application = (MApplication) property;
			// A RAP application has one application context per client
			// the resp. context service implementation considers this
			contextService.getRootContext().setNamed("applicationContext",
				application.getContext());
			
			if (!delayedInjection.isEmpty()) {
				for (Object object : delayedInjection) {
					sync.asyncExec(() -> {
						injectServices(object);
					});
				}
				delayedInjection.clear();
			}
		}
	}
}
 
Example #3
Source File: AccountsPart.java    From offspring with MIT License 6 votes vote down vote up
@Inject
@Optional
private void onAccountUpdateBalance(
    @UIEventTopic(INxtService.TOPIC_ACCOUNT_UPDATE_BALANCE) IAccount account,
    IUserService userService) {

  IUser active = userService.getActiveUser();
  if (active != null) {

    IUser user = userService.getUser(account);
    if (user != null) {
      AccountButtonComposite c = findAccountButtonComposite(user);
      if (c != null) {
        c.setBalance(account.getBalance(), account.getUnconfirmedBalance());
      }
      if (user.equals(active)) {
        setActiveUserBalance(account.getBalance());
      }
    }
  }
  updateTotalBalance();
}
 
Example #4
Source File: PreferenceInitializerAddon.java    From saneclipse with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
@Optional
public void name(@UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) Event event) {
	if(!preferencesInitialized) {
		preferencesInitialized = true;
		configureJDTUi();
		configureJDTCore();
		configurePDEUi();
		configureIde();
		configureWorkbench();
		configurePerformanceMonitoring();
		configureDebug();
		configureEditor();
		configureXMLEditor();
		configureMemoryMonitorActive();
	}
}
 
Example #5
Source File: MedicationView.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Optional
@Inject
void updatePrescription(
	@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IPrescription prescription){
	if (CoreUiUtil.isActiveControl(tpc)) {
		if (prescription != null) {
			if (!getMedicationComposite().isShowingHistory()) {
				EntryType entryType = prescription.getEntryType();
				if (entryType == EntryType.RECIPE || entryType == EntryType.SELF_DISPENSED) {
					return;
				}
			}
			updateUi(prescription.getPatient(), true);
		}
	}
}
 
Example #6
Source File: FaelleView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
void reloadCoverage(@UIEventTopic(ElexisEventTopics.EVENT_RELOAD) Class<?> iCoverage){
	if (ICoverage.class.equals(iCoverage)) {
		refreshTableViewer();
	}
}
 
Example #7
Source File: StockView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
public void udpate(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IStockEntry entry){
	if (entry != null) {
		if (viewer != null && !viewer.getControl().isDisposed()) {
			viewer.update(entry, null);
		}
	}
}
 
Example #8
Source File: EigenartikelSelector.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
@Optional
public void reload(@UIEventTopic(ElexisEventTopics.EVENT_RELOAD) Class<?> clazz){
	if (IArticle.class.equals(clazz)) {
		if (commonViewer != null && !commonViewer.isDisposed()) {
			commonViewer.getViewerWidget().refresh();
		}
	}
}
 
Example #9
Source File: DocumentsView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
void udpateDocument(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IDocument document){
	if (document != null && viewer != null && !viewer.getControl().isDisposed()) {
		ViewContentProvider viewContentProvider =
			(ViewContentProvider) viewer.getContentProvider();
		viewContentProvider.updateElement(document);
		//the selection of TreeItem is disposed after updating a document with a dialog
		table.deselectAll();
		viewer.refresh();
	}
}
 
Example #10
Source File: StockDetailComposite.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
public void udpate(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IStockEntry entry){
	if (entry != null) {
		if (checkboxTableViewer != null && stockEntries != null
			&& !checkboxTableViewer.getControl().isDisposed()) {
			for (IStock key : stockEntries.keySet()) {
				if (stockEntries.get(key) != null && stockEntries.get(key).equals(entry)) {
					refreshData();
				}
			}
		}
	}
}
 
Example #11
Source File: EigenartikelDetailDisplay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
@Optional
public void lockAquired(
	@UIEventTopic(ElexisEventTopics.EVENT_LOCK_AQUIRED) IArticle typedArticle){
	if (epc != null && !epc.isDisposed()
		&& typedArticle.getId().equals(selectedObject.getId())) {
		epc.setUnlocked(true);
	}
}
 
Example #12
Source File: BlockDetailDisplay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@org.eclipse.e4.core.di.annotations.Optional
@Inject
public void update(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) ICodeElementBlock block){
	if (block != null && master.getValue() != null && master.getValue().equals(block)) {
		updateViewerInput(block);
	}
}
 
Example #13
Source File: EigenartikelSelector.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
public void update(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IArticle object){
	if (commonViewer != null && object != null) {
		commonViewer.getViewerWidget().update(object, null);
	}
}
 
Example #14
Source File: DocumentsView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
void reloadDocument(@UIEventTopic(ElexisEventTopics.EVENT_RELOAD) IDocument document){
	if (viewer != null && !viewer.getControl().isDisposed()) {
		viewer.refresh();
	}
}
 
Example #15
Source File: PatientenListeView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
void changedMandator(
	@Optional @UIEventTopic(ElexisEventTopics.EVENT_USER_CHANGED) IUser user){
	if (created) {
		Display.getDefault().asyncExec(() -> {
			userChanged();
		});
	}
}
 
Example #16
Source File: KonsListe.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
void changedCoverage(@UIEventTopic(ElexisEventTopics.BASE_MODEL + "*") ICoverage iCoverage){
	if (iCoverage != null) {
		actPatient = iCoverage.getPatient();
		restart(false);
	}
}
 
Example #17
Source File: KonsDetailView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
void changedMandator(
	@Optional @UIEventTopic(ElexisEventTopics.EVENT_USER_CHANGED) IUser mandator){
	if (created) {
		Display.getDefault().asyncExec(() -> {
			adaptMenus();
		});
	}
}
 
Example #18
Source File: DocumentsView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
void createDocument(@UIEventTopic(ElexisEventTopics.EVENT_CREATE) IDocument document){
	if (viewer != null && !viewer.getControl().isDisposed()) {
		ViewContentProvider viewContentProvider =
			(ViewContentProvider) viewer.getContentProvider();
		viewContentProvider.updateElement(document);
		viewer.refresh();
	}
}
 
Example #19
Source File: KonsDetailView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
void reloadPatient(@Optional @UIEventTopic(ElexisEventTopics.EVENT_RELOAD) IPatient patient){
	if (created) {
		actPat = null; // make sure patient will be updated
		setPatient(patient);
	}
}
 
Example #20
Source File: MyBuyOrdersPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onAssetSelected(
    @UIEventTopic(IAssetExchange.TOPIC_ASSET_SELECTED) Asset asset) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}
 
Example #21
Source File: MyBuyOrdersPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
public void partActivation(
    @UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) Event event) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}
 
Example #22
Source File: MyBuyOrdersPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onActiveUserChanged(
    @UIEventTopic(IUserService.TOPIC_ACTIVEUSER_CHANGED) IUser user) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}
 
Example #23
Source File: BidOrdersPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onAssetSelected(
    @UIEventTopic(IAssetExchange.TOPIC_ASSET_SELECTED) Asset asset) {
  if (ordersViewer != null && !ordersViewer.getControl().isDisposed()) {
    ordersViewer.setInput(asset.getId());
    ordersViewer.refresh();
  }
}
 
Example #24
Source File: AssetsPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onAssetSelected(
    @UIEventTopic(IAssetExchange.TOPIC_ASSET_SELECTED) Asset asset) {
  if (assetsViewer != null && !assetsViewer.getControl().isDisposed()) {
    IStructuredSelection selection = (IStructuredSelection) assetsViewer
        .getSelection();
    Object selectedAsset = selection.getFirstElement();
    if (selectedAsset instanceof Asset && asset instanceof Asset) {
      if (!selectedAsset.equals(asset)) {
        assetsViewer.setSelection(new StructuredSelection(asset));
      }
    }
  }
}
 
Example #25
Source File: AssetsPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
public void partActivation(
    @UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) Event event) {
  if (assetsViewer != null && !assetsViewer.getControl().isDisposed()) {
    assetsViewer.refresh();
  }
}
 
Example #26
Source File: AssetsPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onInitializationFinished(
    @UIEventTopic(INxtService.TOPIC_INITIALIZATION_FINISHED) int dummy) {
  if (assetsViewer != null && !assetsViewer.getControl().isDisposed()) {
    assetsViewer.refresh();
  }
}
 
Example #27
Source File: BlockSelector.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Optional
@Inject
public void udpateBlock(
	@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) ICodeElementBlock block){
	if (block != null && cv != null && cv.getViewerWidget() != null
		&& !cv.getViewerWidget().getControl().isDisposed()) {
		BlockTreeViewerItem item = blockItemMap.get(block);
		cv.getViewerWidget().refresh(item, true);
	}
}
 
Example #28
Source File: MyAssetsPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
public void partActivation(
    @UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) Event event) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}
 
Example #29
Source File: MyAssetsPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
private void onActiveUserChanged(
    @UIEventTopic(IUserService.TOPIC_ACTIVEUSER_CHANGED) IUser user) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}
 
Example #30
Source File: MySellOrdersPart.java    From offspring with MIT License 5 votes vote down vote up
@Inject
@Optional
public void partActivation(
    @UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) Event event) {
  if (viewer != null && !viewer.getControl().isDisposed()) {
    viewer.refresh();
  }
}