Example usage for javax.swing JTabbedPane JTabbedPane

List of usage examples for javax.swing JTabbedPane JTabbedPane

Introduction

In this page you can find the example usage for javax.swing JTabbedPane JTabbedPane.

Prototype

public JTabbedPane() 

Source Link

Document

Creates an empty TabbedPane with a default tab placement of JTabbedPane.TOP.

Usage

From source file:org.ow2.aspirerfid.demos.warehouse.management.UI.WarehouseManagement.java

/**
 * Initialize the contents of the frame//  w ww . j  av a 2  s .  co  m
 */
private void initialize() {

    final JTabbedPane tabbedPane;
    final JPanel deliveryPanel;
    final JLabel entryDateLabel;
    final JLabel entryDateLabel_1;
    final JLabel entryDateLabel_2;
    final JLabel entryDateLabel_3;
    final JLabel entryDateLabel_3_1;
    final JLabel entryDateLabel_3_2;
    final JPanel shipmentPanel;
    final JLabel entryDateLabel_3_1_1;
    final JLabel entryDateLabel_3_1_2;
    final JScrollPane scrollPane;
    final JButton printReportButton;
    final JButton saveReportButton;
    final JButton activateDoorButton;
    final JButton deactivateDoorButton;
    final JButton clearReportButton;
    final JPanel panel;
    final JLabel entryDateLabel_3_3;
    final JLabel entryDateLabel_2_1;
    frame = new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setTitle("Warehouse Management");
    frame.setBounds(100, 100, 1011, 625);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    tabbedPane = new JTabbedPane();
    frame.getContentPane().add(tabbedPane);

    deliveryPanel = new JPanel();
    deliveryPanel.setLayout(null);
    tabbedPane.addTab("Delivery Counter", null, deliveryPanel, null);

    entryDateLabel = new JLabel();
    entryDateLabel.setText("Entry Date .........");
    entryDateLabel.setBounds(533, 23, 117, 16);
    deliveryPanel.add(entryDateLabel);

    entryDateLabel_1 = new JLabel();
    entryDateLabel_1.setText("User ID ................");
    entryDateLabel_1.setBounds(10, 94, 117, 16);
    deliveryPanel.add(entryDateLabel_1);

    entryDateLabel_2 = new JLabel();
    entryDateLabel_2.setText("Invoice ID ............");
    entryDateLabel_2.setBounds(10, 23, 117, 16);
    deliveryPanel.add(entryDateLabel_2);

    entryDateLabel_3 = new JLabel();
    entryDateLabel_3.setText("Warehouse ID....");
    entryDateLabel_3.setBounds(10, 45, 117, 16);
    deliveryPanel.add(entryDateLabel_3);

    entryDateLabel_3_1 = new JLabel();
    entryDateLabel_3_1.setText("Zone ID ................");
    entryDateLabel_3_1.setBounds(10, 67, 117, 16);
    deliveryPanel.add(entryDateLabel_3_1);

    entryDateLabel_3_2 = new JLabel();
    entryDateLabel_3_2.setText("Entry Hour .........");
    entryDateLabel_3_2.setBounds(533, 45, 117, 16);
    deliveryPanel.add(entryDateLabel_3_2);

    entryDateLabel_3_1_1 = new JLabel();
    entryDateLabel_3_1_1.setText("Offering Date ....");
    entryDateLabel_3_1_1.setBounds(533, 70, 117, 16);
    deliveryPanel.add(entryDateLabel_3_1_1);

    entryDateLabel_3_1_2 = new JLabel();
    entryDateLabel_3_1_2.setText("Offering Hour ....");
    entryDateLabel_3_1_2.setBounds(533, 94, 117, 16);
    deliveryPanel.add(entryDateLabel_3_1_2);

    invoiceIDTextField = new JTextField();
    invoiceIDTextField.setBounds(105, 19, 365, 20);
    deliveryPanel.add(invoiceIDTextField);

    warehouseIDTextField = new JTextField();
    warehouseIDTextField.setBounds(105, 43, 365, 20);
    deliveryPanel.add(warehouseIDTextField);

    zoneIDTextField = new JTextField();
    zoneIDTextField.setBounds(105, 66, 365, 20);
    deliveryPanel.add(zoneIDTextField);

    userIDTextField = new JTextField();
    userIDTextField.setBounds(105, 90, 365, 20);
    deliveryPanel.add(userIDTextField);

    entryDateTextField = new JTextField();
    entryDateTextField.setBounds(623, 19, 365, 20);
    deliveryPanel.add(entryDateTextField);

    entryHourTextField = new JTextField();
    entryHourTextField.setBounds(623, 41, 365, 20);
    deliveryPanel.add(entryHourTextField);

    offeringDateTextField = new JTextField();
    offeringDateTextField.setBounds(623, 66, 365, 20);
    deliveryPanel.add(offeringDateTextField);

    offeringHourTextField = new JTextField();
    offeringHourTextField.setBounds(623, 90, 365, 20);
    deliveryPanel.add(offeringHourTextField);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(10, 129, 978, 355);
    deliveryPanel.add(scrollPane);

    deliveryTableModel = new DefaultTableModel();// All Clients Items
    deliveryTableModel.addColumn("Company");
    deliveryTableModel.addColumn("Item Code");
    deliveryTableModel.addColumn("Description");
    deliveryTableModel.addColumn("Quantity Delivered");
    deliveryTableModel.addColumn("Expected Quantity");
    deliveryTableModel.addColumn("Quantity Remain");
    deliveryTableModel.addColumn("Delivery Date");
    deliveryTableModel.addColumn("Measurement ID");
    deliveryTableModel.addColumn("Quantity");
    deliveryTable = new JTable(deliveryTableModel);
    deliveryTable.setFont(new Font("Arial Narrow", Font.PLAIN, 10));
    deliveryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    scrollPane.setViewportView(deliveryTable);

    ListSelectionModel rowSM = deliveryTable.getSelectionModel();

    printReportButton = new JButton();
    printReportButton.setText("Print Report");
    printReportButton.setBounds(860, 520, 117, 26);
    deliveryPanel.add(printReportButton);

    saveReportButton = new JButton();
    saveReportButton.setText("Save Report");
    saveReportButton.setBounds(614, 520, 117, 26);
    deliveryPanel.add(saveReportButton);

    activateDoorButton = new JButton();
    activateDoorButton.addMouseListener(new ActivateDoorButtonMouseListener());
    activateDoorButton.setText("Activate Door");
    activateDoorButton.setBounds(50, 520, 117, 26);
    deliveryPanel.add(activateDoorButton);

    deactivateDoorButton = new JButton();
    deactivateDoorButton.addMouseListener(new DeactivateDoorButtonMouseListener());
    deactivateDoorButton.setText("Dectivate Door");
    deactivateDoorButton.setBounds(173, 520, 117, 26);
    deliveryPanel.add(deactivateDoorButton);

    clearReportButton = new JButton();
    clearReportButton.addMouseListener(new ClearReportButtonMouseListener());
    clearReportButton.setText("Clear Report");
    clearReportButton.setBounds(737, 520, 117, 26);
    deliveryPanel.add(clearReportButton);
    rowSM.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            // Ignore extra messages.
            if (e.getValueIsAdjusting())
                return;

            ListSelectionModel lsm = (ListSelectionModel) e.getSource();
            if (lsm.isSelectionEmpty()) {
                // no rows are selected
            } else {
                selectedRow = lsm.getMinSelectionIndex();
                System.out.println("selectedRow = " + selectedRow);

            }
        }
    });

    shipmentPanel = new JPanel();
    tabbedPane.addTab("Shipment", null, shipmentPanel, null);

    panel = new JPanel();
    panel.setLayout(null);
    tabbedPane.addTab("Door Config", null, panel, null);

    aleListeningPortTextField = new JTextField();
    aleListeningPortTextField.setText("9999");
    aleListeningPortTextField.setBounds(172, 41, 330, 20);
    panel.add(aleListeningPortTextField);

    epcisRepositoryURLTextField = new JTextField();
    epcisRepositoryURLTextField.setText("http://localhost:8080/aspire0.3.0EpcisRepository/capture");
    epcisRepositoryURLTextField.setBounds(172, 65, 330, 20);
    panel.add(epcisRepositoryURLTextField);

    entryDateLabel_3_3 = new JLabel();
    entryDateLabel_3_3.setText("EPCIS Rep. URL .........");
    entryDateLabel_3_3.setBounds(51, 67, 117, 16);
    panel.add(entryDateLabel_3_3);

    entryDateLabel_2_1 = new JLabel();
    entryDateLabel_2_1.setText("ALE Listening Port ....");
    entryDateLabel_2_1.setBounds(51, 43, 117, 16);
    panel.add(entryDateLabel_2_1);

}

