/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
private boolean sortByName = true;
private boolean sortReversed = false;
/** Takes a Debugger in constructor. Updates the list once during
construction; list can be updated automatically by "starting"
the panel. */
super();
update();
dataModel = new AbstractTableModel() {
public int getColumnCount() { return 2; }
switch (col) {
case 0:
return "Process Name";
case 1:
return "Process ID";
default:
}
}
switch (col) {
case 0:
case 1:
default:
}
}
};
// Create user interface
setLayout(new BorderLayout());
header.setReorderingAllowed(false);
table.setRowSelectionAllowed(true);
table.setColumnSelectionAllowed(false);
// Provide sorting in similar fashion to Task Manager
public void mousePressed(MouseEvent e) {
if (column != -1) {
if (newSortByName == sortByName) {
// Switch sense of "reversed" instead
} else {
sortReversed = false;
}
// Keep the current selection if possible
int i = table.getSelectedRow();
if (i >= 0) {
table.setRowSelectionInterval(i, i);
} else {
}
}
}
}
});
}
}
/** Set update interval for automatic updating of the process list */
}
/** Start auto updating of the panel */
public void start() {
}
/** Stop auto updating of the panel */
public void stop() {
}
/** Call this to update the panel's notion of the process list */
public synchronized void update() {
if (!dbg.hasProcessList()) {
throw new RuntimeException("ProcessListPanel requires that debugger supports getProcessList()");
}
// Keep the current selection if possible
int i = table.getSelectedRow();
if (i >= 0) {
table.setRowSelectionInterval(i, i);
} else {
}
}
} else {
}
}
/** Call this to get the selected ProcessInfo, or null if none selected */
int i = table.getSelectedRow();
if (i < 0) {
return null;
}
}
Comparator c;
if (sortByName) {
c = new Comparator() {
}
};
} else {
c = new Comparator() {
int ret;
else ret = 1;
}
};
}
}
public void actionPerformed(ActionEvent e) {
update();
}
});
}
return timer;
}
}
return i;
}
}
return -1;
}
}