public ObjectTableSorter(ObjectTableModel model) { this.model = model; this.valueComparators = new Comparator<?>[this.model.getColumnCount()]; for (int i = 0; i < valueComparators.length; i++) { this.setValueComparator(i, null); } setFallbackComparator(null); }
/** * Sets {@link #getPrimaryComparator() primary comparator} to one that don't sort last row. * @return <code>this</code> */ public ObjectTableSorter fixLastRow() { return setPrimaryComparator(new PreserveLastRowComparator()); }
public Object getValueAt(int column) { return getModel().getValueAt(getIndex(), column); } }
public void clear() { this.consumerKey.setText(""); this.consumerSecret.setText(""); this.httpMethods.setText("GET"); this.hostBaseUrl.setText(""); this.headers.setText(""); this.resource.setText(""); this.port.setText("8080"); this.useKeepAlive.setSelected(true); this.automaticRedirect.setSelected(true); this.body.setText(""); }
/** * Sets the host to use. * * @param hostname The hostname to use. */ public void setHost(final String hostname) { this.host.setText(hostname); }
/** * Clear all rows from the table. */ public void clear() { GuiUtils.stopTableEditing(table); tableModel.clearData(); }
/** * * @param row */ public void addRow(AbstractGraphRow row) { ((ObjectTableModel) dataModel).addRow(row); }
@Override public int compare(Row o1, Row o2) { int lastIndex = model.getRowCount() - 1; if (o1.getIndex() >= lastIndex || o2.getIndex() >= lastIndex) { return o1.getIndex() - o2.getIndex(); } return 0; } }
/** * Stop any editing that is currently being done on the table. This will * save any changes that have already been made. * Needed for subclasses */ protected void stopTableEditing() { GuiUtils.stopTableEditing(table); }
public MenuScrollItem(MenuIcon icon, int increment) { setIcon(icon); setDisabledIcon(icon); timer = new MenuScrollTimer(increment, interval); addChangeListener(this); }
/** * Registers a popup menu to be scrolled with the default number of items to * display at a time and the default scrolling interval. * * @param menu * the popup menu * @return the MenuScroller */ public static MenuScroller setScrollerFor(JPopupMenu menu) { return new MenuScroller(menu); }
/** * Comparator used prior to sorted columns. * @param primaryComparator {@link Comparator} to be used first * @return <code>this</code> */ public ObjectTableSorter setPrimaryComparator(Comparator<Row> primaryComparator) { invalidate(); this.primaryComparator = primaryComparator; return this; }
/** * The default implementation will use DefaultTreeTableModel */ public JTreeTable() { super(new DefaultTreeTableModel()); }
public void clear() { this.consumerKey.setText(""); this.consumerSecret.setText(""); this.httpMethods.setText("GET"); this.hostBaseUrl.setText(""); this.headers.setText(""); this.resource.setText(""); this.port.setText("8080"); this.useKeepAlive.setSelected(true); this.automaticRedirect.setSelected(true); this.body.setText(""); }
/** * Sets the password to use. * * @param pwd The password to use. */ public void setPwd(final String pwd) { this.pwd.setText(pwd); }
/** * Clear all rows from the table. T.Elanjchezhiyan(chezhiyan@siptech.co.in) */ public void clear() { GuiUtils.stopTableEditing(table); tableModel.clearData(); }
/** * Add a single file to the table * @param f The name of the file to be added */ public void addFilename(String f) { tableModel.addRow(f); }
/** * Registers a menu to be scrolled with the default number of items to * display at a time and the default scrolling interval. * * @param menu * the menu * @return the MenuScroller */ public static MenuScroller setScrollerFor(JMenu menu) { return new MenuScroller(menu); }
/** * Sets the user to use. * * @param username The user name to use. */ public void setUser(final String username) { this.user.setText(username); }