Examples of DocumentData


Examples of com.alee.extended.tab.DocumentData

     *
     * @param pane document pane
     */
    protected void addDocuments ( final WebDocumentPane pane )
    {
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "1.png" ), "Excel doc", null, new WebLabel () ) );
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "2.png" ), "PDF doc", null, new WebLabel () ) );
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "3.png" ), "Office doc", null, new WebLabel () ) );
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "4.png" ), "Music clip", null, new WebLabel () ) );
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "5.png" ), "Stamp file", null, new WebLabel () ) );
        pane.openDocument ( new DocumentData ( TextUtils.generateId (), loadIcon ( "6.png" ), "Word doc", null, new WebLabel () ) );
    }
View Full Code Here

Examples of com.projity.server.data.DocumentData

                };
                final Closure getter=new Closure(){
                    public void execute(Object obj){
                      final Object[] r=(Object[])obj;
                      if (r!=null){
                        DocumentData data=(DocumentData)r[0];
                        boolean openAs=(Boolean)r[1];
                        loadDocument(data.getUniqueId(),false,openAs);
                      }

                    }
                };
                try {
View Full Code Here

Examples of com.projity.server.data.DocumentData

            };
            Closure getter=new Closure(){
                public void execute(Object obj){
                  final Object[] r=(Object[])obj;
                  if (r!=null){
                     final DocumentData data=(DocumentData)r[0];
                    if (data.isMaster())
                      return;
                    insertSubproject(project, data.getUniqueId(), true);
//                    Project openedAlready = ProjectFactory.getInstance().findFromId(data.getUniqueId());
//
//              if (!project.canInsertProject(data.getUniqueId())) {
//                Alert.error("The selected project is already a subproject in this consolidated project.");
//                return;
View Full Code Here

Examples of com.projity.server.data.DocumentData

              long t1=System.currentTimeMillis();
              ObjectInputStream in=new ObjectInputStream(new FileInputStream(importer.getFileName()));
              Object obj=in.readObject();
              if (obj instanceof String) obj=in.readObject(); //check version in the future
              DocumentData projectData=(DocumentData)obj;
              projectData.setMaster(true);
              projectData.setLocal(true);
              long t2=System.currentTimeMillis();
              System.out.println("Loading...Done in "+(t2-t1)+" ms"); //$NON-NLS-1$ //$NON-NLS-2$


              System.out.println("Deserializing..."); //$NON-NLS-1$
View Full Code Here

Examples of com.projity.server.data.DocumentData

        job.addRunnable(new JobRunnable("Export",1.0f){ //$NON-NLS-1$
        public Object run() throws Exception{
              DataUtil serializer=new DataUtil();
              System.out.println("Serialization..."); //$NON-NLS-1$
              long t1=System.currentTimeMillis();
              DocumentData projectData=serializer.serializeDocument(importer.getProject());
              projectData.setMaster(true);
              projectData.setLocal(true);
              long t2=System.currentTimeMillis();
              System.out.println("Serialization...Done in "+(t2-t1)+" ms"); //$NON-NLS-1$ //$NON-NLS-2$
              File f=new File(importer.getFileName());
              System.out.println("Saving "+f+"..."); //$NON-NLS-1$ //$NON-NLS-2$
              t1=System.currentTimeMillis();
View Full Code Here

Examples of com.projity.server.data.DocumentData

                };
                final Closure getter=new Closure(){
                    public void execute(Object obj){
                      final Object[] r=(Object[])obj;
                      if (r!=null){
                        DocumentData data=(DocumentData)r[0];
                        boolean openAs=(Boolean)r[1];
                        loadDocument(data.getUniqueId(),false,openAs);
                      }

                    }
                };
                try {
View Full Code Here

Examples of com.projity.server.data.DocumentData

            };
            Closure getter=new Closure(){
                public void execute(Object obj){
                  final Object[] r=(Object[])obj;
                  if (r!=null){
                     final DocumentData data=(DocumentData)r[0];
                    if (data.isMaster())
                      return;
                    insertSubproject(project, data.getUniqueId(), true);
//                    Project openedAlready = ProjectFactory.getInstance().findFromId(data.getUniqueId());
//
//              if (!project.canInsertProject(data.getUniqueId())) {
//                Alert.error("The selected project is already a subproject in this consolidated project.");
//                return;
View Full Code Here

Examples of com.stoyanr.todo.client.presenter.DocumentData

        @Override
        public void onSuccess() {
            ItemsView<Item> view = getItemsView();
            Document doc = new Document(userAccount.getUserId(), view.getData(),
                new Date(0));
            DocumentData data = new DocumentData(doc,
                new LocalStorage(storage), new JsonSerializer());
            new DocumentPresenter(itemsSvc, data, view).go(container);
        }
View Full Code Here

Examples of org.apache.uima.ruta.cde.utils.DocumentData

          System.out.println("dir :" + dir);

          String[] files = directory.list();

          for (String filePath : files) {
            DocumentData documentData = new DocumentData(new File(directory
                    + System.getProperty("file.separator") + filePath));
            documentList.add(documentData);
          }
          inputDirectoryText.setText(dir);
          tableViewer.setInput(documentList);
          tableViewer.refresh();
        }
      }
    });

    inputDirectoryText = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData inputDirectoryTextData = new FormData();
    // inputDirectoryTextData.width = 150;
    inputDirectoryTextData.left = new FormAttachment(directoryLabel, 10);
    inputDirectoryTextData.top = new FormAttachment(directoryLabel, 0, SWT.CENTER);
    inputDirectoryTextData.right = new FormAttachment(dirButton, -12);
    inputDirectoryText.setLayoutData(inputDirectoryTextData);
    inputDirectoryText.setText("");

    inputDirectoryText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        // without that listener, the text fields forget the
        // last change when leaving with tab! don't know why!
        // we also MUST call getText() otherwise the changes in
        // the field are lost (what is this???!!)
        Text t = (Text) e.widget;
        t.getText();
        // updateViewer(t.getText());
      }
    });

    // GUI Definitions for Test Data Selection Components

    testDataLabel = new Label(this, SWT.NONE);
    FormData testDataLabelData = new FormData();
    testDataLabelData.left = new FormAttachment(0, 10);
    // testDataLabelData.right = new FormAttachment(100, -12);
    testDataLabelData.top = new FormAttachment(directoryLabel, 15);
    testDataLabel.setLayoutData(testDataLabelData);
    testDataLabel.setText("Test Data:");

    testDataButton = new Button(this, SWT.PUSH | SWT.CENTER);
    FormData testDataButtonData = new FormData();
    testDataButtonData.width = 25;
    testDataButtonData.height = 25;
    testDataButtonData.top = new FormAttachment(testDataLabel, 0, SWT.CENTER);
    testDataButtonData.right = new FormAttachment(100, -10);
    testDataButton.setLayoutData(testDataButtonData);
    folderIcon = getImage("folder");
    testDataButton.setImage(folderIcon);
    testDataButton.setToolTipText("Select the folder containing the test files");

    testDataButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        DirectoryDialog dlg2 = new DirectoryDialog(getShell());
        dlg2.setFilterPath(testDirectoryText.getText());
        dlg2.setText("Location of the test files");
        String dir = dlg2.open();
        if (dir != null) {
          testDirectoryText.setText(dir);
        }
      }
    });

    testDirectoryText = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData testDirectoryTextData = new FormData();
    testDirectoryTextData.top = new FormAttachment(testDataLabel, 0, SWT.CENTER);
    testDirectoryTextData.left = new FormAttachment(directoryLabel, 10);
    testDirectoryTextData.right = new FormAttachment(testDataButton, -10);
    testDirectoryText.setLayoutData(testDirectoryTextData);
    testDirectoryText.setText("");

    testDirectoryText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        // without that listener, the text fields forget the
        // last change when leaving with tab! don't know why!
        // we also MUST call getText() otherwise the changes in
        // the field are lost (what is this???!!)
        Text t = (Text) e.widget;
        t.getText();
        // updateViewer(t.getText());
      }
    });

    // GUI Code for TypeSystem Selection

    this.typeSystemLabel = new Label(this, SWT.NONE);
    FormData tSLabelData = new FormData();
    tSLabelData.left = new FormAttachment(0, 10);
    tSLabelData.top = new FormAttachment(testDataLabel, 15);
    tSLabelData.width = 80;
    typeSystemLabel.setLayoutData(tSLabelData);
    typeSystemLabel.setText("Type System:");

    tsButton = new Button(this, SWT.PUSH | SWT.CENTER);
    FormData tsButtonData = new FormData();
    tsButtonData.width = 25;
    tsButtonData.height = 25;
    tsButtonData.top = new FormAttachment(typeSystemLabel, 0, SWT.CENTER);
    tsButtonData.right = new FormAttachment(100, -10);
    tsButton.setLayoutData(tsButtonData);
    folderIcon = getImage("folder");
    tsButton.setImage(folderIcon);
    tsButton.setToolTipText("Select the Type System");
    tsButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        FileDialog dlg = new FileDialog(getShell());
        dlg.setFilterPath(tsLocationText.getText());
        dlg.setText("Type System Location");
        String dir = dlg.open();
        if (dir != null) {
          tsLocationText.setText(dir);
        }
      }
    });

    tsLocationText = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData tsLocationTextData = new FormData();
    tsLocationTextData.left = new FormAttachment(typeSystemLabel, 10);
    tsLocationTextData.top = new FormAttachment(typeSystemLabel, 0, SWT.CENTER);
    tsLocationTextData.right = new FormAttachment(tsButton, -10);
    tsLocationText.setLayoutData(tsLocationTextData);
    tsLocationText.setText("");

    tsLocationText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        // without that listener, the text fields forget the
        // last change when leaving with tab! don't know why!
        // we also MUST call getText() otherwise the changes in
        // the field are lost (what is this???!!)
        Text t = (Text) e.widget;
        t.getText();
      }
    });

    measuresText = new Text(this, SWT.READ_ONLY);
    FormData cNrTextData = new FormData();
    cNrTextData.left = new FormAttachment(0, 10);
    cNrTextData.top = new FormAttachment(typeSystemLabel, 15);
    cNrTextData.right = new FormAttachment(100, -10);
    // cNrLabelData.width = 30;
    measuresText.setLayoutData(cNrTextData);
    measuresText.setText("... no measures available yet");

    tableViewer = new TableViewer(this, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
            | SWT.FULL_SELECTION);

    labelProvider = new DocumentTableLabelProvider();
    tableViewer.setLabelProvider(labelProvider);
    contentProvider = new DocumentTableContentProvider();
    tableViewer.setContentProvider(contentProvider);

    tableViewer.addDoubleClickListener(new IDoubleClickListener() {
      public void doubleClick(DoubleClickEvent event) {
        if (event.getSelection() instanceof IStructuredSelection) {
          IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
          Object object = selection.getFirstElement();
          if (object instanceof DocumentData) {
            DocumentData data = (DocumentData) object;
            Path path = new Path(data.getDocument().getAbsolutePath());

            IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
            // IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);

            IWorkbenchPage page = Workbench.getInstance().getActiveWorkbenchWindow()
                    .getActivePage();
            try {
              page.openEditor(new FileEditorInput(file), "org.apache.uima.caseditor.editor");
            } catch (PartInitException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
        }
      }
    });

    this.table = tableViewer.getTable();
    FormData tableFormData = new FormData();
    tableFormData.top = new FormAttachment(measuresText, 15);
    tableFormData.bottom = new FormAttachment(100, 0);
    tableFormData.left = new FormAttachment(0, 0);
    tableFormData.right = new FormAttachment(100, 0);
    table.setLayoutData(tableFormData);
    table.addKeyListener(new KeyListener() {

      public void keyPressed(KeyEvent e) {
        if (((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'c')) {
          String output = "";
          TableItem[] items = table.getSelection();
          for (TableItem item : items) {
            DocumentData data = (DocumentData) item.getData();
            output = output + data.getDocument().getName() + ", " + data.getAugmentedResult()
                    + ", " + data.getFMeasure() + ", \n";
          }
          clipboard.setContents(new Object[] { output },
                  new Transfer[] { TextTransfer.getInstance() });
        }
      }

      public void keyReleased(KeyEvent arg0) {
      }
    });

    tc0 = new TableColumn(table, SWT.LEFT);
    tc0.setText("  ");
    tc0.setWidth(25);

    tc1 = new TableColumn(table, SWT.LEFT);
    tc1.setText("Document");
    tc1.setWidth(160);
    tc1.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        Comparator comparator = compareFactory.getComparator(tc1);
        Collections.sort(documentList, comparator);
        tableViewer.setInput(documentList);
        tableViewer.refresh();
      }
    });

    tc2 = new TableColumn(table, SWT.RIGHT);
    tc2.setText("CDE");
    tc2.setWidth(45);
    tc2.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        Comparator comparator = compareFactory.getComparator(tc2);
        Collections.sort(documentList, comparator);
        tableViewer.setInput(documentList);
        tableViewer.refresh();
      }
    });

    tc3 = new TableColumn(table, SWT.RIGHT);
    tc3.setText("F1");
    tc3.setWidth(45);
    tc3.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        Comparator comparator = compareFactory.getComparator(tc3);
        Collections.sort(documentList, comparator);
        tableViewer.setInput(documentList);
        tableViewer.refresh();
      }
    });

    DropTarget dt = new DropTarget(table, DND.DROP_DEFAULT | DND.DROP_MOVE);
    dt.setTransfer(new Transfer[] { FileTransfer.getInstance() });
    dt.addDropListener(new DropTargetAdapter() {
      @Override
      public void drop(DropTargetEvent event) {
        String fileList[] = null;
        FileTransfer ft = FileTransfer.getInstance();
        if (ft.isSupportedType(event.currentDataType)) {
          fileList = (String[]) event.data;
        }
        if (fileList != null && fileList.length > 0) {
          for (int i = 0; i < fileList.length; i++) {
            File file = new File(fileList[i]);
            if (file.isDirectory()) {

            } else {
              DocumentData newDocument = new DocumentData(file);
              documentList.add(newDocument);
              tableViewer.setInput(documentList);
              tableViewer.refresh();
            }
          }
View Full Code Here

Examples of org.apache.uima.ruta.cde.utils.DocumentData

      tsLocationText.setText(tsLocation.getID());
    }
    IMemento documents = memento.getChild("documents");
    if (documents != null) {
      for (IMemento document : documents.getChildren("document")) {
        DocumentData docData = new DocumentData(new File(document.getID()));
        documentList.add(docData);
      }
      tableViewer.setInput(documentList);
      tableViewer.refresh();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.