Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Closing a View or making a View invisible
Closing a View or making a View invisible [message #441220] Thu, 12 August 2004 13:22 Go to next message
Matthew Perrins is currently offline Matthew PerrinsFriend
Messages: 18
Registered: July 2009
Junior Member
Sorry for the newbee question,

Anybody have an example code snippet for closing a view, I keep closing
the perspective, but just want the view that is inside closed. So I can
use ShowView() on it later.

Thanks

Matthew Perrins
IBM Software
Re: Closing a View or making a View invisible [message #441225 is a reply to message #441220] Thu, 12 August 2004 14:55 Go to previous messageGo to next message
Richard Moore is currently offline Richard MooreFriend
Messages: 71
Registered: July 2009
Member
An example which hides or shows view... toggles.



public void run(IAction action) {



IWorkbenchPage page =
myWorkbench.getActiveWorkbenchWindow().getActivePage();

if (page instanceof IWorkbenchPage) {

IViewPart viewPart =
page.findView("ch.innotion.capri.client.ui.view.auditTrailInfoView ");

if (viewPart != null) {

page.hideView(viewPart);

}

else {

try {

page.showView("ch.innotion.capri.client.ui.view.auditTrailInfoView ");

}

catch (Exception e) {

LOG.error("Cannot show view");

}

}

}

}


"Matthew Perrins" <matthew_perrins@uk.ibm.com> wrote in message
news:cffqqr$h97$1@eclipse.org...
> Sorry for the newbee question,
>
> Anybody have an example code snippet for closing a view, I keep closing
> the perspective, but just want the view that is inside closed. So I can
> use ShowView() on it later.
>
> Thanks
>
> Matthew Perrins
> IBM Software
Re: Closing a View or making a View invisible [message #441236 is a reply to message #441225] Thu, 12 August 2004 16:02 Go to previous message
Matthew Perrins is currently offline Matthew PerrinsFriend
Messages: 18
Registered: July 2009
Junior Member
Richard,

Thank you very much, just what I need,

Cheers

mMatt


Richard Moore wrote:

> An example which hides or shows view... toggles.
>
>
>
> public void run(IAction action) {
>
>
>
> IWorkbenchPage page =
> myWorkbench.getActiveWorkbenchWindow().getActivePage();
>
> if (page instanceof IWorkbenchPage) {
>
> IViewPart viewPart =
> page.findView("ch.innotion.capri.client.ui.view.auditTrailInfoView ");
>
> if (viewPart != null) {
>
> page.hideView(viewPart);
>
> }
>
> else {
>
> try {
>
> page.showView("ch.innotion.capri.client.ui.view.auditTrailInfoView ");
>
> }
>
> catch (Exception e) {
>
> LOG.error("Cannot show view");
>
> }
>
> }
>
> }
>
> }
>
>
> "Matthew Perrins" <matthew_perrins@uk.ibm.com> wrote in message
> news:cffqqr$h97$1@eclipse.org...
>
>>Sorry for the newbee question,
>>
>>Anybody have an example code snippet for closing a view, I keep closing
>>the perspective, but just want the view that is inside closed. So I can
>>use ShowView() on it later.
>>
>>Thanks
>>
>>Matthew Perrins
>>IBM Software
>
>
>
Previous Topic:How to align column of TableViewer
Next Topic:Restrict window size in SWT
Goto Forum:
  


Current Time: Fri Apr 26 10:39:00 GMT 2024

Powered by FUDForum. Page generated in 0.02501 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top