Package com.vlsolutions.swing.toolbars

Examples of com.vlsolutions.swing.toolbars.ToolBarPanel


        JPanel panel1 = new JPanel(new BorderLayout());
        tableScrollPane = new JScrollPane(logTable);
        panel1.add(tableScrollPane, BorderLayout.CENTER);
        panel = ToolBarContainer.createDefaultContainer(true, false, false, false, FlowLayout.TRAILING);
        panel.add(panel1);
        ToolBarPanel barPanel = panel.getToolBarPanelAt(BorderLayout.NORTH);
        VLToolBar option = new VLToolBar();
        infoButton = UIUtils.createInfoButton();
        infoButton.setToolTipText("Show all messages");
        infoButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                warnButton.setSelected(false);
                errorButton.setSelected(false);
                infoButton.setSelected(true);
                logger.setLogLevel(ILogger.INFO);
                logTableModel.fireTableDataChanged();
            }
        });
        option.add(infoButton);
        warnButton = UIUtils.createWarnButton();
        warnButton.setToolTipText("Show only warnings and errors");
        warnButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                warnButton.setSelected(true);
                errorButton.setSelected(false);
                infoButton.setSelected(false);
                logger.setLogLevel(ILogger.WARN);
                logTableModel.fireTableDataChanged();
            }
        });
        option.add(warnButton);
        errorButton = UIUtils.createErrorButton();
        errorButton.setToolTipText("Show only errors");
        errorButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                warnButton.setSelected(false);
                errorButton.setSelected(true);
                infoButton.setSelected(false);
                logger.setLogLevel(ILogger.ERROR);
                logTableModel.fireTableDataChanged();
            }
        });
        option.add(errorButton);
        barPanel.add(option, new ToolBarConstraints());
        VLToolBar toolBar = new VLToolBar();
        JButton clear = UIUtils.createClearButton();
        clear.setToolTipText("Clear");
        clear.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                clear();
            }
        });
        showMessage = UIUtils.createShowMessageButton();
        showMessage.setToolTipText("Show message");
        showMessage.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int row = logTable.getSelectedRow();
                if (row == -1)
                    return;
                LogRecord record = logList.getRecordAt(row);
                showMessage(record);
            }
        });
        toolBar.add(showMessage);
        toolBar.add(clear);
        barPanel.add(toolBar, new ToolBarConstraints());
    }
View Full Code Here


        if (toolbar == null)
            toolbar = new DefaultActions(this).getToolBar();
        if (menuItems == null)
            menuItems = new DefaultActions(this).getMenuItems();
        component = ToolBarContainer.createDefaultContainer(true, false, false, false, FlowLayout.RIGHT);
        ToolBarPanel tpanel = component.getToolBarPanelAt(BorderLayout.NORTH);
        tpanel.add(toolbar, new ToolBarConstraints(0, 0));
        component.add(new JScrollPane(tree), BorderLayout.CENTER);
        tree.setSelectionRow(0);
        forceSelectionEvent();
        return component;
    }
