private JComponent scrolleable(final JComponent comp) { final JScrollPane scroll = WidgetUtils.scrolleable(comp); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); return scroll; }
protected JComponent wrapInScrollPane(final JComponent panel) { final JScrollPane scroll = WidgetUtils.scrolleable(panel); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); return scroll; }
public static JScrollPane scrollable(final JComponent comp, final int maxHeight) { final JScrollPane scrollPane = WidgetUtils.scrolleable(comp); if (comp.getPreferredSize().getHeight() > maxHeight) { final Dimension preferredSize = comp.getPreferredSize(); final Dimension newSize = new Dimension(preferredSize.width, maxHeight); scrollPane.getViewport().setPreferredSize(newSize); } return scrollPane; }
/** * Wraps a content panel in a scroll pane and applies a maximum width to the * content to keep it nicely in place on the screen. * * @param panel * @return */ protected JScrollPane wrapContent(final JComponent panel) { panel.setMaximumSize(new Dimension(WIDTH_CONTENT, Integer.MAX_VALUE)); panel.setAlignmentX(Component.LEFT_ALIGNMENT); final DCPanel wrappingPanel = new DCPanel(); final BoxLayout layout = new BoxLayout(wrappingPanel, BoxLayout.PAGE_AXIS); wrappingPanel.setLayout(layout); wrappingPanel.add(panel); wrappingPanel.setBorder(new EmptyBorder(0, MARGIN_LEFT, 0, 0)); return WidgetUtils.scrolleable(wrappingPanel); }
public DCTablePanel(final JTable table, final boolean scrolleable) { _table = table; setLayout(new BorderLayout()); final JTableHeader tableHeader = table.getTableHeader(); add(tableHeader, BorderLayout.NORTH); tableHeader.setBorder(WidgetUtils.BORDER_TABLE_PANEL); table.setBorder(WidgetUtils.BORDER_TABLE_PANEL); if (scrolleable) { _scrollPane = WidgetUtils.scrolleable(table); add(_scrollPane, BorderLayout.CENTER); } else { _scrollPane = null; add(table, BorderLayout.CENTER); } }
private DCPanel createRegexDetailsPanel() { final JToolBar toolBar = WidgetFactory.createToolBar(); toolBar.add(Box.createHorizontalGlue()); toolBar.add(_importRegexButton); final DCPanel toolBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); toolBarPanel.setLayout(new BorderLayout()); toolBarPanel.add(toolBar, BorderLayout.CENTER); final DCPanel panel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); panel.setLayout(new BorderLayout()); panel.add(_regexSelectionTable.toPanel(), BorderLayout.NORTH); panel.add(WidgetUtils.scrolleable(_regexDescriptionLabel), BorderLayout.CENTER); panel.add(toolBarPanel, BorderLayout.SOUTH); return panel; }
@Override public final JComponent getWidget() { final DCPanel panel = new DCPanel(); int row = layoutGridBagAboveCredentials(panel); row = layoutGridBagCredentials(panel, row); layoutGridBagBelowCredentials(panel, row); return WidgetUtils.scrolleable(panel); }
@Override protected JComponent getWindowContent() { if (!_results.isEmpty()) { for (final AnalyzerResult analyzerResult : _results) { final Renderer<? super AnalyzerResult, ? extends JComponent> renderer = _rendererFactory.getRenderer(analyzerResult, SwingRenderingFormat.class); final JComponent component; if (renderer == null) { component = new JTextArea(analyzerResult.toString()); } else { component = renderer.render(analyzerResult); } addRenderedResult(component); } } final DCPanel panel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); panel.setLayout(new BorderLayout()); panel.add(WidgetUtils.scrolleable(_taskPaneContainer), BorderLayout.CENTER); final Dimension preferredSize = panel.getPreferredSize(); final int height = preferredSize.height < 400 ? preferredSize.height + 100 : preferredSize.height; final int width = preferredSize.width < 500 ? 500 : preferredSize.width; panel.setPreferredSize(width, height); return panel; }
public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); taskPaneContainer.setLayout(new BorderLayout(MARGIN, MARGIN)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, MARGIN, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }
@Override protected JComponent getDialogContent() { final DCPanel regexDetailsPanel = createRegexDetailsPanel(); final DCPanel treePanel = new DCPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND); treePanel.setBorder(WidgetUtils.BORDER_WIDE_ALTERNATIVE); treePanel.setLayout(new BorderLayout()); treePanel.add(WidgetUtils.scrolleable(_categoryTree), BorderLayout.CENTER); final DCPanel panel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); panel.setLayout(new BorderLayout()); panel.add(new CollapsibleTreePanel(treePanel), BorderLayout.WEST); panel.add(regexDetailsPanel, BorderLayout.CENTER); updateCategories(); return panel; }
+ "YARN_CONF_DIR environment variables, or you can register a custom cluster using the options " + "available in this dialog."), BorderLayout.NORTH); add(WidgetUtils.scrolleable(_connectionsConfigurationsPanel), BorderLayout.CENTER);
protected AbstractComponentBuilderPanel(final Image watermarkImage, final int watermarkHorizontalPosition, final int watermarkVerticalPosition, final ComponentBuilder componentBuilder, final PropertyWidgetFactory propertyWidgetFactory) { super(watermarkImage, watermarkHorizontalPosition, watermarkVerticalPosition, WidgetUtils.COLOR_WELL_BACKGROUND); _taskPaneContainer = WidgetFactory.createTaskPaneContainer(); _taskPaneContainer.setLayout(new VerticalLayout(4)); _componentBuilder = componentBuilder; _descriptor = componentBuilder.getDescriptor(); _propertyWidgetFactory = propertyWidgetFactory; _propertyWidgetCollection = propertyWidgetFactory.getPropertyWidgetCollection(); _outputDataStreamsViewer = new OutputDataStreamsViewer(_componentBuilder); setLayout(new BorderLayout()); final JScrollPane scrolleable = WidgetUtils.scrolleable(_taskPaneContainer); add(scrolleable, BorderLayout.CENTER); _buttonPanel = createTopButtonPanel(); add(_buttonPanel, BorderLayout.NORTH); }
final JScrollPane scroll = WidgetUtils.scrolleable(panel); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); add(scroll, BorderLayout.CENTER);
@Override protected JComponent getDialogContent() { final DCPanel contentPanel = new DCPanel(); contentPanel.setLayout(new GridBagLayout()); final DCPanel listPanel = new DCPanel(); listPanel.setBackground(WidgetUtils.COLOR_WELL_BACKGROUND); listPanel.setLayout(new VerticalLayout()); listPanel.add(_serverList); final DCLabel label = DCLabel.dark("Please select the Hadoop cluster to connect to:"); label.setFont(WidgetUtils.FONT_HEADER2); WidgetUtils.addToGridBag(label, contentPanel, 0, 0, 1.0, 0.0); WidgetUtils.addToGridBag(listPanel, contentPanel, 0, 1, 1, 2, GridBagConstraints.NORTH, 10, 1.0, 1.0); WidgetUtils.addToGridBag(_optionsButton, contentPanel, 1, 1, GridBagConstraints.SOUTH); WidgetUtils.addToGridBag(_okButton, contentPanel, 1, 2, GridBagConstraints.NORTH); final JScrollPane scrolleable = WidgetUtils.scrolleable(contentPanel); scrolleable.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); final DCPanel outerPanel = new DCPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND); outerPanel.setLayout(new BorderLayout()); outerPanel.add(scrolleable, BorderLayout.CENTER); outerPanel.setPreferredSize(getDialogWidth(), 300); return outerPanel; }
return WidgetUtils.scrolleable(outerPanel);
@Override protected JComponent getDialogContent() { final DCPanel formPanel = new DCPanel(); // temporary variable to make it easier to refactor the layout WidgetUtils.addToGridBag(DCLabel.bright("Datastore name:"), formPanel, 0, 0); WidgetUtils.addToGridBag(_datastoreNameField, formPanel, 1, 0); final DCPanel checkBoxPanel = new DCPanel().setTitledBorder("Contained datastores"); checkBoxPanel.setLayout(new VerticalLayout(4)); for (final JCheckBox checkBox : _checkBoxes) { checkBoxPanel.add(checkBox); } final JScrollPane checkBoxScrollPane = WidgetUtils.scrolleable(checkBoxPanel); checkBoxScrollPane.setPreferredSize(new Dimension(checkBoxPanel.getWidth(), 300)); checkBoxScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); checkBoxScrollPane.setBackground(_outerPanel.getBackground()); WidgetUtils.addToGridBag(checkBoxScrollPane, formPanel, 0, 1, 2, 1); final DCPanel buttonPanel = getButtonPanel(); final DCPanel centerPanel = new DCPanel(); centerPanel.setLayout(new VerticalLayout(4)); centerPanel.add(formPanel); centerPanel.add(buttonPanel); final JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel); _outerPanel.setLayout(new BorderLayout()); _outerPanel.add(centerPanel, BorderLayout.CENTER); _outerPanel.add(statusBar, BorderLayout.SOUTH); return _outerPanel; }
WidgetUtils.addToGridBag(buttonPanel, panel, 0, row, 2, 1); row++; WidgetUtils.addToGridBag(WidgetUtils.scrolleable(_columnsListPanel), panel, 0, row, 2, 1, GridBagConstraints.NORTHWEST, 0, 1.0, 1.0, GridBagConstraints.BOTH); row++;
WidgetUtils.addToGridBag(WidgetUtils.scrolleable(_valuesTextArea), formPanel, 1, row);
southPanel.add(getOpenAsTemplateButton()); add(WidgetUtils.scrolleable(northPanel), BorderLayout.CENTER); add(southPanel, BorderLayout.SOUTH);
final JScrollPane scrollArea = WidgetUtils.scrolleable(listPanel); scrollArea.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);