Ejemplo n.º 1
0
  @Override
  public Object[] getChildren(final Object parentElement) {
    final IFile file = RedPlugin.getAdapter(parentElement, IFile.class);

    if (file != null) {
      return RedPlugin.getModelManager().createSuiteFile(file).getSections().toArray();
    } else if (parentElement instanceof RobotSettingsSection) {
      final List<? extends RobotElement> children =
          ((RobotSettingsSection) parentElement).getChildren();
      return groupedChildren(children).toArray();
    } else if (parentElement instanceof RobotElement) {
      return ((RobotElement) parentElement).getChildren().toArray();
    }
    return new Object[0];
  }
Ejemplo n.º 2
0
  private void saveActivePage(final String activePageClassName) {
    if (getEditorInput() instanceof IFileEditorInput) {
      final IFileEditorInput fileInput = (IFileEditorInput) getEditorInput();
      final String projectName = fileInput.getFile().getProject().getName();

      final String sectionName = ID + ".activePage." + projectName;
      final IDialogSettings dialogSettings = RedPlugin.getDefault().getDialogSettings();
      IDialogSettings section = dialogSettings.getSection(sectionName);
      if (section == null) {
        section = dialogSettings.addNewSection(sectionName);
      }
      section.put("activePage", activePageClassName);
    }
  }
Ejemplo n.º 3
0
  private String getPageToActivate() {
    if (getEditorInput() instanceof IFileEditorInput) {
      final IFileEditorInput fileInput = (IFileEditorInput) getEditorInput();
      final String projectName = fileInput.getFile().getProject().getName();

      final String sectionName = ID + ".activePage." + projectName;
      final IDialogSettings dialogSettings = RedPlugin.getDefault().getDialogSettings();
      final IDialogSettings section = dialogSettings.getSection(sectionName);
      if (section == null) {
        return null;
      }
      return section.get("activePage");
    }
    return null;
  }