Exemplo n.º 1
0
 /** Retrieve "best" WMS guess of parameters based on provided context */
 protected Map<String, Serializable> toParams(IStructuredSelection context) {
   if (context != null) {
     WWConnectionFactory connectionFactory = new WWConnectionFactory();
     for (Iterator itr = context.iterator(); itr.hasNext(); ) {
       Map<String, Serializable> params = connectionFactory.createConnectionParameters(itr.next());
       if (!params.isEmpty()) return params;
     }
   }
   return Collections.emptyMap();
 }
Exemplo n.º 2
0
  /** Can be called during createControl */
  protected Map<String, Serializable> defaultParams() {
    IStructuredSelection selection =
        (IStructuredSelection)
            PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow()
                .getSelectionService()
                .getSelection();
    Map<String, Serializable> toParams = toParams(selection);
    if (!toParams.isEmpty()) {
      return toParams;
    }

    WWConnectionFactory connectionFactory = new WWConnectionFactory();
    Map<String, Serializable> params =
        connectionFactory.createConnectionParameters(getState().getWorkflow().getContext());
    if (params != null) return params;

    return Collections.emptyMap();
  }