Changes

Jump to: navigation, search

Teams Winter 2011/team1/RCP/Define and use editors

355 bytes added, 19:26, 4 March 2011
3. Define and Use Editors
<source lang=java>
 
public class callEditor extends AbstractHandler {
}
</source>
3.4.2 Add a "double click" event listener to the <code>StudentsView</code> class <br/>For this, we need to add <code>doubleClick''hookDoubleClick()''</code> method to the </code>StudentsView.java </code>. <br/>The view makes his viewer available as selection provider via the following line:<br/><code>''getSite().setSelectionProvider(viewer);''</code> <br/>This make is possible for the command which opens the editor to get the selection of the view. All workbench parts have a site, which can be accessed via the method <code>getSite()</code>.
<source lang=java>
 
private void hookDoubleClickCommand() {
viewer.addDoubleClickListener(new IDoubleClickListener() {
1
edit

Navigation menu