@Ignore
 @Test
 public void XXXtestNoFocusChangeOnExplicitWidgetSelection() {
   assertFalse(((PartBackend) part.getObject()).text1.isFocusControl());
   ((TextField) toolControl.getObject()).text.setFocus();
   processEvents();
   assertEquals(part.getElementId(), eps.getActivePart().getElementId());
   assertFalse(((PartBackend) part.getObject()).text1.isFocusControl());
   assertTrue(((TextField) toolControl.getObject()).text.isFocusControl());
 }
Пример #2
0
 @Execute
 public void execute(@Named(PARAMTER_ID) String param, EPartService partService) {
   //	public void execute(EPartService partService) {
   //		String param="next";
   MPart part = partService.getActivePart();
   Object obj = part.getObject();
   if (obj instanceof WaveformViewer) {
     if ("next".equalsIgnoreCase(param)) ((WaveformViewer) obj).moveCursor(GotoDirection.NEXT);
     else if ("prev".equalsIgnoreCase(param))
       ((WaveformViewer) obj).moveCursor(GotoDirection.PREV);
   }
 }
Пример #3
0
  @SuppressWarnings("unchecked")
  public void exchange() {
    MPart activeEditor = partService.getActivePart();

    MElementContainer<MUIElement> oldEditorStack = activeEditor.getParent();
    MElementContainer<MUIElement> splitSash = oldEditorStack.getParent();
    if (splitSash.getChildren().size() != 2) {
      return;
    }

    int oldStackIndex = splitSash.getChildren().indexOf(oldEditorStack);
    MElementContainer<MUIElement> newEditorStack =
        (MElementContainer<MUIElement>) splitSash.getChildren().get(oldStackIndex == 1 ? 0 : 1);

    exchange_editor_with_selected_in_new_stack(activeEditor, oldEditorStack, newEditorStack);

    activate(activeEditor);
  }
  @Test
  public void testNoActivationOnExplicitInPartWidgetSelection() {
    assertTrue(eps.getActivePart() == otherPart);
    assertTrue(((PartBackend) otherPart.getObject()).text1.isFocusControl());

    final boolean[] changed = new boolean[] {false};
    eps.addPartListener(
        new IPartListener() {
          @Override
          public void partVisible(MPart part) {
            changed[0] = true;
          }

          @Override
          public void partHidden(MPart part) {
            changed[0] = true;
          }

          @Override
          public void partDeactivated(MPart part) {
            changed[0] = true;
          }

          @Override
          public void partBroughtToTop(MPart part) {
            changed[0] = true;
          }

          @Override
          public void partActivated(MPart part) {
            changed[0] = true;
          }
        });

    ((PartBackend) otherPart.getObject()).text2.setFocus();
    processEvents();
    assertTrue(((PartBackend) otherPart.getObject()).text2.isFocusControl());
    assertFalse(changed[0]);
  }