Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » removing workbench menus throws NPE
removing workbench menus throws NPE [message #93330] Mon, 14 July 2003 13:53 Go to next message
Eclipse UserFriend
Originally posted by: rdearing.cysive.com

All,

I have my own perspective and I need to remove the standard menu's from
the workbench. I am using the MenuManager to individually remove each menu
(is this
the right approach?). While executing the following code, there are
NullPointerExceptions
thrown when the workbench appears.

WorkbenchWindow window = null;

Workbench bench = (Workbench)super.getWorkbench();

if (bench != null)

{

IWorkbenchWindow[] windows = bench.getWorkbenchWindows();

for (int i = 0; i < windows.length; i++)

{

window = (WorkbenchWindow)windows[i];

if (window != null)

{

MenuManager manager = window.getMenuBarManager();

manager.setRemoveAllWhenShown(true);

manager.remove(IWorkbenchActionConstants.M_HELP);

manager.remove(IWorkbenchActionConstants.M_NAVIGATE);

manager.remove(IWorkbenchActionConstants.M_EDIT);

manager.remove(IWorkbenchActionConstants.M_PROJECT);

manager.remove(IWorkbenchActionConstants.M_WINDOW);

}

}
Re: removing workbench menus throws NPE [message #93387 is a reply to message #93330] Mon, 14 July 2003 15:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

Sorry, but you can't do that. Are you trying to write a standalone
application using Eclipse as the UI? If so, you may be interested in the
rich client platform work we are doing for 3.0 release.

Simon :-)

"Ron" <rdearing@cysive.com> wrote in message
news:beuqlk$fh5$1@eclipse.org...
> All,
>
> I have my own perspective and I need to remove the standard menu's from
> the workbench. I am using the MenuManager to individually remove each menu
> (is this
> the right approach?). While executing the following code, there are
> NullPointerExceptions
> thrown when the workbench appears.
>
> WorkbenchWindow window = null;
>
> Workbench bench = (Workbench)super.getWorkbench();
>
> if (bench != null)
>
> {
>
> IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
>
> for (int i = 0; i < windows.length; i++)
>
> {
>
> window = (WorkbenchWindow)windows[i];
>
> if (window != null)
>
> {
>
> MenuManager manager = window.getMenuBarManager();
>
> manager.setRemoveAllWhenShown(true);
>
> manager.remove(IWorkbenchActionConstants.M_HELP);
>
> manager.remove(IWorkbenchActionConstants.M_NAVIGATE);
>
> manager.remove(IWorkbenchActionConstants.M_EDIT);
>
> manager.remove(IWorkbenchActionConstants.M_PROJECT);
>
> manager.remove(IWorkbenchActionConstants.M_WINDOW);
>
> }
>
> }
>
>
>
>
Re: removing workbench menus throws NPE [message #94098 is a reply to message #93387] Tue, 15 July 2003 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rdearing.cysive.com

Actually, I have my own plugin and perspective.

When will this functionality be available in the 3.0 release?


"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:beuvno$lnn$1@eclipse.org...
> Sorry, but you can't do that. Are you trying to write a standalone
> application using Eclipse as the UI? If so, you may be interested in the
> rich client platform work we are doing for 3.0 release.
>
> Simon :-)
>
> "Ron" <rdearing@cysive.com> wrote in message
> news:beuqlk$fh5$1@eclipse.org...
> > All,
> >
> > I have my own perspective and I need to remove the standard menu's from
> > the workbench. I am using the MenuManager to individually remove each
menu
> > (is this
> > the right approach?). While executing the following code, there are
> > NullPointerExceptions
> > thrown when the workbench appears.
> >
> > WorkbenchWindow window = null;
> >
> > Workbench bench = (Workbench)super.getWorkbench();
> >
> > if (bench != null)
> >
> > {
> >
> > IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
> >
> > for (int i = 0; i < windows.length; i++)
> >
> > {
> >
> > window = (WorkbenchWindow)windows[i];
> >
> > if (window != null)
> >
> > {
> >
> > MenuManager manager = window.getMenuBarManager();
> >
> > manager.setRemoveAllWhenShown(true);
> >
> > manager.remove(IWorkbenchActionConstants.M_HELP);
> >
> > manager.remove(IWorkbenchActionConstants.M_NAVIGATE);
> >
> > manager.remove(IWorkbenchActionConstants.M_EDIT);
> >
> > manager.remove(IWorkbenchActionConstants.M_PROJECT);
> >
> > manager.remove(IWorkbenchActionConstants.M_WINDOW);
> >
> > }
> >
> > }
> >
> >
> >
> >
>
>
Re: removing workbench menus throws NPE [message #94155 is a reply to message #94098] Tue, 15 July 2003 13:31 Go to previous message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

The plan is to have some working rich client platform for M3

Simon :-)

"Ron" <rdearing@cysive.com> wrote in message
news:bf15su$t48$1@eclipse.org...
> Actually, I have my own plugin and perspective.
>
> When will this functionality be available in the 3.0 release?
>
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:beuvno$lnn$1@eclipse.org...
> > Sorry, but you can't do that. Are you trying to write a standalone
> > application using Eclipse as the UI? If so, you may be interested in the
> > rich client platform work we are doing for 3.0 release.
> >
> > Simon :-)
> >
> > "Ron" <rdearing@cysive.com> wrote in message
> > news:beuqlk$fh5$1@eclipse.org...
> > > All,
> > >
> > > I have my own perspective and I need to remove the standard menu's
from
> > > the workbench. I am using the MenuManager to individually remove each
> menu
> > > (is this
> > > the right approach?). While executing the following code, there are
> > > NullPointerExceptions
> > > thrown when the workbench appears.
> > >
> > > WorkbenchWindow window = null;
> > >
> > > Workbench bench = (Workbench)super.getWorkbench();
> > >
> > > if (bench != null)
> > >
> > > {
> > >
> > > IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
> > >
> > > for (int i = 0; i < windows.length; i++)
> > >
> > > {
> > >
> > > window = (WorkbenchWindow)windows[i];
> > >
> > > if (window != null)
> > >
> > > {
> > >
> > > MenuManager manager = window.getMenuBarManager();
> > >
> > > manager.setRemoveAllWhenShown(true);
> > >
> > > manager.remove(IWorkbenchActionConstants.M_HELP);
> > >
> > >
manager.remove(IWorkbenchActionConstants.M_NAVIGATE);
> > >
> > > manager.remove(IWorkbenchActionConstants.M_EDIT);
> > >
> > > manager.remove(IWorkbenchActionConstants.M_PROJECT);
> > >
> > > manager.remove(IWorkbenchActionConstants.M_WINDOW);
> > >
> > > }
> > >
> > > }
> > >
> > >
> > >
> > >
> >
> >
>
>
Previous Topic:Perspective action
Next Topic:Undo Limits
Goto Forum:
  


Current Time: Sat Jun 07 17:01:31 EDT 2025

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

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

Back to the top