From source file:org.ow2.aspirerfid.demos.warehouse.management.UI.WMS.java

/**
 * Initialize the contents of the frame//w  ww  . ja  va2 s  .  c o  m
 */
private void initialize() {

    final JLabel entryDateLabel_2;
    final JLabel entryDateLabel_3_1_1;
    final JScrollPane scrollPane;
    final JButton printReportButton;
    final JButton saveReportButton;
    final JButton clearReportButton;
    frame = new JFrame();
    frame.setResizable(false);
    frame.addWindowListener(new FrameWindowListener());
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setTitle("Warehouse Management");
    frame.setBounds(100, 100, 757, 625);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    tabbedPane = new JTabbedPane();
    frame.getContentPane().add(tabbedPane);

    deliveryTableModel = new DefaultTableModel();// All Clients Items
    deliveryTableModel.addColumn("Company");
    deliveryTableModel.addColumn("Item Code");
    deliveryTableModel.addColumn("Description");
    deliveryTableModel.addColumn("Quantity Delivered");
    deliveryTableModel.addColumn("Expected Quantity");
    deliveryTableModel.addColumn("Quantity Remain");
    deliveryTableModel.addColumn("Delivery Date");
    deliveryTableModel.addColumn("Measurement ID");

    deliveryInfoModel = new DefaultTableModel();// All Clients Items
    deliveryInfoModel.addColumn("Company");
    deliveryInfoModel.addColumn("Item Code");
    deliveryInfoModel.addColumn("Description");
    deliveryInfoModel.addColumn("Expected Quantity");
    deliveryInfoModel.addColumn("Measurement ID");

    shipmentPanel = new JPanel();
    shipmentPanel.setLayout(null);
    tabbedPane.addTab("Shipment", null, shipmentPanel, null);

    submitShipmentButton = new JButton();
    submitShipmentButton.addActionListener(new SubmitShipmentButtonActionListener());

    submitShipmentButton.setText("Submit");
    submitShipmentButton.setBounds(275, 89, 112, 25);
    shipmentPanel.add(submitShipmentButton);

    final JLabel selectAvaiableInvoiceLabel = new JLabel();
    selectAvaiableInvoiceLabel.setText("Select avaiable invoice to track");
    selectAvaiableInvoiceLabel.setBounds(58, 26, 195, 15);
    shipmentPanel.add(selectAvaiableInvoiceLabel);

    shipmentsCb = new JComboBox();
    shipmentsCb.setModel(new DefaultComboBoxModel(new String[] {}));
    shipmentsCb.setSelectedItem(null);
    shipmentsCb.addActionListener(new ShipmentsCbActionListener());
    shipmentsCb.setBounds(269, 21, 382, 24);
    shipmentPanel.add(shipmentsCb);

    final JPanel panel = new JPanel();
    panel.setLayout(null);
    panel.setBorder(new TitledBorder(null, "Shipment information", TitledBorder.DEFAULT_JUSTIFICATION,
            TitledBorder.DEFAULT_POSITION, null, null));
    panel.setBounds(10, 170, 722, 327);
    shipmentPanel.add(panel);

    final JScrollPane scrollPane_1 = new JScrollPane();
    scrollPane_1.setBounds(10, 27, 702, 300);
    panel.add(scrollPane_1);

    deliveryInfo = new JTable(deliveryInfoModel);
    deliveryInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scrollPane_1.setViewportView(deliveryInfo);

    deliveryPanel = new JPanel();
    deliveryPanel.setLayout(null);
    tabbedPane.addTab("Delivery Counter", null, deliveryPanel, null);

    entryDateLabel_2 = new JLabel();
    entryDateLabel_2.setText("Invoice ID ");
    entryDateLabel_2.setBounds(10, 23, 117, 16);
    deliveryPanel.add(entryDateLabel_2);

    entryDateLabel_3_1_1 = new JLabel();
    entryDateLabel_3_1_1.setText("Offering Date");
    entryDateLabel_3_1_1.setBounds(391, 25, 117, 16);
    deliveryPanel.add(entryDateLabel_3_1_1);

    invoiceIDTextField = new JTextField();
    invoiceIDTextField.setEditable(false);
    invoiceIDTextField.setBounds(105, 21, 270, 20);
    deliveryPanel.add(invoiceIDTextField);

    offeringDateTextField = new JTextField();
    offeringDateTextField.setEditable(false);
    offeringDateTextField.setBounds(511, 23, 230, 20);
    deliveryPanel.add(offeringDateTextField);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(10, 81, 731, 403);
    deliveryPanel.add(scrollPane);
    deliveryTable = new JTable(deliveryTableModel);
    deliveryTable.setFont(new Font("Arial Narrow", Font.PLAIN, 10));
    deliveryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    scrollPane.setViewportView(deliveryTable);

    printReportButton = new JButton();
    printReportButton.setText("Print Report");
    printReportButton.setBounds(459, 520, 117, 26);
    deliveryPanel.add(printReportButton);

    saveReportButton = new JButton();
    saveReportButton.setText("Save Report");
    saveReportButton.setBounds(213, 520, 117, 26);
    deliveryPanel.add(saveReportButton);

    clearReportButton = new JButton();
    clearReportButton.addMouseListener(new ClearReportButtonMouseListener());
    clearReportButton.setText("Clear Report");
    clearReportButton.setBounds(336, 520, 117, 26);
    deliveryPanel.add(clearReportButton);

}