View Full Code Here

     * ToolBarContainer provides the panel where to attach the toolbar.
     *
     * @param container
     */
    private void createToolBar(ToolBarContainer container) {
        ToolBarPanel toolBarPanel = container.getToolBarPanelAt(BorderLayout.NORTH);
        VLToolBar toolBar = new VLToolBar();
        toolBar.add(getActionButton(newTestcaseAction));
        toolBar.add(getActionButton(etAction));
        toolBar.add(getActionButton(newModuleAction));
        toolBar.add(getActionButton(saveAction));
        toolBar.add(getActionButton(saveAsAction));
        toolBar.add(getActionButton(saveAllAction));
        toolBarPanel.add(toolBar, new ToolBarConstraints(0, 0));
        toolBar = new VLToolBar();
        toolBar.add(getActionButton(undoAction));
        toolBar.add(getActionButton(redoAction));
        toolBar.add(getActionButton(cutAction));
        toolBar.add(getActionButton(copyAction));
        toolBar.add(getActionButton(pasteAction));
        toolBar.add(getActionButton(searchAction));
        toolBarPanel.add(toolBar, new ToolBarConstraints(0, 1));
        toolBar = new VLToolBar();
        recordActionButton = getActionButton(recordAction);
        toolBar.add(recordActionButton);
        toolBar.add(getActionButton(pauseAction));
        toolBar.add(getActionButton(resumeRecordingAction));
        toolBar.add(getActionButton(insertScriptAction));
        toolBar.add(getActionButton(insertChecklistAction));
        toolBar.add(getActionButton(stopAction));
        toolBar.add(getActionButton(recorderConsoleAction));
        toolBarPanel.add(toolBar, new ToolBarConstraints(0, 2));
        toolBar = new VLToolBar();
        toolBar.add(getActionButton(openApplicationAction));
        toolBar.add(getActionButton(closeApplicationAction));
        toolBarPanel.add(toolBar, new ToolBarConstraints(0, 3));
        toolBar = new VLToolBar();
        toolBar.add(getActionButton(playAction));
        toolBar.add(getActionButton(slowPlayAction));
        toolBar.add(getActionButton(debugAction));
        toolBar.add(getActionButton(toggleBreakpointAction));
        toolBar.add(getActionButton(resumePlayingAction));
        toolBar.add(getActionButton(stepIntoAction));
        toolBar.add(getActionButton(stepOverAction));
        toolBar.add(getActionButton(stepReturnAction));
        toolBar.add(getActionButton(playerConsoleAction));
        toolBar.add(getActionButton(showReportAction));
        toolBarPanel.add(toolBar, new ToolBarConstraints(0, 4));
        if (actionProvider != null) {
            toolBar = new VLToolBar();
            IMarathonAction[] actions = actionProvider.getActions();
            for (int i = 0; i < actions.length; i++) {
                final IMarathonAction action = actions[i];
                if (!action.isToolBarAction())
                    continue;
                if (action.isSeperator()) {
                    toolBarPanel.add(toolBar, new ToolBarConstraints(0, 5));
                    toolBar = new VLToolBar();
                } else {
                    toolBar.add(getActionButton(createAction(action)));
                }
            }
            toolBarPanel.add(toolBar, new ToolBarConstraints(0, 5));
        }
        showReportAction.setEnabled(false);
        return;
    }
View Full Code Here

        label.setFont(label.getFont().deriveFont(Font.BOLD));
        panel1.add(label, BorderLayout.NORTH);
        JScrollPane scrollPane = new JScrollPane(resultTable);
        panel1.add(scrollPane, BorderLayout.CENTER);
        panel.add(panel1);
        ToolBarPanel barPanel = panel.getToolBarPanelAt(BorderLayout.NORTH);
        VLToolBar toolBar = new VLToolBar();
        JButton clear = UIUtils.createClearButton();
        clear.setToolTipText("Clear");
        clear.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                clear();
            }
        });
        JButton showError = UIUtils.createShowMessageButton();
        showError.setToolTipText("Show message");
        showError.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int row = resultTable.getSelectedRow();
                if (row == -1)
                    return;
                Failure failure = pbResult.getFailureAt(row);
                if (failure != null)
                    showMessage(failure);
            }
        });
        toolBar.add(showError);
        toolBar.add(clear);
        barPanel.add(toolBar, new ToolBarConstraints());
    }
View Full Code Here

    private Component component;

    public TextAreaOutput() {
        DockingUISettings.getInstance().installUI();
        ToolBarContainer container = ToolBarContainer.createDefaultContainer(true, false, false, false, FlowLayout.TRAILING);
        ToolBarPanel barPanel = container.getToolBarPanelAt(BorderLayout.NORTH);
        VLToolBar bar = new VLToolBar();
        JButton clear = UIUtils.createClearButton();
        clear.setToolTipText("Clear");
        clear.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                textPane.clear();
            }
        });
        bar.add(clear);
        JButton export = UIUtils.createExportButton();
        export.setToolTipText("Export to a text file");
        export.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = new JFileChooser();
                int dialog = fileChooser.showSaveDialog(component.getParent());
                if (dialog == JFileChooser.APPROVE_OPTION) {
                    File file = fileChooser.getSelectedFile();
                    if (file.exists()) {

                    }
                    try {
                        BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
                        stream.write(textPane.getText().getBytes());
                        stream.close();
                    } catch (FileNotFoundException e1) {
                        e1.printStackTrace();
                    } catch (IOException e2) {
                        e2.printStackTrace();
                    }
                }
            }
        });
        bar.add(export);
        barPanel.add(bar, new ToolBarConstraints());

        textPane.setSize(100, 100);
        textPane.setEditable(false);
        textPane.setEnabled(true);
        textPane.setName("output");
View Full Code Here

TOP

Related Classes of com.vlsolutions.swing.toolbars.ToolBarPanel

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.