SSP
SSP

Reputation: 2670

Eclipse plugin "copy treeItem or tree data "

I am working on Eclipse plugin. In this I am creating a view like console which is based on tree structure.

I am creating tree like below --

ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL );
Composite composite1 = new Composite(sc, SWT.NONE);
Composite composite_1 = creatingcomposite(composite1);   
final Tree tree = new Tree(composite_1,  SWT.FULL_SELECTION );
TreeItem item = new TreeItem(tree, SWT.NONE);   
TreeItem subItem = new TreeItem(item, SWT.NONE);
TreeItem subsubItem = new TreeItem(subItem, SWT.NONE);

Now I want to copy some data of node(Like item or sub item),

In any node of tree or tree item suppose there is some data like " Hi this is ram and my contact number is 123456789658" now from this row i want to select/copy the contact number.

so how can I do it with the help of mouse (as we use in any other interface like wordpad).

Upvotes: 0

Views: 392

Answers (1)

Chandrayya G K
Chandrayya G K

Reputation: 8849

  1. Look at swt snippets for basic swt tree and menu examples.

  2. Create menu(pop up menu) on tree item(s).

  3. On click of menu items (say copy phone number) get the selected node text and extract the phone number out of this.

Upvotes: 2

Related Questions