Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想向具有一列的 TreeViewer 添加某种类型的侦听器,以便它可以知道它所在的 ViewPart 何时变宽或变窄,从而更改 TreeViewer 中一列的宽度以匹配它所在的 ViewPart 的宽度。
创建 ViewPart 时试试这个:
@Override public void createPartControl(final Composite parent) { parent.addControlListener(new ControlAdapter() { @Override public void controlResized(final ControlEvent e) { System.out.println("RESIZE"); } }); }