Package com.onpositive.semantic.model.ui.property.editors

Examples of com.onpositive.semantic.model.ui.property.editors.CompositeEditor


    bndr.setName("Bulk Export to data store");
    bndr.setDescription("Please select settings for this export");
    bndr.setAutoCommit(true);

    CompositeEditor optionPage = createOptionsPageForBulkExport(bndr);
    CompositeEditor outPutFolderPage = createFolderPage(bndr);

    FlowWizard newWizard = new FlowWizard(bndr, "Export") {

      public boolean canFinish() {
        // ExportData dat = (ExportData) bndr.getObject();
View Full Code Here


    final Binding bndr = new Binding(t);
    bndr.setName("Export data to data store");
    bndr.setDescription("Please select settings for this export");
    bndr.setAutoCommit(true);
    CompositeEditor optionsPage = createOptionsPageForExport(bndr);
    CompositeEditor outPutFilePage = createFilePageForExport(bndr);
    CompositeEditor outPutFolderPage = createDirectoryPageForExport(bndr);
    CompositeEditor jdbcDataPage = createJDBCPage(bndr);

    FlowWizard newWizard = new FlowWizard(bndr, "Export") {

      public boolean canFinish() {
        // ExportData dat = (ExportData) bndr.getObject();
View Full Code Here

    final Binding bndr = new Binding(t);
    bndr.setName("Import data from data store");
    bndr.setDescription("Please select settings for this import");
    bndr.setAutoCommit(true);

    CompositeEditor optionPage = createOptionsPageForBulkImport(bndr);
    CompositeEditor outPutFolderPage = createFolderPage(bndr);

    DisposeBindingListener.linkBindingLifeCycle(bndr, optionPage);
    FlowWizard newWizard = new FlowWizard(bndr, "Import") {

      public boolean canFinish() {
View Full Code Here

    final Binding bndr = new Binding(t);
    bndr.setName("Import data from data store");
    bndr.setDescription("Please select settings for this import");
    bndr.setAutoCommit(true);
    CompositeEditor optionsPage = createOptionsPage(bndr);
    CompositeEditor columnsPage = createColumnsPage(facade, bndr);
    CompositeEditor kindsPage = createKindsPage(facade, bndr);
    CompositeEditor outPutFilePage = createFilePage(bndr);
    CompositeEditor outPutFolderPage = createDirectoryPage(bndr);
    CompositeEditor jdbcPage = createJDBCPage(bndr);
    DisposeBindingListener.linkBindingLifeCycle(bndr, optionsPage);
    FlowWizard newWizard = new FlowWizard(bndr, "Import") {

      public boolean canFinish() {
        // ExportData dat = (ExportData) bndr.getObject();
View Full Code Here

      return null;
    }
  }

  private static CompositeEditor createFilePageForExport(final Binding bndr) {
    CompositeEditor r = new CompositeEditor(bndr);
    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        FileDialog dialog = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.OPEN);

        ExportData dat = (ExportData) bndr.getObject();
        if (dat.asCsv) {
          dialog.setFilterExtensions(new String[] { "*.csv" });
          dialog.setFilterNames(new String[] { "*.csv" });
          dialog.setOverwrite(false);
        } else if (dat.asXML) {
          dialog.setFilterExtensions(new String[] { "*.xml" });
          dialog.setFilterNames(new String[] { "*.xml" });
          dialog.setOverwrite(false);
        }

        String path = dialog.open();
        return path;
      }

      public String getName() {
        return "Browse...";
      }

      public String getDescription() {
        return "";
      }
    });
    r.add(element);
    return r;
  }
View Full Code Here

    r.add(element);
    return r;
  }

  private static CompositeEditor createFilePage(final Binding bndr) {
    CompositeEditor r = new CompositeEditor(bndr);
    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        FileDialog dialog = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.SAVE);

        ImportData dat = (ImportData) bndr.getObject();
        if (dat.asCsv) {
          dialog.setFilterExtensions(new String[] { "*.csv" });
          dialog.setFilterNames(new String[] { "*.csv" });
          dialog.setOverwrite(true);
        } else if (dat.asXML) {
          dialog.setFilterExtensions(new String[] { "*.xml" });
          dialog.setFilterNames(new String[] { "*.xml" });
          dialog.setOverwrite(true);
        }

        String path = dialog.open();

        return path;
      }

      public String getName() {
        return "Browse...";
      }

      public String getDescription() {
        return "";
      }
    });
    r.add(element);
    return r;
  }
