Examples of StatusBar


Examples of org.springframework.richclient.application.statusbar.StatusBar

    protected void doOnce() {
        checkIfDataIsAlreadyAvailable();
        closeAllViews();

        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        final ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        file = fc.getSelectedFile();
        if (!file.isDirectory()) {
            int resultOP = JOptionPane.showConfirmDialog(null, tr.get(ID + ".confirmation.message"),
                    tr.get(ID + ".confirmation.title"), JOptionPane.OK_CANCEL_OPTION);
            if (resultOP != JOptionPane.OK_OPTION) {
                return;
            }
        }
        pm.taskStarted(tr.get(ID + ".startTask"), 100);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);
                ImportText importer = new ImportText(dataPool, settings, file);

                bar.getProgressMonitor().worked(20);
                importer.doWork();
                bar.getProgressMonitor().worked(80);
            }

            @Override
            protected void done() {
                bar.getProgressMonitor().worked(90);
                openAllViews();
                bar.getProgressMonitor().worked(100);
                super.done();
            }
        };

        sw.execute();
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

     * @see Application#close()
     */
    @Override
    protected void doOnce() {
        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        int res = fc.showSaveDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        final File f = fc.getSelectedFile();

        pm.taskStarted(tr.get(ID + ".startTask"), -1);

        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);
                XmlExport exporter = new XmlExport(dataPool,
                        settings, new FileOutputStream(f.getAbsoluteFile()));

                exporter.doWork();
                bar.getProgressMonitor().worked(100);
            }
        };

        sw.execute();
    }
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

        ViewDescriptorRegistry viewDescriptorRegistry = (ViewDescriptorRegistry) ApplicationServicesLocator.services().getService(ViewDescriptorRegistry.class);

        final DualEventDescriptor view = (DualEventDescriptor) viewDescriptorRegistry.getViewDescriptor("dualEventView");
        final List<DualEvent> eventsList = view.getDualEvents();
        final Dao<Event> dao = view.getDao();
        final StatusBar bar = getApplicationWindow().getStatusBar();

        bar.getProgressMonitor().taskStarted(tr.get(ID + ".startTask"), 100);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                double delta = 90.0 / dao.getAll().size();
                double counter = 1;
                for (Event a : dao.getAll()) {
                    bar.getProgressMonitor().worked((int) counter);
                    counter += delta;
                    if (!firstEvent(a))
                        continue;

                    for (Event b : dao.getAll()) {
                        if (a == b || !firstEvent(b))
                            continue;

                        eventsList.add(new DualEvent(a, b));
                    }
                }
                logger.info("Read dual events:" + eventsList.size());
            }

            private boolean firstEvent(Event ev) {
                DifferentDayConstraint constr = ev.getConstraint(DifferentDayConstraint.class);
                if (constr != null) {
                    // only one event of the event group
                    if (constr.getEvents().size() > 0
                            && ev == constr.getEvents().iterator().next())
                        return true;
                }
                return false;
            }

            @Override
            protected void done() {
                bar.getProgressMonitor().worked(95);
                view.createShowViewCommand(getApplicationWindow()).execute();
                super.done();
            }
        };
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

    protected void doOnce() {
        checkIfDataIsAlreadyAvailable();
        closeAllViews();

        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        final ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        file = fc.getSelectedFile();
        if (!file.getName().endsWith(".xml")) {
            int resultOP = JOptionPane.showConfirmDialog(null, tr.get(ID + ".confirmation.message"),
                    tr.get(ID + ".confirmation.title"), JOptionPane.OK_CANCEL_OPTION);
            if (resultOP != JOptionPane.OK_OPTION) {
                return;
            }
        }
        pm.taskStarted(tr.get(ID + ".startTask"), 100);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);

                XmlImport importer = new XmlImport(dataPool, settings,
                        new FileInputStream(file.getAbsolutePath()));

                // TODO NOW
//                importer.setStatusBar(bar);

                importer.doWork();
                bar.getProgressMonitor().worked(90);
            }

            @Override
            protected void done() {
                bar.getProgressMonitor().worked(90);
                openAllViews();
                bar.getProgressMonitor().worked(100);
                super.done();
            }
        };

        sw.execute();
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

        }

        @Override
        protected void done() {
            // all of the following code will be called on the Event Dispatching Thread
            StatusBar bar = getApplicationWindow().getStatusBar();
            if (bar.getProgressMonitor().isCanceled()) {
                bar.setErrorMessage(tr.get(ID + ".canceled"));
            } else {
                if (getException() != null)
                    bar.setErrorMessage(tr.get(ID + ".exception") + ": "
                            + getException().getLocalizedMessage());
                else if (getException() != null && getException().getCause() != null)
                    bar.setErrorMessage(tr.get(ID + ".exception") + ": "
                            + getException().getCause().getLocalizedMessage());
                else
                    bar.setMessage(tr.get(ID + ".finished"));
            }
            bar.getProgressMonitor().done();
            setFinished(true);
        }
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

            if (dataProvider.supportsBaseCriteria())
            {
                dataProvider.setBaseCriteria(getBaseCriteria());
            }

            StatusBar statusBar = Application.instance().getActiveWindow().getStatusBar();
            statusBar.getProgressMonitor().taskStarted(
                    RcpSupport.getMessage("statusBar", "loadTable", RcpSupport.LABEL),
                    StatusBarProgressMonitor.UNKNOWN);
            //            getFilterForm().getCommitCommand().setEnabled(false);
            //            getRefreshCommand().setEnabled(false);
View Full Code Here

Examples of org.springframework.richclient.application.statusbar.StatusBar

        logger.debug(event);
        if (event instanceof XsAnalyzerApplicationEvent) {
            switch (((XsAnalyzerApplicationEvent) event).getEventType()) {
                case OPEN:
                    jtStructure.setModel(new TreeModelAdapter(model.getSchemaModel()));
                    StatusBar bar = Application.instance().getLifecycleAdvisor().getStatusBar();
                    bar.setMessage(getMessage("statusBar.label.action.open", new Object[] { model.getSchemaFile().getAbsolutePath()}));
                    break;
            }
        }
    }
View Full Code Here

Examples of org.uncommons.watchmaker.swing.evolutionmonitor.StatusBar

    protected void prepareGUI(Container container)
    {
        sudokuView = new SudokuView();
        container.add(createControls(), BorderLayout.NORTH);
        container.add(sudokuView, BorderLayout.CENTER);
        statusBar = new StatusBar();
        container.add(statusBar, BorderLayout.SOUTH);
        sudokuView.setPuzzle(EASY_PUZZLE);
    }
View Full Code Here

Examples of ptolemy.gui.StatusBar

     *  it is necessary to call setVisible(true) to make the frame appear.
     *  It may also be desirable to call centerOnScreen().
     *  @param tableau The managing tableau.
     */
    public TableauFrame(Tableau tableau) {
        this(tableau, new StatusBar());
    }
View Full Code Here

Examples of rex.graphics.StatusBar

       * 3rd August 2006
       */
      //resultPane.add(  new JLabel("")
       //              , BorderLayout.CENTER);

      statusBar = new StatusBar();
          
      this.setLayout(new BorderLayout());
        this.add(new JSplitPane(JSplitPane.VERTICAL_SPLIT
                                      , editorPane
                                      , resultPane )
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.