use of de.mossgrabers.framework.view.Views in project DrivenByMoss by git-moss.
the class AbstractControllerSetup method activateBrowserObserver.
/**
* De-/Activate the browser view depending on the browsers' active state.
*
* @param browserView The view to hide/show when the browser becomes de-/active
*/
protected void activateBrowserObserver(final Views browserView) {
this.model.getBrowser().addActiveObserver(isActive -> {
final ViewManager viewManager = this.getSurface().getViewManager();
if (isActive.booleanValue()) {
final Views previousViewId = viewManager.getPreviousID();
viewManager.setTemporary(browserView);
if (viewManager.getPreviousID() == Views.SHIFT)
viewManager.setPreviousID(previousViewId);
} else if (viewManager.isActive(browserView))
viewManager.restore();
});
}
use of de.mossgrabers.framework.view.Views in project DrivenByMoss by git-moss.
the class ViewMultiSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != this.triggerEvent)
return;
final ViewManager viewManager = this.surface.getViewManager();
final Views activeViewId = viewManager.getActiveID();
int index = this.viewIds.indexOf(activeViewId) + 1;
if (index < 0 || index >= this.viewIds.size())
index = 0;
final Views viewId = this.viewIds.get(index);
if (viewManager.isActive(viewId))
return;
viewManager.setActive(viewId);
if (this.displayName)
this.surface.getDisplay().notify(viewManager.get(viewId).getName());
}
Aggregations