/** * Creates a new table model using the properties of the current Java * Virtual Machine. */ public SystemPropertiesTableModel() { this.properties = new java.util.ArrayList(); try { final Properties p = System.getProperties(); final Iterator iterator = p.keySet().iterator(); while (iterator.hasNext()) { final String name = (String) iterator.next(); final String value = System.getProperty(name); final SystemProperty sp = new SystemProperty(name, value); this.properties.add(sp); } } catch (SecurityException se) { // ignore SecurityExceptions } Collections.sort(this.properties, new SystemPropertyComparator(true)); final String baseName = "org.jfree.ui.about.resources.AboutResources"; final ResourceBundle resources = ResourceBundleWrapper.getBundle( baseName); this.nameColumnLabel = resources.getString( "system-properties-table.column.name"); this.valueColumnLabel = resources.getString( "system-properties-table.column.value"); }
/** * Creates a new table model using the properties of the current Java * Virtual Machine. */ public SystemPropertiesTableModel() { this.properties = new java.util.ArrayList(); try { final Properties p = System.getProperties(); final Iterator iterator = p.keySet().iterator(); while (iterator.hasNext()) { final String name = (String) iterator.next(); final String value = System.getProperty(name); final SystemProperty sp = new SystemProperty(name, value); this.properties.add(sp); } } catch (SecurityException se) { // ignore SecurityExceptions } Collections.sort(this.properties, new SystemPropertyComparator(true)); final String baseName = "org.jfree.ui.about.resources.AboutResources"; final ResourceBundle resources = ResourceBundleWrapper.getBundle( baseName); this.nameColumnLabel = resources.getString( "system-properties-table.column.name"); this.valueColumnLabel = resources.getString( "system-properties-table.column.value"); }
/** * Creates a new table model using the properties of the current Java Virtual Machine. */ public SystemPropertiesTableModel() { this.properties = new java.util.ArrayList(); try { final Properties p = System.getProperties(); final Iterator iterator = p.keySet().iterator(); while (iterator.hasNext()) { final String name = (String) iterator.next(); final String value = System.getProperty(name); final SystemProperty sp = new SystemProperty(name, value); this.properties.add(sp); } } catch (SecurityException se) { // ignore SecurityExceptions } Collections.sort(this.properties, new SystemPropertyComparator(true)); final String baseName = "org.jfree.ui.about.resources.AboutResources"; final ResourceBundle resources = ResourceBundle.getBundle(baseName); this.nameColumnLabel = resources.getString("system-properties-table.column.name"); this.valueColumnLabel = resources.getString("system-properties-table.column.value"); }
/** * Returns the value at the specified row and column. This method supports the TableModel * interface. * * @param row the row index. * @param column the column index. * * @return the value. */ public Object getValueAt(final int row, final int column) { final SystemProperty sp = (SystemProperty) this.properties.get(row); if (column == 0) { return sp.getName(); } else { if (column == 1) { return sp.getValue(); } else { return null; } } }
/** * Compares two objects. * * @param o1 the first object. * @param o2 the second object. * * @return an integer that indicates the relative order of the objects. */ public int compare(final Object o1, final Object o2) { if ((o1 instanceof SystemProperty) && (o2 instanceof SystemProperty)) { final SystemProperty sp1 = (SystemProperty) o1; final SystemProperty sp2 = (SystemProperty) o2; if (this.ascending) { return sp1.getName().compareTo(sp2.getName()); } else { return sp2.getName().compareTo(sp1.getName()); } } else { return 0; } }
/** * Compares two objects. * * @param o1 the first object. * @param o2 the second object. * * @return an integer that indicates the relative order of the objects. */ public int compare(final Object o1, final Object o2) { if ((o1 instanceof SystemProperty) && (o2 instanceof SystemProperty)) { final SystemProperty sp1 = (SystemProperty) o1; final SystemProperty sp2 = (SystemProperty) o2; if (this.ascending) { return sp1.getName().compareTo(sp2.getName()); } else { return sp2.getName().compareTo(sp1.getName()); } } else { return 0; } }
/** * Compares two objects. * * @param o1 the first object. * @param o2 the second object. * * @return an integer that indicates the relative order of the objects. */ public int compare(final Object o1, final Object o2) { if ((o1 instanceof SystemProperty) && (o2 instanceof SystemProperty)) { final SystemProperty sp1 = (SystemProperty) o1; final SystemProperty sp2 = (SystemProperty) o2; if (this.ascending) { return sp1.getName().compareTo(sp2.getName()); } else { return sp2.getName().compareTo(sp1.getName()); } } else { return 0; } }
/** * Returns the value at the specified row and column. This method supports * the TableModel interface. * * @param row the row index. * @param column the column index. * * @return the value. */ public Object getValueAt(final int row, final int column) { final SystemProperty sp = (SystemProperty) this.properties.get(row); if (column == 0) { return sp.getName(); } else { if (column == 1) { return sp.getValue(); } else { return null; } } }
/** * Returns the value at the specified row and column. This method supports * the TableModel interface. * * @param row the row index. * @param column the column index. * * @return the value. */ public Object getValueAt(final int row, final int column) { final SystemProperty sp = (SystemProperty) this.properties.get(row); if (column == 0) { return sp.getName(); } else { if (column == 1) { return sp.getValue(); } else { return null; } } }