use of java.awt.Component in project enclojure by EricThorsen.
the class ClojureTemplateWizardIterator method initialize.
public void initialize(WizardDescriptor wiz) {
this.wiz = wiz;
index = 0;
panels = createPanels();
// Make sure list of steps is accurate.
String[] steps = createSteps();
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName();
}
if (c instanceof JComponent) {
// assume Swing components
JComponent jc = (JComponent) c;
// Step #.
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
// Step name (actually the whole list for reference).
jc.putClientProperty("WizardPanel_contentData", steps);
}
}
}
use of java.awt.Component in project zaproxy by zaproxy.
the class SpiderPanel method getUrlsTable.
/**
* Gets the scan results table.
*
* @return the scan results table
*/
private JXTable getUrlsTable() {
if (urlsTable == null) {
// Create the table with a default, empty TableModel and the proper settings
urlsTable = new ZapTable(EMPTY_URLS_TABLE_MODEL);
urlsTable.setColumnSelectionAllowed(false);
urlsTable.setCellSelectionEnabled(false);
urlsTable.setRowSelectionAllowed(true);
urlsTable.setAutoCreateRowSorter(true);
urlsTable.setAutoCreateColumnsFromModel(false);
urlsTable.getColumnExt(0).setCellRenderer(new DefaultTableRenderer(new MappedValue(StringValues.EMPTY, IconValues.NONE), JLabel.CENTER));
urlsTable.getColumnExt(0).setHighlighters(new ProcessedCellItemIconHighlighter(0));
urlsTable.getColumnModel().getColumn(0).setMinWidth(80);
// processed
urlsTable.getColumnModel().getColumn(0).setPreferredWidth(90);
urlsTable.getColumnModel().getColumn(1).setMinWidth(60);
// method
urlsTable.getColumnModel().getColumn(1).setPreferredWidth(70);
// name
urlsTable.getColumnModel().getColumn(2).setMinWidth(300);
urlsTable.getColumnModel().getColumn(3).setMinWidth(50);
// flags
urlsTable.getColumnModel().getColumn(3).setPreferredWidth(250);
urlsTable.setName(PANEL_NAME);
urlsTable.setDoubleBuffered(true);
urlsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
urlsTable.setComponentPopupMenu(new JPopupMenu() {
private static final long serialVersionUID = 6608291059686282641L;
@Override
public void show(Component invoker, int x, int y) {
View.getSingleton().getPopupMenu().show(invoker, x, y);
}
});
}
return urlsTable;
}
use of java.awt.Component in project otapij by FellowTraveler.
the class CustomTable method prepareRenderer.
public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
if (c instanceof JComponent) {
JComponent jc = (JComponent) c;
if (getValueAt(rowIndex, vColIndex) instanceof String) {
//Utility.getKeyFromName((String)getValueAt(rowIndex, vColIndex));
String value = (String) getValueAt(rowIndex, vColIndex);
if (this.getModel() instanceof AccountTableModel && vColIndex == 0) {
value = (String) this.getModel().getValueAt(rowIndex, 3);
}
if (this.getModel() instanceof NYMTableModel && vColIndex == 0) {
value = (String) this.getModel().getValueAt(rowIndex, 1);
}
if (this.getModel() instanceof BasketTableModel && vColIndex == 0) {
value = (String) this.getModel().getValueAt(rowIndex, 1);
}
if (this.getModel() instanceof AssetContractTableModel && vColIndex == 0) {
value = (String) this.getModel().getValueAt(rowIndex, 1);
}
if (this.getModel() instanceof ServerContractTableModel && vColIndex == 0) {
value = (String) this.getModel().getValueAt(rowIndex, 1);
}
if (this.getModel() instanceof OTOutboxTableModel) {
if (vColIndex == 4)
value = (String) this.getModel().getValueAt(rowIndex, 8);
if (vColIndex == 5)
value = (String) this.getModel().getValueAt(rowIndex, 9);
}
if (this.getModel() instanceof OTInboxTableModel) {
if (vColIndex == 4)
value = (String) this.getModel().getValueAt(rowIndex, 10);
if (vColIndex == 5)
value = (String) this.getModel().getValueAt(rowIndex, 11);
}
if (this.getModel() instanceof NYMOutboxTableModel) {
if (vColIndex == 1)
value = (String) this.getModel().getValueAt(rowIndex, 4);
if (vColIndex == 2)
value = (String) this.getModel().getValueAt(rowIndex, 5);
}
if (this.getModel() instanceof NYMBoxTableModel) {
if (vColIndex == 1)
value = (String) this.getModel().getValueAt(rowIndex, 4);
if (vColIndex == 2)
value = (String) this.getModel().getValueAt(rowIndex, 5);
}
jc.setToolTipText(value);
}
}
return c;
}
use of java.awt.Component in project zaproxy by zaproxy.
the class StandardFieldsDialog method setComboFields.
public void setComboFields(String fieldLabel, String[] choices, String value) {
Component c = this.fieldMap.get(fieldLabel);
if (c instanceof JComboBox) {
@SuppressWarnings("unchecked") JComboBox<String> comboBox = (JComboBox<String>) c;
comboBox.removeAllItems();
for (String str : choices) {
comboBox.addItem(str);
}
if (value != null) {
comboBox.setSelectedItem(value);
}
} else if (c == null) {
// Ignore - could be during init
logger.debug("No field for " + fieldLabel);
} else {
logger.error("Unrecognised field class " + fieldLabel + ": " + c.getClass().getCanonicalName());
}
}
use of java.awt.Component in project zaproxy by zaproxy.
the class TabbedPanel2 method setCloseButtonStates.
private void setCloseButtonStates() {
// Hide all 'close' buttons except for the selected tab
for (int i = 0; i < this.getTabCount(); i++) {
Component tabCom = this.getTabComponentAt(i);
if (tabCom != null && tabCom instanceof TabbedPanelTab) {
TabbedPanelTab jp = (TabbedPanelTab) tabCom;
jp.setEnabled(i == getSelectedIndex());
}
}
}
Aggregations