From source file:org.owasp.jbrofuzz.fuzz.ui.FuzzingPanel.java

/**
 * <p>//w  w w .  ja v  a 2  s  .  c  o  m
 * This constructor is used for the " Fuzzing " panel that resides under the
 * FrameWindow, within the corresponding tabbed panel.
 * </p>
 * 
 * 
 * @param mWindow
 *            FrameWindow
 */
public FuzzingPanel(final JBroFuzzWindow mWindow) {

    super(" Fuzzing ", mWindow);

    counter = 0;
    payload = "";
    stopped = true;

    // Set the enabled options: Start, Stop, Pause, Add, Remove
    setOptionsAvailable(true, false, false, true, false);

    // The Target panel
    final JPanel targetPanel = new JPanel(new BorderLayout());
    targetPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(" Target "),
            BorderFactory.createEmptyBorder(1, 1, 1, 1)));

    urlField = new JTextField();
    urlField.setEditable(true);
    urlField.setVisible(true);
    urlField.setFont(new Font("Verdana", Font.BOLD, 12));
    urlField.setToolTipText("[{Protocol} :// {Host} [:{Port}]]");
    urlField.setMargin(new Insets(1, 1, 1, 1));
    urlField.setBackground(Color.WHITE);
    urlField.setForeground(Color.BLACK);

    requestPane = createEditablePane();

    // Right click: Cut, Copy, Paste, Select All
    AbstractPanel.popupText(urlField, true, true, true, true);

    targetPanel.add(urlField);

    // The fuzzers panel
    fuzzersPanel = new FuzzersPanel(this);

    // The on the wire panel
    final JPanel onTheWirePanel = new JPanel();
    onTheWirePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(" Requests "),
            BorderFactory.createEmptyBorder(5, 5, 5, 5)));

    mWireTextArea = new WireTextArea();

    // Right click: Cut, Copy, Paste, Select All
    RightClickPopups.rightClickOnTheWireTextComponent(this, mWireTextArea);

    final JScrollPane consoleScrollPane = new JScrollPane(mWireTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    onTheWirePanel.setLayout(new BorderLayout());
    onTheWirePanel.add(consoleScrollPane, BorderLayout.CENTER);

    // Set the scroll areas
    topPanel = new JPanel(new BorderLayout());
    topPanel.add(targetPanel, BorderLayout.PAGE_START);
    topPanel.add(createScrollingPanel(" Request ", requestPane), BorderLayout.CENTER);

    // create the outlining tabbed pane
    fuzzerWindowPane = new JTabbedPane();

    bottomPane = new FuzzSplitPane(FuzzSplitPane.HORIZONTAL_SPLIT, FuzzSplitPane.FUZZ_BOTTOM);

    bottomPane.setLeftComponent(fuzzersPanel);
    transformsPanel = new TransformsPanel(this);
    bottomPane.setRightComponent(transformsPanel);

    mainPane = new FuzzSplitPane(FuzzSplitPane.VERTICAL_SPLIT, FuzzSplitPane.FUZZ_MAIN);
    mainPane.setOneTouchExpandable(false);
    mainPane.setTopComponent(topPanel);
    mainPane.setBottomComponent(bottomPane);

    // Allow for all areas to be resized to even not be seen
    topPanel.setMinimumSize(JBroFuzzFormat.ZERO_DIM);
    bottomPane.setMinimumSize(JBroFuzzFormat.ZERO_DIM);

    // Create the outputPanel
    outputPanel = new OutputPanel(this);

    // add the respective panes/panels to the tabbed pane
    fuzzerWindowPane.addTab("Input", mainPane);
    fuzzerWindowPane.addTab("Output", outputPanel);
    fuzzerWindowPane.addTab("On the wire", onTheWirePanel);
    add(fuzzerWindowPane, BorderLayout.CENTER);

    // Display the last displayed url/request
    setTextURL(JBroFuzz.PREFS.get(JBroFuzzPrefs.TEXT_URL, ""));
    setTextRequest(JBroFuzz.PREFS.get(JBroFuzzPrefs.TEXT_REQUEST, ""));
}

