Examples of MPerspectiveStack


Examples of org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack

    return ! perspective.getElementId().equals(perspectiveId);
  }
 
  @Execute
  void execute(EPartService partService, MPerspective current, MWindow window, @Named("at.bestsolution.efxclipse.testcases.e4.command.2.perspective") String perspectiveId) {
    MPerspectiveStack stack = (MPerspectiveStack) window.getChildren().get(0);
    for( MPerspective p : stack.getChildren() ) {
      if( perspectiveId.equals(p.getElementId()) ) {
        partService.switchPerspective(p);
        break;
      }
    }
View Full Code Here

Examples of org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack

      @Override
      public void handleEvent(Event event) {
        Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
        if (changedObj instanceof MPerspectiveStack) {
          MPerspectiveStack parent = (MPerspectiveStack) changedObj;
          if (BasePerspectiveStackRenderer.this == parent.getRenderer()) {
            String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);

            if (UIEvents.EventTypes.ADD.equals(eventType)) {
              MUIElement element = (MUIElement) event.getProperty(UIEvents.EventTags.NEW_VALUE);
              handleChildAddition(parent, (MPerspective) element);
            } else if (UIEvents.EventTypes.REMOVE.equals(eventType)) {
              MUIElement element = (MUIElement) event.getProperty(UIEvents.EventTags.OLD_VALUE);
              handleChildRemove(parent, (MPerspective) element);
            }
          }
        }
      }
    });
    eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, new EventHandler() {

      @Override
      public void handleEvent(Event event) {
        Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
        if (changedObj instanceof MPerspectiveStack) {
          MPerspectiveStack parent = (MPerspectiveStack) changedObj;
          if (BasePerspectiveStackRenderer.this == parent.getRenderer()) {
            String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);
            if (UIEvents.EventTypes.SET.equals(eventType)) {
              MUIElement newValue = (MUIElement) event.getProperty(UIEvents.EventTags.NEW_VALUE);
              MUIElement oldValue = (MUIElement) event.getProperty(UIEvents.EventTags.OLD_VALUE);
              handleSelectedElement(parent, (MPerspective) oldValue, (MPerspective) newValue);
            }
          }
        }
      }
    });
    eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, new EventHandler() {

      @Override
      public void handleEvent(Event event) {
        MUIElement changedObj = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
        if (changedObj.isToBeRendered()) {
          MUIElement parent = changedObj.getParent();
          // Can be null for e.g. detached windows!!!
          if( parent != null ) {
            if (BasePerspectiveStackRenderer.this == parent.getRenderer()) {
              MPerspectiveStack stack = (MPerspectiveStack) parent;
              String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);
              if (UIEvents.EventTypes.SET.equals(eventType)) {
                Boolean newValue = (Boolean) event.getProperty(UIEvents.EventTags.NEW_VALUE);
                if (newValue.booleanValue()) {
                  // TODO Is childRendered not dangerous to call
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.