This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 11850 - (List|Tree)TableView to openide.explorer
Summary: (List|Tree)TableView to openide.explorer
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: jrojcek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-30 13:57 UTC by Jaroslav Tulach
Modified: 2008-12-22 21:58 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2001-04-30 13:57:45 UTC
Please move these classes to Open API, so I can suggest other module owners to
use them ;-)
Comment 1 jrojcek 2001-05-02 16:32:44 UTC
So, I think classes are ready to move to openide. I just want you to know public
API (changed a little bit from core version). I have made TableSheet package
private as Yarda suggested. It doesn't work with Explorer manager. I think that
its subclass should add that behavior (TreeSheetView?).

public class org.openide.explorer.view.NodeTableModel extends AbstractTableModel {
    public void setNodes(Node[] nodes);
    public void setProperties(Node.Property[] props);
    protected Node.Property getPropertyFor(Node node, Node.Property prop);
}

public org.openide.explorer.TreeTableView extends BeanTreeView {
    public TreeTableView();
    public TreeTableView(NodeTableModel ntm);
    public void setProperties(Node.Property[] props);
    public void setTableAutoResizeMode(int mode); ?? due to ui tuning
    public TableColumn getTableColumn(Node.Property prop); ?? due to ui tuning
    public void setTreeWidth(int width); ?? due to ui tuning
}

public org.openide.explorer.ListTableView extends ListView {
    public ListTableView();
    public ListTableView(NodeTableModel ntm);
    public void setProperties(Node.Property[] props);
    public void setTableAutoResizeMode(int mode); ?? due to ui tuning
    public TableColumn getTableColumn(Node.Property); ?? due to ui tuning
    public void setListWidth(int width); ?? due to ui tuning
}

Comment 2 Jaroslav Tulach 2001-05-03 16:58:17 UTC
"public TableColumn getTableColumn(Node.Property); ?? due to ui tuning"

is a bit dangerous. If you need it just to set preferred size, etc. It is ok,
but the TableColumn offers a lot of additional methods for example setModelIndex
and I am not sure if this should be exposed to publics.

"protected TableColumn createTableColumn (Node.Property)"

that would be called just once for each property would be better, but still this
results in a need to subclass if somebody wants to change settings.

Btw. setProperties also is not something perfect, it just delegates to
NodeTableModel, so why the model itself is not used to change the properties?

IMHO autoresizemode & tree/list width can be treated as regular properties, just
make those methods final. 
Comment 3 jrojcek 2001-05-03 17:24:51 UTC
OK,
what about regular properties:
  tableAutoResizeMode, (tree|list)PreferredWidth
and indexed property:
  tableColumnPreferredWidth

I will make setters and getters for them. With setTableColumnPreferredWidth(int
index, int width) I can live without access to TableColumn. I think index is
better then Node.Property for identyfing column. Or not?

I can get off setProperties() but then constructor without NodeTableModel
doesn't make sense.
Comment 4 Jan Chalupa 2001-05-06 08:14:49 UTC
Target milestone -> 3.3
Comment 5 jrojcek 2001-05-09 12:22:30 UTC
Classes were moved.