本文整理汇总了Java中org.eclipse.e4.ui.di.UIEventTopic类的典型用法代码示例。如果您正苦于以下问题:Java UIEventTopic类的具体用法?Java UIEventTopic怎么用?Java UIEventTopic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIEventTopic类属于org.eclipse.e4.ui.di包,在下文中一共展示了UIEventTopic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject @Optional
private void init(@UIEventTopic(TermSuiteEvents.EDITOR_INITIATED) Object part, MPart mPart) {
if(this == part) {
EPipeline pipeline = (EPipeline) context.get(TermSuiteUI.INPUT_OBJECT);
this.pipelineValue.setValue(pipeline);
this.context.set(EPipeline.class, pipeline);
pipeline.eAdapters().add(new EContentAdapter() {
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
if(notification.getFeature().equals(TermsuiteuiPackage.eINSTANCE.getEPipeline_Name())) {
mPart.setLabel(notification.getNewStringValue());
} else {
// set dirty, unless this is a pipeline rename
dirty.setDirty(true);
validatePipeline();
}
}
});
validatePipeline();
}
}
示例2: updateUIWithClientIdAndConnectionStatus
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
public void updateUIWithClientIdAndConnectionStatus(@UIEventTopic(CONNECTED_EVENT_TOPIC) final Object message) {
if (message instanceof Object[]) {
this.uiSynchronize.asyncExec(new Runnable() {
@Override
public void run() {
PublishPart.this.textRequesterClientId.setText(((Object[]) message)[1].toString());
PublishPart.this.textRequestId.setText(generateRequestId());
PublishPart.this.form.setImage(
PublishPart.this.bundleResourceService.loadImage(this.getClass(), ONLINE_STATUS_IMAGE));
setTootipConnectionStatus(PublishPart.this.uiSynchronize, PublishPart.this.buttonPublish,
((Object[]) message)[0].toString(), true);
mqttClient = (IKuraMQTTClient) ((Object[]) message)[2];
}
});
}
}
示例3: eventReceivedRelatingObjectsFilterChanged
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
void eventReceivedRelatingObjectsFilterChanged(
@UIEventTopic(BTSUIConstants.EVENT_TEXT_RELATING_OBJECTS_TOGGLE_FILTER) final String filter) {
@SuppressWarnings("unchecked")
HashMap<String, Boolean> filters = (HashMap<String, Boolean>) context.get("org.bbaw.bts.corpus.annotationsPart.filter");
// toggle
//String key = "org.bbaw.bts.ui.corpus.part.annotations.viewmenu.show." + filter;
String key = filter;
if (filters.containsKey(key)) {
filters.put(key, !filters.get(key));
}
if (this.relatingObjectsEvent != null) {
eventReceivedRelatingObjectsLoaded(relatingObjectsEvent);
}
eventBroker.post("event_anno_filters/anno_part",
new BTSRelatingObjectsFilterEvent(filters));
}
示例4: subscribeToPositionTreeRemoveTopic
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
public void subscribeToPositionTreeRemoveTopic(
@UIEventTopic(OrderServiceEvents.TOPIC_POSITION_TREE_REMOVE) final PositionWithOrderAndArticleInfoDTO deletedPosition) {
OrderId orderIdInTreeLoaded = deletedPosition.getOrderId();
if (cachedPositions.containsKey(orderIdInTreeLoaded)) {
OrderPositionsTreeviewDTO children = cachedPositions.get(orderIdInTreeLoaded);
if (!children.removePosition(deletedPosition.getPosition())) {
LOGGER.info("Position " + deletedPosition + " in OrderTreeView already removed."
+ " You are firing too many events!");
} else {
LOGGER.info("Position " + deletedPosition.getPosition() + " from OrderTreeView removed.");
}
viewer.refresh(deletedPosition.getOrder(), false);
}
}
示例5: subscribeTopicSelectedElement
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
public void subscribeTopicSelectedElement(
@UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event,
MApplication application) {
Object newValue = event.getProperty(EventTags.NEW_VALUE);
if (newValue instanceof MPerspective) {
boolean isPerspectiveOne = ((MPerspective) newValue).getElementId().equals(PERSPECTIVE_ONE);
MTrimBar top = (MTrimBar) modelService.find("org.eclipse.ui.trimbar.top", application.getChildren().get(0));
for (MTrimElement item : top.getChildren()) {
if ((isPerspectiveOne && item.getElementId().equals(SECOND_TOOLBAR))
|| !isPerspectiveOne && item.getElementId().equals(FIRST_TOOLBAR)) {
item.setVisible(false);
}
else if ((!isPerspectiveOne && item.getElementId().equals(SECOND_TOOLBAR))
|| isPerspectiveOne && item.getElementId().equals(FIRST_TOOLBAR)) {
item.setVisible(true);
}
}
}
}
示例6: onAccountUpdateBalance
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@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();
}
示例7: onPeerEvent
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
private void onPeerEvent(@UIEventTopic(INxtService.TOPIC_PEER) Peer peer) {
if (peersText != null && !peersText.isDisposed()) {
int active = nxt.getAllConnectedPeers().size();
int known = nxt.getAllWellknownPeers().size();
int blacklisted = nxt.getAllBlacklistedPeers().size();
peersText.setText(createPeerText(active, known, blacklisted));
peersText.pack();
long downloadVolume = 0;
long uploadVolume = 0;
for (Peer p : nxt.getAllConnectedPeers()) {
downloadVolume += p.getDownloadedVolume();
uploadVolume += p.getUploadedVolume();
}
downloadsText.setText(createDownloadsText(downloadVolume, uploadVolume));
downloadsText.pack();
mainComposite.layout();
}
}
示例8: setRootPath
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
private void setRootPath(@UIEventTopic(PartEvents.TOPIC_PART_PATH_OPEN) final Path newPath) {
// update root path of current tab
if (activePart != null && activePart.getObject() == this) {
rootPath = newPath;
if (table != null) {
table.setRootPath(rootPath);
// update scroll-bars
table.updateResize();
resolveSelections(activePart);
}
}
}
示例9: execute
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
@Execute
public void execute(@UIEventTopic(PartEvents.TOPIC_PART_PATH_OPEN) final Path newPath) {
// store root path
context.set(IdStorage.STATE_ROOT_PATH, newPath);
// Store the root path of opening part
if (activePart != null && newPath != null) {
Map<String, String> state = activePart.getPersistedState();
state.put(IdStorage.STATE_ROOT_PATH, newPath.toString());
if (log.isDebugEnabled()) {
log.debug(newPath.toString() + " path was stored into active part state"); //$NON-NLS-1$
}
}
}
示例10: name
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@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();
}
}
示例11: updateHandler
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
void updateHandler(
@UIEventTopic(EventConstants.DATA_UPDATE_UPDATED) BenchmarkModel model) {
this.model = model.getModel();
// run algorithms;
if (model != null) {
Experiment_Evaluate eval = new Experiment_Evaluate();
eval.SetFileConfig(Constant.ALGO_CONFIG_FILE);
eval.setModel(this.model);
eval.run();
} else {
System.out.println("No input data");
}
updateResult(Constant.RESULT_FILE, model.getEvalID());
}
示例12: trackFontSize
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Inject
@Optional
public void trackFontSize(
@UIEventTopic("org_elbe_relations_defaultbrowser_internal_DefaultBrowserPart") final int inFontSize) {
if (inFontSize != 0) {
Font lFont = null;
final Map<IItemModel, GraphicalEditPart> lRegistry = viewer.getEditPartRegistry();
for (final GraphicalEditPart lPart : lRegistry.values()) {
final IFigure lFigure = lPart.getFigure();
if (lFigure instanceof ItemFigure) {
final ItemFigure lItemFigure = (ItemFigure) lFigure;
if (lFont == null) {
lFont = lItemFigure.getFont();
final FontData lData = lFont.getFontData()[0];
lData.setHeight(inFontSize);
lFont = new Font(Display.getCurrent(), lData);
}
lItemFigure.setFont(lFont);
}
}
}
}
示例13: syncContent
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Override
@Inject
@Optional
public void syncContent(
@UIEventTopic(RelationsConstants.TOPIC_FROM_BROWSER_MANAGER_SYNC_CONTENT) final ItemAdapter inItem) {
if (!visible) {
return;
}
if (selected == null || selected.isDisposed()) {
return;
}
try {
selected.setText(inItem.getTitle());
} catch (final VException exc) {
log.error(exc, exc.getMessage());
}
}
示例14: setStyle
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
@Inject
@Optional
public void setStyle(
@UIEventTopic(RelationsConstants.TOPIC_STYLE_CHANGE_FORM) final Styles.StyleEvent inEvent) {
if (textWidget == null) {
return;
}
if (!(isFormStyle ^ inEvent.isFormStyle)
&& inEvent.style.isToggle()) {
final TextStyler lStyler = new TextStyler(textWidget);
lStyler.format(inEvent.style, inEvent.isFormatNew);
final int lOffset = textWidget.getCaretOffset();
notifyPositionChange(Math.max(lOffset,
lOffset - textWidget.getSelectionCount()));
}
}
示例15: updateEditChanges
import org.eclipse.e4.ui.di.UIEventTopic; //导入依赖的package包/类
/**
* We have edited the item in the edit wizard, therefore, we have to
* synchronize the inspector content.
*
* @param inItem
* {@link ItemAdapter}
*/
@Inject
@Optional
void updateEditChanges(
@UIEventTopic(RelationsConstants.TOPIC_FROM_BROWSER_MANAGER_SYNC_CONTENT) final ItemAdapter inItem) {
if (isSending) {
return;
}
if (inItem == null || !inItem.equals(item)) {
return;
}
final InspectorViewVisitor lVisitor = new InspectorViewVisitor();
try {
item.visit(lVisitor);
displayType.refresh(title, styledText, lVisitor);
}
catch (VException | IOException | SAXException exc) {
log.error(exc, exc.getMessage());
}
clearDirty();
}