From source file:org.parosproxy.paros.extension.history.ManualRequestEditorDialog.java

private JTabbedPane getPanelTab() {
    if (panelTab == null) {
        panelTab = new JTabbedPane();
        panelTab.setDoubleBuffered(true);
        panelTab.addTab("Request", null, getRequestPanel(), null);
        panelTab.addTab("Response", null, getResponsePanel(), null);
    }//from w ww. j a  va  2s .  c o  m
    return panelTab;
}

From source file:org.pentaho.reporting.engine.classic.core.modules.gui.pdf.PdfExportDialog.java

private void initializeComponents() {
    setTitle(getResources().getString("pdfsavedialog.dialogtitle")); //$NON-NLS-1$

    txAuthor = new JTextField();
    txAuthor.setColumns(40);//from  w  w w  .  ja  va 2  s.c  o  m
    txTitle = new JTextField();
    txTitle.setColumns(40);
    txKeywords = new JTextField();
    txKeywords.setColumns(40);
    txDescription = new JTextField();
    txDescription.setColumns(40);

    rbSecurityNone = new JRadioButton(getResources().getString("pdfsavedialog.securityNone")); //$NON-NLS-1$
    rbSecurity40Bit = new JRadioButton(getResources().getString("pdfsavedialog.security40bit")); //$NON-NLS-1$
    rbSecurity128Bit = new JRadioButton(getResources().getString("pdfsavedialog.security128bit")); //$NON-NLS-1$

    final Action securitySelectAction = new ActionSecuritySelection();
    rbSecurityNone.addActionListener(securitySelectAction);
    rbSecurity40Bit.addActionListener(securitySelectAction);
    rbSecurity128Bit.addActionListener(securitySelectAction);

    rbSecurity128Bit.setSelected(true);

    txUserPassword = new JPasswordField();
    txConfUserPassword = new JPasswordField();
    txOwnerPassword = new JPasswordField();
    txConfOwnerPassword = new JPasswordField();

    cxAllowCopy = new JCheckBox(getResources().getString("pdfsavedialog.allowCopy")); //$NON-NLS-1$
    cbAllowPrinting = new JComboBox(getPrintingComboBoxModel());
    cxAllowScreenReaders = new JCheckBox(getResources().getString("pdfsavedialog.allowScreenreader")); //$NON-NLS-1$

    cxAllowAssembly = new JCheckBox(getResources().getString("pdfsavedialog.allowAssembly")); //$NON-NLS-1$
    cxAllowModifyContents = new JCheckBox(getResources().getString("pdfsavedialog.allowModifyContents")); //$NON-NLS-1$
    cxAllowModifyAnnotations = new JCheckBox(getResources().getString("pdfsavedialog.allowModifyAnnotations")); //$NON-NLS-1$
    cxAllowFillIn = new JCheckBox(getResources().getString("pdfsavedialog.allowFillIn")); //$NON-NLS-1$

    txFilename = new JTextField();
    txFilename.setColumns(40);
    statusBar = new JStatusBar();

    encodingModel = EncodingComboBoxModel.createDefaultModel(Locale.getDefault());
    encodingModel.sort();

    cbEncoding = new JComboBox(encodingModel);
    cxEmbedded = new JCheckBox(getResources().getString("pdfsavedialog.embedfonts"));

    getFormValidator().registerTextField(txFilename);
    getFormValidator().registerTextField(txConfOwnerPassword);
    getFormValidator().registerTextField(txConfUserPassword);
    getFormValidator().registerTextField(txUserPassword);
    getFormValidator().registerTextField(txOwnerPassword);

    final JPanel exportPane = createExportPanel();
    final Configuration config = ClassicEngineBoot.getInstance().getGlobalConfig();
    final boolean advancedSettingsTabAvail = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.gui.pdf.AdvancedSettingsAvailable"));
    final boolean metaDataSettingsTabAvail = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.gui.pdf.MetaDataSettingsAvailable"));
    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.add(getResources().getString("pdfsavedialog.export-settings"), exportPane); //$NON-NLS-1$
    tabbedPane.add(getResources().getString("pdfsavedialog.parameters"), getParametersPanel());

    if (metaDataSettingsTabAvail) {
        tabbedPane.add(getResources().getString("pdfsavedialog.metadata-settings"), createMetaDataPanel()); //$NON-NLS-1$
    }
    if (advancedSettingsTabAvail) {
        tabbedPane.add(getResources().getString("pdfsavedialog.advanced-settings"), createAdvancedPanel()); //$NON-NLS-1$
    }
    setContentPane(createContentPane(tabbedPane));

}

