315316317318319320321322323324325
// this is a more elegant solution. if (app != null) { ControlArb controlArb = app.getControlArb(); if (controlArb != null) { if (controlArb.hasControl()) { controlArb.releaseControl(); } } } } break;
284285286287288289290291292293294
case TOGGLE_CONTROL: ControlArb controlArb = view.getWindow().getApp().getControlArb(); if (controlArb.hasControl()) { logger.info("Release control"); controlArb.releaseControl(); } else { logger.info("Take control"); controlArb.takeControl(); } break;
480481482483484485486487488489490
// Perform the control toggle immediately ControlArb controlArb = app.getControlArb(); if (controlArb != null) { if (controlArb.hasControl()) { controlArb.releaseControl(); } else { controlArb.takeControl(); } } return EventAction.DISCARD;