/** * Update the ui, when the aid has changed. */ public void refresh() { // Force table repaint (hack???). tableChanged(new TableModelEvent(getModel(), TableModelEvent.HEADER_ROW)); if(editable) { // Hack!!! Have to (re)set column width for buttons. JButton but = new JButton(icons.getIcon("delete")); but.setMargin(new Insets(0,0,0,0)); getColumnModel().getColumn(0).setMaxWidth(but.getPreferredSize().width); } // Hack!!! For the table to be relayouted, we have to revalidate the scroll pane. this.invalidate(); this.validate(); this.repaint(); }
public Object getValueAt(int rowIndex, int columnIndex) { if((!editable || columnIndex!=0) && rowIndex<getEntries().length) { return getEntries()[rowIndex]; } else { return ""; } }
/** * */ public void clearTests() { tests.clear(); teststable.setEntries(new String[0]); }
/** * Set the entries. * @param entries The entries. */ public void setEntries(String[] entries) { this.entries = entries!=null ? SUtil.arrayToList(entries) : new ArrayList(); if(!allowduplicates) removeDuplicates(); refresh(); }
/** * Perform the action. */ public void actionPerformed(ActionEvent e) { if(includes && add) { AwarenessAgentPanel.this.includes.addEntry(entry); } else if(includes && !add) { AwarenessAgentPanel.this.includes.removeEntry(entry); } else if(!includes && add) { AwarenessAgentPanel.this.excludes.addEntry(entry); } else if(!includes && !add) { AwarenessAgentPanel.this.excludes.removeEntry(entry); } applySettings(); } }
public void actionPerformed(java.awt.event.ActionEvent e) { // System.out.println("remove"); // ((AbstractTableModel)getModel()).fireTableRowsDeleted(rowIndex, rowIndex); Object entry = entries.remove(rowIndex); ((AbstractTableModel)getModel()).fireTableChanged(new EditableListEvent(getModel(), rowIndex, rowIndex, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE, new Object[]{entry})); fireEditingStopped(); refresh(); } });
testcases.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), " Test suite settings ")); this.teststable = new EditableList("Test cases", true); teststable.getModel().addTableModelListener(new TableModelListener() teststable.setPreferredScrollableViewportSize(new Dimension(400, 200)); // todo: hack tfto = new JTextField("", 6); tfto.setMinimumSize(tfto.getPreferredSize());
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1,1,1,1), 0, 0)); taddresses = new EditableList("Addresses"); taddresses.getModel().addTableModelListener(new TableModelListener()
AwarenessAgentPanel.this.includes.getEntries(), AwarenessAgentPanel.this.excludes.getEntries())) excludes.addEntry(entry); applySettings();
/** * Update the ui, when the aid has changed. */ protected void refresh() { // Update the gui. if(!nameediting) { // tfname.getDocument().removeDocumentListener(namelistener); tfname.setText(this.cid.getName()); // tfname.getDocument().addDocumentListener(namelistener); } taddresses.setEntries(this.cid.getAddresses()); taddresses.refresh(); this.invalidate(); this.validate(); this.repaint(); }
public void actionPerformed(ActionEvent ae) { teststable.setAllowDuplicates(allowduplicates.isSelected()); } });
/** * Set the list title. * @param title The title. */ public void setTitle(String title) { this.title = title; refresh(); }
/** * Remove a test. */ public void removeTest(String model, IResourceIdentifier rid) { tests.remove(new Tuple2<String, IResourceIdentifier>(model, rid)); teststable.removeEntry(model); }
public void customResultAvailable(Tuple2<String, String> result) { tests.add(new Tuple2<String, IResourceIdentifier>(result.getFirstEntity(), rid)); teststable.addEntry(result.getFirstEntity()); } });
/** * Test if duplicates are allowed. * @return True if allowed. */ public boolean allowDuplicates() { return teststable.isAllowDuplicates(); }
testcases.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), " Test suite settings ")); this.teststable = new EditableList("Test cases", true); teststable.getModel().addTableModelListener(new TableModelListener() teststable.setPreferredScrollableViewportSize(new Dimension(400, 200)); // todo: hack tfto = new JTextField("", 6); tfto.setMinimumSize(tfto.getPreferredSize());
includes = new EditableList("Includes"); excludes = new EditableList("Excludes"); JScrollPane pincludes = new JScrollPane(includes); JScrollPane pexcludes = new JScrollPane(excludes); cbautocreate.addActionListener(al); cbautodelete.addActionListener(al); includes.getModel().addTableModelListener(tml); excludes.getModel().addTableModelListener(tml);
AwarenessAgentPanel.this.includes.getEntries(), AwarenessAgentPanel.this.excludes.getEntries())) excludes.addEntry(entry); applySettings();
/** * Perform the action. */ public void actionPerformed(ActionEvent e) { if(includes && add) { AwarenessAgentPanel.this.includes.addEntry(entry); } else if(includes && !add) { AwarenessAgentPanel.this.includes.removeEntry(entry); } else if(!includes && add) { AwarenessAgentPanel.this.excludes.addEntry(entry); } else if(!includes && !add) { AwarenessAgentPanel.this.excludes.removeEntry(entry); } applySettings(); } }