From source file:org.pentaho.reporting.ui.datasources.jdbc.ui.JdbcDataSourceDialog.java

protected Component createContentPane() {
    // Create the connection panel
    final JPanel queryContentPanel = new JPanel(new BorderLayout());
    queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel());
    queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel());

    // Create the content panel
    final JPanel dialogContent = new JPanel(new BorderLayout());
    dialogContent.add(BorderLayout.WEST, connectionComponent);
    dialogContent.add(BorderLayout.CENTER, queryContentPanel);

    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab(Messages.getString("JdbcDataSourceDialog.DataSource"), dialogContent);
    tabbedPane.addTab(Messages.getString("JdbcDataSourceDialog.GlobalScripting"), createGlobalScriptTab());

    final JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel());
    contentPane.add(BorderLayout.CENTER, tabbedPane);
    contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));

    // Return the center panel
    return contentPane;
}

From source file:org.pentaho.reporting.ui.datasources.jdbc.ui.JdbcDataSourceDialog.java

private JPanel createQueryDetailsPanel() {
    final JPanel queryNamePanel = new JPanel(new BorderLayout());
    queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
    queryNamePanel.add(new JLabel(Messages.getString("JdbcDataSourceDialog.QueryStringLabel")),
            BorderLayout.NORTH);//  w ww.  j  ava  2 s .co  m
    queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH);

    final InvokeQueryDesignerAction queryDesignerAction = new InvokeQueryDesignerAction();
    dialogModel.addPropertyChangeListener(queryDesignerAction);

    final JPanel queryButtonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 5));
    queryButtonsPanel.add(new BorderlessButton(queryDesignerAction));

    final JPanel queryControlsPanel = new JPanel(new BorderLayout());
    queryControlsPanel.add(new JLabel(Messages.getString("JdbcDataSourceDialog.QueryDetailsLabel")),
            BorderLayout.WEST);
    queryControlsPanel.add(queryButtonsPanel, BorderLayout.EAST);

    final JPanel queryPanel = new JPanel(new BorderLayout());
    queryPanel.add(queryControlsPanel, BorderLayout.NORTH);
    queryPanel.add(new RTextScrollPane(500, 300, queryTextArea, true), BorderLayout.CENTER);
    queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));

    final JTabbedPane queryScriptTabPane = new JTabbedPane();
    queryScriptTabPane.addTab(Messages.getString("JdbcDataSourceDialog.StaticQuery"), queryPanel);
    queryScriptTabPane.addTab(Messages.getString("JdbcDataSourceDialog.QueryScripting"),
            createQueryScriptTab());

    // Create the query details panel
    final JPanel queryDetailsPanel = new JPanel(new BorderLayout());
    queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel);
    queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane);
    return queryDetailsPanel;
}