View Full Code Here

    r.add(element);
    return r;
  }

  private static CompositeEditor createJDBCPage(final Binding bndr) {
    CompositeEditor r = new CompositeEditor(bndr);
    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("jdbcConnection"));
    /*
     * element.setSelector(new IFactory() {
     *
     * public Object getValue(Object context) { // TODO Auto-generated
     * method stub return null; }
     *
     * public String getName() { return "Browse..."; }
     *
     * public String getDescription() { return ""; } });
     */
    OneLineTextElement<String> element1 = new OneLineTextElement<String>(
        bndr.getBinding("jdbcDriverClassName"));
    OneLineTextElement<String> elementL = new OneLineTextElement<String>(
        bndr.getBinding("databaseLogin"));
    OneLineTextElement<String> elementP = new OneLineTextElement<String>(
        bndr.getBinding("databasePasswd"));
    elementP.setIsPassword(true);

    r.add(element);
    r.add(element1);
    r.add(elementL);
    r.add(elementP);

    Container element2 = new Container(Container.GROUP);
    element2.getLayoutHints().setGrabHorizontal(true);
    element2.setLayoutManager(new HorizontalLayouter());
    element2.setText("Class Path");

    final ListEnumeratedValueSelector<String> classpath = new ListEnumeratedValueSelector<String>(
        bndr.getBinding("jdbcDriverClassPath")) {

      protected void updateSize(TableViewer newCheckList) {
        // TODO Auto-generated method stub
        TableColumn tableColumn = (TableColumn) columnWidget;
        tableColumn.pack();
        // int width = tableColumn.getWidth();
        // int width2 = newCheckList.getTable().getBounds().width;
        // if (width < width2) {
        // ((TableColumn) columnWidget).setWidth(width2 - 5);
        // }
      }
    };
    ButtonSelector addButton = new ButtonSelector();
    addButton.setText("add jar");
    GridData addDat = new GridData(GridData.FILL_HORIZONTAL);
    addButton.setLayoutData(addDat);
    addButton.addListener(SWT.Selection, new SWTEventListener<Button>() {

      public void handleEvent(AbstractUIElement<Button> element,
          Event event) {

        FileDialog dialog = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.MULTI | SWT.SELECTED);
        dialog.setFilterExtensions(new String[] { "*.jar" });
        dialog.setFilterNames(new String[] { "*.jar" });
        dialog.setOverwrite(false);
        dialog.open();

        String[] names = dialog.getFileNames();
        String path = dialog.getFilterPath();

        for (String name : names) {
          String result = path + File.separator + name;
          classpath.addValue(result);
          ((TableViewer) classpath.getViewer()).getTable()
              .getParent().layout();
        }
      }
    });

    ButtonSelector removeButton = new ButtonSelector();
    removeButton.setText("remove jar");
    GridData removeDat = new GridData(GridData.FILL_HORIZONTAL);
    removeButton.setLayoutData(removeDat);

    removeButton.addListener(SWT.Selection, new SWTEventListener<Button>() {

      public void handleEvent(AbstractUIElement<Button> element,
          Event event) {
        for (Iterator i = classpath.getSelection().iterator(); i
            .hasNext();) {
          String str = (String) i.next();
          classpath.removeValue(str);
        }
      }
    });
    Container buttonContainer = new Container();
    buttonContainer.setLayout(new GridLayout(1, true));
    buttonContainer.getLayoutHints().setGrabHorizontal(false);
    buttonContainer.setBordered(false);
    buttonContainer.add(addButton);
    buttonContainer.add(removeButton);

    element2.add(classpath);
    element2.add(buttonContainer);
    r.add(element2);
    // r.add(classpath);
    return r;
  }
View Full Code Here

    // r.add(classpath);
    return r;
  }

  private static CompositeEditor createDirectoryPage(final Binding bndr) {
    CompositeEditor r = new CompositeEditor(bndr);
    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        DirectoryDialog dialog = new DirectoryDialog(Display
            .getCurrent().getActiveShell(), SWT.SAVE);
        dialog.setMessage("Please choose path for import");

        String path = dialog.open();

        return path;
      }

      public String getName() {
        return "Browse...";
      }

      public String getDescription() {
        return "";
      }
    });
    r.add(element);
    return r;
  }
View Full Code Here

    r.add(element);
    return r;
  }

  private static CompositeEditor createFolderPage(final Binding bndr){
    CompositeEditor r = new CompositeEditor(bndr);

    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent()
            .getActiveShell(),SWT.OPEN | SWT.READ_ONLY | SWT.DIALOG_TRIM);       
        dialog.setText("Please select path");
        // dialog.set

        String open = dialog.open();
        return open;
      }

      public String getName() {
        return "Browse...";
      }

      public String getDescription() {
        return "";
      }
    });
    r.add(element);
    return r;
  }
View Full Code Here

    return r;
  }
 
  private static CompositeEditor createDirectoryPageForExport(
      final Binding bndr) {
    CompositeEditor r = new CompositeEditor(bndr);

    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        FileDialog dialog = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.MULTI | SWT.OPEN);

        dialog.setOverwrite(false);
        dialog.setText("Please select files to export");
        // dialog.set

        ExportData dat = (ExportData) bndr.getObject();
        if (dat.asCsv) {
          if (Platform.getOS().equals(Platform.OS_MACOSX)) {
            dialog.setFilterExtensions(new String[] { "csv" });
            dialog.setFilterNames(new String[] { ".csv" });
          } else {
            dialog.setFilterExtensions(new String[] { "*.csv" });
            dialog.setFilterNames(new String[] { "*.csv" });
          }

          dialog.setOverwrite(false);
        } else if (dat.asXML) {
          if (Platform.getOS().equals(Platform.OS_MACOSX)) {
            dialog.setFilterExtensions(new String[] { "xml" });
            dialog.setFilterNames(new String[] { ".xml" });
          } else {
            dialog.setFilterExtensions(new String[] { "*.xml" });
            dialog.setFilterNames(new String[] { "*.xml" });
          }
          dialog.setOverwrite(false);
        }

        dialog.open();

        String[] selected = dialog.getFileNames();

        String result = dialog.getFilterPath()
            .replaceAll(",", "&#044;") + ",";
        int i = 0;
        for (String tmp : selected) {
          result += tmp.replaceAll(",", "&#044;");
          if (i != selected.length - 1) {
            result += ",";
          }
        }

        return result;
      }

      public String getName() {
        return "Browse...";
      }

      public String getDescription() {
        return "";
      }
    });
    r.add(element);
    return r;
  }
View Full Code Here

TOP

Related Classes of com.onpositive.semantic.model.ui.property.editors.CompositeEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.