box.setForeground(Color.WHITE); box.setFocusable(false); box.setPrototypeDisplayValue("XXXXXXXX"); //sorry but this is the way to keep the size of the combobox in check. try
public void setPrototypeDisplayValue(Object prototypeDisplayValue) { combo.setPrototypeDisplayValue(prototypeDisplayValue); }
public Container createStyleBox() { final JComboBox stylesBox = new JComboBoxWithBorder(styles); stylesBox.setPrototypeDisplayValue("XXXXXXXXXXXXXXXXXXXXXXXX"); stylesBox.setRenderer(new ComboBoxRendererWithTooltip(stylesBox)); return stylesBox; }
public ComponentConfigurationPanel(ComponentActivity activity) { this.activity = activity; componentVersionChoice.setPrototypeDisplayValue(SHORT_STRING); configBean = activity.getConfiguration(); initGui(); }
public SharingPolicyChooserPanel() { super(); permissionBox.setPrototypeDisplayValue(LONG_STRING); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = WEST; gbc.fill = NONE; this.add(new JLabel(SHARING_LABEL), gbc); gbc.gridx = 1; gbc.weightx = 1; gbc.fill = BOTH; this.add(permissionBox, gbc); permissionBox.setEditable(false); }
public LicenseChooserPanel() { super(); licenseBox.setPrototypeDisplayValue(LONG_STRING); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = WEST; gbc.fill = NONE; this.add(new JLabel("License:"), gbc); gbc.gridx = 1; gbc.weightx = 1; gbc.fill = BOTH; this.add(licenseBox, gbc); licenseBox.setEditable(false); licenseBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == SELECTED) setLicense(licenseMap.get(licenseBox.getSelectedItem())); } }); }
public ProfileChooserPanel() { super(); profileBox.setPrototypeDisplayValue(LONG_STRING); this.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = WEST; gbc.fill = NONE; this.add(new JLabel(PROFILE_LABEL), gbc); gbc.gridx = 1; gbc.weightx = 1; gbc.fill = BOTH; this.add(profileBox, gbc); profileBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == SELECTED) setProfile(profileMap.get(profileBox.getSelectedItem())); } }); profileBox.setEditable(false); }
public FamilyChooserPanel() { familyBox.setPrototypeDisplayValue(LONG_STRING); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = WEST; gbc.fill = NONE; this.add(new JLabel(FAMILY_LABEL), gbc); gbc.gridx = 1; gbc.weightx = 1; gbc.fill = BOTH; this.add(familyBox, gbc); familyBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == SELECTED) { updateDescription(); notifyObservers(); } } }); familyBox.setEditable(false); }
/** * Creates the Organism Combo Box. * * @return JComboBox Object. */ private JComboBox createOrganismComboBox() { // Organism List is currently hard-coded. Vector<Organism> organismList = new Vector<Organism>(); organismList.add(new Organism("All Organisms", -1)); organismList.addAll(CPathProperties.getInstance().getOrganismList()); DefaultComboBoxModel organismComboBoxModel = new DefaultComboBoxModel(organismList); JComboBox organismComboBox = new JComboBox(organismComboBoxModel); organismComboBox.setToolTipText("Select Organism"); organismComboBox.setMaximumSize(new Dimension(200, 9999)); organismComboBox.setPrototypeDisplayValue("12345678901234567"); return organismComboBox; }
/** * Creates the Organism Combo Box. * * @return JComboBox Object. */ private JComboBox createOrganismComboBox() { // Organism List is currently hard-coded. Vector organismList = new Vector(); organismList.add(new Organism("All Organisms", -1)); CPathProperties props = CPathProperties.getInstance(); organismList.addAll(props.getOrganismList()); DefaultComboBoxModel organismComboBoxModel = new DefaultComboBoxModel(organismList); JComboBox organismComboBox = new JComboBox(organismComboBoxModel); organismComboBox.setToolTipText("Select Organism"); organismComboBox.setMaximumSize(new Dimension(200, 9999)); organismComboBox.setPrototypeDisplayValue("12345678901234567"); return organismComboBox; }
public RegistryChooserPanel() { setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); registryMap = pref.getRegistryMap(); registryBox = new JComboBox(registryMap.keySet().toArray()); registryBox.setPrototypeDisplayValue(LONG_STRING); registryBox.setEditable(false); gbc.gridx = 0; gbc.anchor = WEST; this.add(new JLabel(REGISTRY_LABEL), gbc); gbc.gridx = 1; gbc.weightx = 1; gbc.fill = BOTH; this.add(registryBox, gbc); registryBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == SELECTED) dealWithSelection(); } }); String firstKey = registryMap.firstKey(); registryBox.setSelectedItem(firstKey); dealWithSelection(); }
private JPanel createSourceProductPanel() { final JPanel masterPanel = new JPanel(new BorderLayout(3, 3)); masterPanel.add(masterProductSelector.getProductNameLabel(), BorderLayout.NORTH); masterProductSelector.getProductNameComboBox().setPrototypeDisplayValue( "MER_RR__1PPBCM20030730_071000_000003972018_00321_07389_0000.N1"); masterPanel.add(masterProductSelector.getProductNameComboBox(), BorderLayout.CENTER); masterPanel.add(masterProductSelector.getProductFileChooserButton(), BorderLayout.EAST); final JPanel slavePanel = new JPanel(new BorderLayout(3, 3)); slavePanel.add(slaveProductSelector.getProductNameLabel(), BorderLayout.NORTH); slavePanel.add(slaveProductSelector.getProductNameComboBox(), BorderLayout.CENTER); slavePanel.add(slaveProductSelector.getProductFileChooserButton(), BorderLayout.EAST); final TableLayout layout = new TableLayout(1); layout.setTableAnchor(TableLayout.Anchor.WEST); layout.setTableFill(TableLayout.Fill.HORIZONTAL); layout.setTableWeightX(1.0); layout.setCellPadding(0, 0, new Insets(3, 3, 3, 3)); layout.setCellPadding(1, 0, new Insets(3, 3, 3, 3)); final JPanel panel = new JPanel(layout); panel.setBorder(BorderFactory.createTitledBorder("Source Products")); panel.add(masterPanel); panel.add(slavePanel); return panel; }
private JPanel createSourceProductPanel() { final JPanel masterPanel = new JPanel(new BorderLayout(3, 3)); masterPanel.add(masterProductSelector.getProductNameLabel(), BorderLayout.NORTH); masterProductSelector.getProductNameComboBox().setPrototypeDisplayValue( "MER_RR__1PPBCM20030730_071000_000003972018_00321_07389_0000.N1"); masterPanel.add(masterProductSelector.getProductNameComboBox(), BorderLayout.CENTER); masterPanel.add(masterProductSelector.getProductFileChooserButton(), BorderLayout.EAST); final JPanel slavePanel = new JPanel(new BorderLayout(3, 3)); slavePanel.add(slaveProductSelector.getProductNameLabel(), BorderLayout.NORTH); slavePanel.add(slaveProductSelector.getProductNameComboBox(), BorderLayout.CENTER); slavePanel.add(slaveProductSelector.getProductFileChooserButton(), BorderLayout.EAST); final TableLayout layout = new TableLayout(1); layout.setTableAnchor(TableLayout.Anchor.WEST); layout.setTableFill(TableLayout.Fill.HORIZONTAL); layout.setTableWeightX(1.0); layout.setCellPadding(0, 0, new Insets(3, 3, 3, 3)); layout.setCellPadding(1, 0, new Insets(3, 3, 3, 3)); final JPanel panel = new JPanel(layout); panel.setBorder(BorderFactory.createTitledBorder("Source Products")); panel.add(masterPanel); panel.add(slavePanel); return panel; }
search = new JButton(I18N.getLocaleString("FILTER_TEXSEARCH")); resolution.setPrototypeDisplayValue("xxxxxxxxxxxxxxxxxxxxxxxxxx"); compatiblePack.setPrototypeDisplayValue("xxxxxxxxxxxxxxxxxxxxxxxxxx");
public ObjectComboBox(final IObjectListConfiguration<T> configuration, final IComboBoxModel<T> listModel) { this.objectModel = listModel; final JComboBox<T> list = new JComboBox<>(listModel); list.setRenderer( new ObjectUiListCellRenderer<>( configuration.getObjectUiCellRendererConfiguration(), configuration.getObjectUi())); list.setPrototypeDisplayValue(configuration.getPrototype()); list.setMaximumRowCount(configuration.getVisibleRowCount()); this.component = list; }
public Container createSizeBox() { final JComboBox sizeBox = new JComboBoxWithBorder(size); sizeBox.setPrototypeDisplayValue("88888"); sizeBox.setPreferredSize(sizeBox.getPreferredSize()); sizeBox.setEditor(new FixedBasicComboBoxEditor()); sizeBox.setEditable(true); return sizeBox; }
protected void updateCellPanelWidth() { if (getPrototypeDisplayValue() != null) { getComboBox().setPrototypeDisplayValue(getPrototypeDisplayValue()); return; } String value = null; for (CheckState checkState : CheckState.values()) { String text = getTextFor(checkState); if (text != null) { if (value == null) { value = text; } else if (text.length() > value.length()) { value = text; } } } ListCheckModel m = getModel(); for (int i = 0; i < m.getSize(); i++) { String str = m.getElementAt(i).toString(); if (value == null) { value = str; } else if (str.length() > value.length()) { value = str; } } getComboBox().setPrototypeDisplayValue(value); }
private JPanel createSourceProductPanel() { final JPanel panel = sourceProductSelector.createDefaultPanel(); sourceProductSelector.getProductNameLabel().setText("Name:"); sourceProductSelector.getProductNameComboBox().setPrototypeDisplayValue( "MER_RR__1PPBCM20030730_071000_000003972018_00321_07389_0000.N1"); sourceProductSelector.addSelectionChangeListener(new AbstractSelectionChangeListener() { @Override public void selectionChanged(SelectionChangeEvent event) { final Product sourceProduct = getSourceProduct(); updateTargetProductName(sourceProduct); GeoPos centerGeoPos = null; if (sourceProduct != null) { centerGeoPos = ProductUtils.getCenterGeoPos(sourceProduct); } infoForm.setCenterPos(centerGeoPos); if (outputGeometryModel != null) { outputGeometryModel.setSourceProduct(sourceProduct); } updateCRS(); } }); return panel; }
private JPanel createSourceProductPanel() { final JPanel panel = sourceProductSelector.createDefaultPanel(); sourceProductSelector.getProductNameLabel().setText("Name:"); sourceProductSelector.getProductNameComboBox().setPrototypeDisplayValue( "MER_RR__1PPBCM20030730_071000_000003972018_00321_07389_0000.N1"); sourceProductSelector.addSelectionChangeListener(new AbstractSelectionChangeListener() { @Override public void selectionChanged(SelectionChangeEvent event) { final Product sourceProduct = getSourceProduct(); updateTargetProductName(sourceProduct); GeoPos centerGeoPos = null; if (sourceProduct != null) { centerGeoPos = ProductUtils.getCenterGeoPos(sourceProduct); } infoForm.setCenterPos(centerGeoPos); if (outputGeometryModel != null) { outputGeometryModel.setSourceProduct(sourceProduct); } updateCRS(); } }); return panel; }
private JPanel createTargetPanel() { targetNodesModel = new DefaultComboBoxModel<>(); targetNodes = new JComboBox<>(targetNodesModel); targetNodes.setPrototypeDisplayValue(""); // $NON-NLS-1$ // Bug 56303 fixed the width of combo list JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes, 0); // get popup element JScrollPane scrollPane = findScrollPane(popup); if(scrollPane != null) { scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); // add scroll pane if label element is too long scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); } targetNodes.setActionCommand(CHANGE_TARGET); // Action listener will be added later JLabel label = new JLabel(JMeterUtils.getResString("proxy_target")); // $NON-NLS-1$ label.setLabelFor(targetNodes); HorizontalPanel panel = new HorizontalPanel(); panel.add(label); panel.add(targetNodes); return panel; }