From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java

protected Component createContentPane() {

    // Create the connection panel
    final JPanel queryContentPanel = new JPanel(new BorderLayout());
    queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel());
    queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel());

    final JdbcConnectionPanel connectionPanel = new JdbcConnectionPanel(dialogModel, context);
    connectionPanel.setSecurityConfigurationAvailable(false);

    // Create the content panel
    final JPanel dialogContent = new JPanel(new BorderLayout());
    dialogContent.add(BorderLayout.NORTH, createConnectionTopPanel());
    dialogContent.add(BorderLayout.WEST, connectionPanel);
    dialogContent.add(BorderLayout.CENTER, queryContentPanel);

    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.DataSource"), dialogContent);
    tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.GlobalScripting"), createGlobalScriptTab());

    final JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel());
    contentPane.add(BorderLayout.CENTER, tabbedPane);
    contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
    return contentPane;
}

From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java

private JPanel createQueryDetailsPanel() {
    final JPanel queryNamePanel = new JPanel(new BorderLayout());
    queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
    queryNamePanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryNameLabel")),
            BorderLayout.NORTH);//  ww  w  . j  av  a 2 s. co  m
    queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH);

    final JPanel queryControlPanel = new JPanel(new BorderLayout());
    queryControlPanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryLabel")),
            BorderLayout.WEST);

    final JPanel queryPanel = new JPanel(new BorderLayout());
    queryPanel.add(queryControlPanel, BorderLayout.NORTH);
    queryPanel.add(new JScrollPane(queryTextArea), BorderLayout.CENTER);
    queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));

    final JTabbedPane queryScriptTabPane = new JTabbedPane();
    queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.StaticQuery"), queryPanel);
    queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.QueryScripting"),
            createQueryScriptTab());

    // Create the query details panel
    final JPanel queryDetailsPanel = new JPanel(new BorderLayout());
    queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel);
    queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane);
    return queryDetailsPanel;
}

From source file:org.pentaho.reporting.ui.datasources.olap4j.Olap4JDataSourceEditor.java

protected Component createContentPane() {
    // Create the connection panel
    final JPanel queryContentPanel = new JPanel(new BorderLayout());
    queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel());
    queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel());

    // Create the content panel
    final JPanel dialogContent = new JPanel(new BorderLayout());
    dialogContent.add(BorderLayout.WEST, connectionComponent);
    dialogContent.add(BorderLayout.CENTER, queryContentPanel);

    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.DataSource"), dialogContent);
    tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.GlobalScripting"), createGlobalScriptTab());

    final JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel());
    contentPane.add(BorderLayout.CENTER, tabbedPane);
    contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
    return contentPane;
}