@Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    if (2 == UserAuthenticator.getInstance().getUserType()) {
      IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
      IWorkbenchPage page = window.getActivePage();

      Fixture fixture = ModelFactoryImpl.eINSTANCE.createFixture();
      fixture.setID(IDGenerator.generateUniqueID());
      fixture.setName("New fixture");

      SupplierFixtureEditorInput input = new SupplierFixtureEditorInput(fixture);
      try {
        page.openEditor(input, SupplierFixtureEditor.ID);
      } catch (PartInitException e) {
        e.printStackTrace();
      }
    } else {
      showErrorMessage();
    }
    return null;
  }
示例#2
0
  @Override
  public boolean equals(Object _anotherFixture) {
    Fixture anotherFixture = (Fixture) _anotherFixture;

    return this.getTourney().equals(anotherFixture.getTourney());
  }