Пример #1
0
  @Override
  public void run() {
    Collection<File> files = null;

    try {
      files = getSelectedFiles();
    } catch (IOException e) {
      ExceptionUtil.handle(e);
      return;
    }

    if (files == null || files.size() != 1) {
      return;
    }

    File file = files.iterator().next();
    String newName = queryNewResourceName(file);

    if (newName == null || newName.length() <= 0) {
      return;
    }

    File newFile = new Path(file.getAbsolutePath()).removeLastSegments(1).append(newName).toFile();

    try {
      new ProgressMonitorDialog(getShell())
          .run(true, true, createRenameFileRunnable(file, newFile));
    } catch (InvocationTargetException e) {
      ExceptionUtil.handle(e);
    } catch (InterruptedException e) {
      ExceptionUtil.handle(e);
    }
  }
Пример #2
0
  @Override
  public void run() {
    File container;

    try {
      container = getSelectedContainer();
    } catch (IOException e) {
      ExceptionUtil.handle(e);
      return;
    }

    if (container == null) {
      return;
    }

    final PublishResourceWizard publishLibrary =
        new PublishResourceWizard(container.getAbsolutePath());
    WizardDialog dialog =
        new WizardDialog(UIUtil.getDefaultShell(), publishLibrary) {

          @Override
          protected void okPressed() {
            publishLibrary.setCopyFileRunnable(
                createCopyFileRunnable(
                    publishLibrary.getSourceFile(), publishLibrary.getTargetFile()));

            super.okPressed();
          }
        };

    dialog.setPageSize(500, 250);
    if (dialog.open() == Window.OK) {
      fireResourceChanged(publishLibrary.getTargetFile().getAbsolutePath());
    }
  }
Пример #3
0
 public void setInput(TabularCubeHandle cube, DataSetHandle dataset) {
   this.cube = cube;
   this.dataset = dataset;
   try {
     cube.setDataSet(dataset);
   } catch (SemanticException e) {
     ExceptionUtil.handle(e);
   }
 };
Пример #4
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.action.Action#run()
   */
  public void run() {
    transStar(NAME);
    try {
      LevelViewDialog dialog = new LevelViewDialog(true);
      List showLevels = new ArrayList();
      List nullLevelHandle = new ArrayList();
      int viewCount = viewHandle.getLevelCount();
      for (int i = 0; i < viewCount; i++) {
        LevelViewHandle levelHandle = viewHandle.getLevel(i);
        if (levelHandle.getCubeLevel() == null) {
          nullLevelHandle.add(Integer.valueOf(levelHandle.getIndex()));
        } else {
          showLevels.add(levelHandle.getCubeLevel());
        }
      }

      ExtendedItemHandle extendedHandle = CrosstabAdaptUtil.getExtendedItemHandle(getHandle());
      LevelViewHandle levelViewHandle = CrosstabAdaptUtil.getLevelViewHandle(extendedHandle);

      dialog.setInput(findDimension(levelViewHandle.getCubeLevel()), showLevels);
      if (dialog.open() == Window.OK) {
        CrosstabReportItemHandle reportHandle = viewHandle.getCrosstab();

        List result = (List) dialog.getResult();
        boolean isLevelRemoved = processor(showLevels, result, nullLevelHandle, false);

        if (isLevelRemoved) {
          boolean bool = CrosstabAdaptUtil.needRemoveInvaildBindings(reportHandle);
          processor(showLevels, result, nullLevelHandle, true);
          if (bool) {
            CrosstabAdaptUtil.removeInvalidBindings(reportHandle);
          }
        } else {
          processor(showLevels, result, nullLevelHandle, true);
        }

        AggregationCellProviderWrapper providerWrapper =
            new AggregationCellProviderWrapper(reportHandle);
        providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
      }
    } catch (SemanticException e) {
      rollBack();
      ExceptionUtil.handle(e);
      return;
    }
    transEnd();
  }