本文整理匯總了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!");
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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 ();
}
}
}
示例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);
}
}
示例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("");
}
}
}
}
}
示例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();
}
}
示例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;
}
}
示例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());
}
}
示例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;
}
}