This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help!How to refresh view

 
swenling wen
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I click a button,will generate a treeviewer in a viewpart,but can show the treeview only when I change the dimension of viewpart.How to show the treeviewer in a viewpart ?
Thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "treeviewer" and "viewpart" ?
 
swenling wen
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to refresh viewpart?
 
Santhosh Kumar
Ranch Hand
Posts: 242
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you referring to Swing or Eclipse SWT? either case, post some sample test case so it will be more clear.
 
swenling wen
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SWT!

getSite().getPage().addSelectionListener(new ISelectionListener() {
public void selectionChanged(final IWorkbenchPart workbenchPart,
final ISelection selection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
final TreeEntity treeEntity = (TreeEntity) structuredSelection
.getFirstElement();
setPartName(treeEntity.getName());
text.setText(treeEntity.getName());
try {
getSite().getPage().showView(CorporationView.ID,treeEntity.getName(),IWorkbenchPage.VIEW_CREATE);

//this,I will refresh another viewpart .How to do?
 
swenling wen
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SWT!

getSite().getPage().addSelectionListener(new ISelectionListener() {
public void selectionChanged(final IWorkbenchPart workbenchPart,
final ISelection selection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
final TreeEntity treeEntity = (TreeEntity) structuredSelection
.getFirstElement();
setPartName(treeEntity.getName());
text.setText(treeEntity.getName());
try {
getSite().getPage().showView(CorporationView.ID,treeEntity.getName(),IWorkbenchPage.VIEW_CREATE);

//this,I will refresh CorporationView .How to do?
 
swenling wen
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and again question,how to get the path of plugin project?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic