public DeleteRrmCalcualtionsAction(
      final RrmSimulation simulation, final ResultManagementView view) {
    super(Messages.getString("DeleteRrmCalcualtionsAction_0")); // $NON-NLS-1$
    setToolTipText(Messages.getString("DeleteRrmCalcualtionsAction_1")); // $NON-NLS-1$

    m_simulation = simulation;
    m_view = view;
  }
/** @author Dejan Antanaskovic */
public class ImportGeologyWizard extends AbstractHydrotopeDataImportWizard {
  private static final String PROPERTY_MAX_PERC_RATE =
      Messages.getString(
          "org.kalypso.ui.rrm.wizards.importGeologyData.ImportGeologyWizardPage.12"); //$NON-NLS-1$

  private static final String PROPERTY_GW_FACTOR =
      Messages.getString(
          "org.kalypso.ui.rrm.wizards.importGeologyData.ImportGeologyWizardPage.14"); //$NON-NLS-1$

  public ImportGeologyWizard() {
    setWindowTitle(
        Messages.getString(
            "org.kalypso.ui.rrm.wizards.importGeologyDataImportGeologyWizard.0")); //$NON-NLS-1$
  }

  @Override
  protected String[] getProperties() {
    return new String[] {PROPERTY_MAX_PERC_RATE, PROPERTY_GW_FACTOR};
  }

  @Override
  protected String getDescription() {
    return Messages.getString(
        "org.kalypso.ui.rrm.wizards.importGeologyData.ImportGeologyWizardPage.3"); //$NON-NLS-1$
  }

  @Override
  protected ICoreRunnableWithProgress createImportOperation(
      final ImportShapeWizardPage wizardPage,
      final GMLWorkspace dataWorkspace,
      final Parameter parameter) {
    final String maxPerculationsRateProperty = wizardPage.getProperty(PROPERTY_MAX_PERC_RATE);
    final String gwFactorProperty = wizardPage.getProperty(PROPERTY_GW_FACTOR);

    final File shapeFile = wizardPage.getShapeFile();
    final String crs = wizardPage.getSelectedCRS();
    final Charset charset = wizardPage.getSelectedCharset();

    final InputDescriptor inputDescriptor =
        new GeologyShapeInputDescriptor(
            shapeFile, maxPerculationsRateProperty, gwFactorProperty, crs, charset);

    final GeologyCollection output = (GeologyCollection) dataWorkspace.getRootFeature();
    return new GeologyImportOperation(inputDescriptor, output, ImportType.CLEAR_OUTPUT);
  }
}
  /** @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) */
  @Override
  public String getText(final Object element) {
    final String text = m_delegateLabelProvider.getText(element);
    if (element.equals(m_targetScenario))
      return String.format(
          Messages.getString("ScenariosColumnLabelProvider_0"), text); // $NON-NLS-1$

    return text;
  }
  @Override
  public Object execute(final ExecutionEvent event) throws ExecutionException {
    final IEvaluationContext context = (IEvaluationContext) event.getApplicationContext();

    /* Get the map */
    final IWorkbenchWindow window =
        (IWorkbenchWindow) context.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
    final IWorkbenchPage activePage = window.getActivePage();

    /* set input to gtt tables */
    final IScenarioDataProvider dataProvider = KalypsoAFGUIFrameworkPlugin.getDataProvider();
    final IFolder scenarioFolder = (IFolder) dataProvider.getScenarioFolder();

    KalypsoCorePlugin.getDefault().getSelectionManager().clear();

    WorkflowHandlerUtils.setGttInput(
        activePage,
        "NaNodes",
        "urn:org.kalypso.model.rrm.resultOutputManagement:workflow:NaNodes:gtt",
        Messages.getString("ResultOutputManagementTaskHandler_0"),
        scenarioFolder); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    WorkflowHandlerUtils.setGttInput(
        activePage,
        "Catchments",
        "urn:org.kalypso.model.rrm.resultOutputManagement:workflow:Catchments:gtt",
        Messages.getString("ResultOutputManagementTaskHandler_1"),
        scenarioFolder); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    WorkflowHandlerUtils.setGttInput(
        activePage,
        "StorageChannels",
        "urn:org.kalypso.model.rrm.resultOutputManagement:workflow:StorageChannels:gtt",
        Messages.getString("ResultOutputManagementTaskHandler_2"),
        scenarioFolder); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    WorkflowHandlerUtils.setGftInput(
        activePage,
        "Outputs",
        "urn:org.kalypso.model.rrm.resultOutputManagement:workflow:Outputs:gft",
        Messages.getString("ResultOutputManagementTaskHandler_3"),
        scenarioFolder); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    return null;
  }
  @Override
  public void run() {
    final Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
    final boolean confirmed =
        MessageDialog.openConfirm(
            shell,
            Messages.getString("DeleteRrmCalcualtionsAction_2"),
            Messages.getString("DeleteRrmCalcualtionsAction_3")); // $NON-NLS-1$ //$NON-NLS-2$
    if (!confirmed) return;

    final RrmCalculationResult[] calculations = m_simulation.getCalculationResults();

    try {
      for (final RrmCalculationResult calculation : calculations) {
        final IFolder folder = calculation.getFolder();
        folder.delete(true, new NullProgressMonitor());
      }
    } catch (final CoreException e) {
      e.printStackTrace();
    }

    /* update tree */
    m_view.refresh();
  }
  private void createSearchStringField(final Composite parent, final FormToolkit toolkit) {
    m_nameField = new Text(parent, SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL);
    m_nameField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    m_nameField.setMessage(Messages.getString("TextSearchFilterControl_0")); // $NON-NLS-1$
    m_nameField.addFocusListener(new SelectAllFocusListener());

    addResetListener(m_nameField);

    final ISWTObservableValue target =
        SWTObservables.observeText(m_nameField, new int[] {SWT.Modify, SWT.DefaultSelection});
    final IObservableValue model =
        PojoObservables.observeValue(m_filter, TimeseriesBrowserTextSearchFilter.PROPERTY_STRING);
    m_binding.bindValue(target, model);

    if (toolkit != null) toolkit.adapt(m_nameField, true, true);

    m_nameField.setBackground(m_yellow);
  }
 @Override
 protected String getDescription() {
   return Messages.getString(
       "org.kalypso.ui.rrm.wizards.importGeologyData.ImportGeologyWizardPage.3"); //$NON-NLS-1$
 }
 public ImportGeologyWizard() {
   setWindowTitle(
       Messages.getString(
           "org.kalypso.ui.rrm.wizards.importGeologyDataImportGeologyWizard.0")); //$NON-NLS-1$
 }