Beispiel #1
0
  private void initQueryResult(QueryResult queryResult, PaneState state) {
    IOQLQuery.Result subject = (IOQLQuery.Result) (queryResult).getSubject();
    queryViewer.getDocument().set(subject.getOQLQuery());

    AbstractEditorPane pane = EditorPaneRegistry.instance().createNewPane(subject, this.getClass());

    if (state == null) {
      for (PaneState child : getPaneState().getChildren()) {
        if (queryString.getText().equals(child.getIdentifier())) {
          state = child;
          break;
        }
      }

      if (state == null) {
        state =
            new PaneState(PaneType.COMPOSITE_CHILD, getPaneState(), queryString.getText(), true);
        state.setImage(getTitleImage());
      }
    }

    pane.setPaneState(state);

    createResultPane(pane, queryResult);
  }
Beispiel #2
0
 @Override
 public void initWithArgument(final Object param) {
   if (param instanceof String) {
     queryViewer.getDocument().set((String) param);
     executeAction.run();
   } else if (param instanceof QueryResult) {
     QueryResult queryResult = (QueryResult) param;
     initQueryResult(queryResult, null);
   } else if (param instanceof PaneState) {
     queryViewer.getDocument().set(((PaneState) param).getIdentifier());
     new ExecuteQueryAction((PaneState) param).run();
   }
 }