当前位置: 首页>>代码示例>>Java>>正文


Java Event.getTopic方法代码示例

本文整理汇总了Java中org.osgi.service.event.Event.getTopic方法的典型用法代码示例。如果您正苦于以下问题:Java Event.getTopic方法的具体用法?Java Event.getTopic怎么用?Java Event.getTopic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgi.service.event.Event的用法示例。


在下文中一共展示了Event.getTopic方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
    String topic = event.getTopic();
    Object target = event.getProperty(MafiaBossConstants.PROPERTY_KEY_TARGET);

    switch (topic) {
        case MafiaBossConstants.TOPIC_CONVINCE:
            System.out.println("Ray: I helped in punching the shit out of" + target);
            break;
        case MafiaBossConstants.TOPIC_ENCASH:
            System.out.println("Ray: I helped getting the money from " + target);
            break;
        case MafiaBossConstants.TOPIC_SOLVE:
            System.out.println("Ray: I helped killing " + target);
            break;
        default: System.out.println("Ray: I helped with whatever was requested!");
    }
}
 
开发者ID:fipro78,项目名称:osgi-ds-getting-started-pde,代码行数:19,代码来源:Ray.java

示例2: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public void handleEvent(Event event) {  
	String itemName = (String) event.getProperty("item");
	
	String topic = event.getTopic();
	String[] topicParts = topic.split(TOPIC_SEPERATOR);
	
	if(!(topicParts.length > 2) || !topicParts[0].equals(TOPIC_PREFIX)) {
		return; // we have received an event with an invalid topic
	}
	String operation = topicParts[1];
	
	if(operation.equals(EventType.UPDATE.toString())) {
		State newState = (State) event.getProperty("state");
		if(newState!=null) receiveUpdate(itemName, newState);
	}
	if(operation.equals(EventType.COMMAND.toString())) {
		Command command = (Command) event.getProperty("command");
		if(command!=null) receiveCommand(itemName, command);
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:24,代码来源:AbstractEventSubscriber.java

示例3: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
	switch (event.getTopic()) {
	case "event_text_relating_objects/loaded": {
		// eventReceivedRelatingObjectsLoadedEvents(event.getProperty("org.eclipse.e4.data"));
		break;
	}
	case "ui_secondarySelection/corpusNavigator": {
		Object o = event.getProperty("org.eclipse.e4.data");
		if (o instanceof BTSObject) {
			eventReceivedSecondarySelection((BTSObject) o);
		}
		break;
	}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:SearchSelectObjectDialog.java

示例4: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
	public void handleEvent(Event event) {
		switch(event.getTopic())
		{
		case "event_text_relating_objects/loaded" :
		{
//			eventReceivedRelatingObjectsLoadedEvents(event.getProperty("org.eclipse.e4.data"));
			break;
		}
		case "event_text_relating_objects/selected" :
		{
			eventReceivedRelatingObjectsSelected(event.getProperty("org.eclipse.e4.data"));
			break;
		}
		}
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:AnnotationsPart.java

示例5: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
/**
 * Handle event.
 *
 * @param event the event
 */
@Override
public void handleEvent(Event event) {
	// System.out.println(arg0);
	if (event.getTopic().startsWith("event_text_selection/")) {
		eventReceivedCaretEvents(event.getTopic());
		return;
	}
	switch (event.getTopic()) {
	case "event_text_relating_objects/loaded": {
		break;
	}
	case "event_relating_objects/selected": {
		eventReceivedRelatingObjectsLoadedEvents(event
				.getProperty("org.eclipse.e4.data"));
		break;
	}
	}

}
 
开发者ID:cplutte,项目名称:bts,代码行数:25,代码来源:EgyTextEditorPart.java

示例6: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
	// System.out.println(arg0);
	if (event.getTopic().startsWith("event_text_selection/"))
	{
		eventReceivedCaretEvents(event.getTopic());
		return;
	}
	switch(event.getTopic())
	{
	case "event_text_relating_objects/loaded" :
	{
		break;
	}
	case "event_relating_objects/selected" :
	{
		eventReceivedRelatingObjectsLoadedEvents(event.getProperty("org.eclipse.e4.data"));
		break;
	}
	}
	

}
 
开发者ID:cplutte,项目名称:bts,代码行数:24,代码来源:EgyLemmaEditorPart.java

示例7: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent ( final Event event )
{
    logger.debug ( "Received event - {}", event.getTopic () );

    final String topic = event.getTopic ();
    final Object op = event.getProperty ( "operation" );

    if ( topic.startsWith ( "drone/channel/" ) )
    {
        if ( "remove".equals ( op ) || "refresh".equals ( op ) )
        {
            refresh ();
        }
    }
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:17,代码来源:UpgradeTaskProvider.java

示例8: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public void handleEvent(Event event) {
	String itemName = (String) event.getProperty("item");

	String topic = event.getTopic();
	String[] topicParts = topic.split(TOPIC_SEPERATOR);

	if (!(topicParts.length > 2) || !topicParts[0].equals(TOPIC_PREFIX)) {
		return; // we have received an event with an invalid topic
	}
	String operation = topicParts[1];

	if (operation.equals(EventType.COMMAND.toString())) {
		Command command = (Command) event.getProperty("command");
		if (command != null)
			receiveCommand(itemName, command);
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:21,代码来源:RuleEngine.java

示例9: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
	if(event.getTopic() == "iTrace/newgaze"){
		String[] propertyNames = event.getPropertyNames();
		Gaze g = (Gaze)event.getProperty(propertyNames[0]);
		 if (g != null) {
             if(!rootShell.isDisposed()){
            	 Rectangle monitorBounds = rootShell.getMonitor().getBounds();
            	 int screenX = (int) (g.getX() * monitorBounds.width);
	             int screenY = (int) (g.getY() * monitorBounds.height);
	             IGazeResponse response;
            	 response = handleGaze(screenX, screenY, g);
            	 
            	 if (response != null) {
	                	 if(recording){
	                		 statusLineManager
	                 			.setMessage(String.valueOf(response.getGaze().getSessionTime()));
	                 		registerTime = System.currentTimeMillis();
	                 		if(xmlOutput) eventBroker.post("iTrace/xmlOutput", response);
	                 		if(jsonOutput) eventBroker.post("iTrace/jsonOutput", response);
	                	 }
	                     
	                     if(response instanceof IStyledTextGazeResponse && response != null && showTokenHighlights){
	                     	IStyledTextGazeResponse styledTextResponse = (IStyledTextGazeResponse)response;
	                     	eventBroker.post("iTrace/newstresponse", styledTextResponse);
	                     }
	             }
	         }else{
	         	if((System.currentTimeMillis()-registerTime) > 2000){
	         		statusLineManager.setMessage("");
	         	}
	         }
         }
	}
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:36,代码来源:ITrace.java

示例10: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
	String topic = event.getTopic();
	if(topic.equals(EA_TOPIC_DEBUGGING_ACTION_RESUME)) {
		handleResumeEvent();
	} else if(topic.equals(EA_TOPIC_DEBUGGING_ACTION_STEP_OVER)) {
		handleStepOverEvent();
	}
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:10,代码来源:JimpleBreakpointManager.java

示例11: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(final Event event)
{
    switch (event.getTopic())
    {
        case ControlsCallback.SPEED_SUB_TOPIC:
            controller.setSpeed(Integer.getInteger(event.getProperty("speed").toString()));
            break;
        case ControlsCallback.BLEND_SUB_TOPIC:
            controller.setEffect(ControlsCallback.EffectType.valueOf(event.getProperty("blend").toString()));
            break;
    }
}
 
开发者ID:jtkb,项目名称:flexfx,代码行数:14,代码来源:AnimatedNode.java

示例12: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
    switch (event.getTopic()) {
        case REGENERATE_MDS_DATA_BUNDLE:
            handleMdsDataBundleRegeneration(event);
            break;
        case REGENERATE_MDS_DATA_BUNDLE_AFTER_DDE_ENHANCEMENT:
            handleMdsDataBundleRegenerationAfterDdeEnhancement(event);
            break;
        default:
            throw new IllegalStateException("Received an event with an unknown subject/topic: " + event.getTopic());
    }
}
 
开发者ID:motech,项目名称:motech,代码行数:14,代码来源:MdsBundleRegenerationServiceImpl.java

示例13: handleEvent

import org.osgi.service.event.Event; //导入方法依赖的package包/类
public void handleEvent(Event event) {
	String workflowRun = event.getProperty("RUN_ID").toString();
	switch (event.getTopic()) {
	case RunService.RUN_CLOSED:
	case RunService.RUN_DELETED:
		runSelectorComponent.removeObject(workflowRun);
		monitorGraphComponent.removeWorkflowRun(workflowRun);
		tableMonitorComponent.removeWorkflowRun(workflowRun);
		resultsComponent.removeWorkflowRun(workflowRun);
		if (selectionManager.getSelectedWorkflowRun().equals(workflowRun)) {
			List<String> runs = runService.getRuns();
			if (runs.isEmpty())
				selectionManager.setSelectedWorkflowRun(null);
			else
				selectionManager.setSelectedWorkflowRun(runs.get(0));
		}
		break;
	case RunService.RUN_CREATED:
	case RunService.RUN_OPENED:
		selectionManager.setSelectedWorkflowRun(workflowRun);
		break;
	case RunService.RUN_STOPPED:
	case RunService.RUN_PAUSED:
	case RunService.RUN_STARTED:
	case RunService.RUN_RESUMED:
		Tab<String> tab = runSelectorComponent.getTab(workflowRun);
		if (tab instanceof RunTab) {
			RunTab runTab = (RunTab) tab;
			runTab.updateTabIcon();
		}
		break;
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:34,代码来源:ResultsPerspectiveComponent.java


注:本文中的org.osgi.service.event.Event.getTopic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。