Exemple #1
0
  /**
   * Construct a query based on the state of the user interface controls, and possibly workbecnh.
   *
   * @return A catalog query
   */
  Query createQuery() {
    Query filter = new Query();
    filter.text = text.getText();

    if (filter.text == null || filter.text.length() == 0) {
      text.setText("1500 Poydras St, New Orleans, LA"); // $NON-NLS-1$
    }

    filter.bbox = new Envelope();
    if (bbox.getSelection()) {
      // TODO get current editor
      try {
        IEditorPart editor = getSite().getPage().getActiveEditor();
        Object obj = editor.getEditorInput();
        Class mapType = obj.getClass();
        Method get = mapType.getMethod("getExtent"); // $NON-NLS-1$
        Object value = get.invoke(obj);
        ReferencedEnvelope world = (ReferencedEnvelope) value;
        filter.bbox = world.transform(DefaultGeographicCRS.WGS84, true);
      } catch (Throwable t) {
        LocationUIPlugin.log("ha ha", t); // $NON-NLS-1$
      }
    }
    return filter;
  }
Exemple #2
0
 /** @param dialogSettings */
 public LocationView() {
   super(LocationUIPlugin.getDefault().getDialogSettings());
 }