Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » No View in Eclipse 3.2
No View in Eclipse 3.2 [message #459263] Wed, 29 November 2006 12:26 Go to next message
Eclipse UserFriend
Originally posted by: ray.hooker.gmail.com

I am working through the eclipse RCP Platform book by McAffer and Lemieux. I am doing this in parallel between the Eclipse 3.1 install provided by the book and my normal Eclipse 3.2 environment. I am having trouble getting it to bring up the view in my Eclipse 3.2 environment. Instead of a treeviewer I just see a blank. My Eclipse 3.2 SDK was obtained from the main Eclipse site.

After carefully comparing the code, I decided just to try to trace the execution. It turns out that class I defined for my view is never instantiated in my Eclipse 3.2 environment but the constructor and the createPartControl is executed prior to bringing up the application. Note that plugin.xml has:
<extension
point="org.eclipse.ui.views">
<view
class="org.eclipsercp.hyperbola.ContactsView"
icon="icons/groups.gif"
id="org.eclipsercp.hyperbola.views.contacts"
name="Contacts"/>
</extension>

Also the class ContactsView does exist, but like I said breakpoints in the contructor and on the first line of createPartControl are never hit.

public ContactsView() {
super();
}
/*
* The content provider class is responsible for
* providing objects to the view. It can wrap
* existing objects in adapters or simply return
* objects as-is. These objects may be sensitive
* to the current input of the view, or ignore
* it and always show the same content
* (like Task List, for example).
*/

class ViewContentProvider implements IStructuredContentProvider {
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}
public void dispose() {
}
public Object[] getElements(Object parent) {
return new String[] { "One", "Two", "Three" };
}
}

/**
* This is a callback that will allow us
* to create the viewer and initialize it.
*/
public void createPartControl(Composite parent) {
initializeSession(); // temporary tweak to build a fake model
treeViewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
getSite().setSelectionProvider(treeViewer);
treeViewer.setLabelProvider(new WorkbenchLabelProvider());
treeViewer.setContentProvider(new BaseWorkbenchContentProvider());
treeViewer.setInput(session.getRoot());
session.getRoot().addContactsListener(new IContactsListener() {
public void contactsChanged(ContactsGroup contacts, ContactsEntry entry){
treeViewer.refresh();
}
});
//treeViewer.setSorter(new NameSorter());

//makeActions();
//hookContextMenu();
//hookDoubleClickAction();
//contributeToActionBars();
}
Re: No View in Eclipse 3.2 [message #459375 is a reply to message #459263] Thu, 30 November 2006 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ray.hooker.gmail.com

Well, I do at least know where the issue arose. I created the RCP app using the Hello World template and then added the extensions. I added and deleted the extensions trying to get it like the RCP book.

Clearly that is the problem since I was able to do it from scratch using the wizard and make it work. I am still disturbed that I cannot seem to trace, so I will keep the errant project and try to debug it in my spare time. After all RCP is not going to be a good choice if I cannot debug the issue when I accidently dork it up.

One thing that would help would be knowing a the flow on how the views and perspectives are setup. Also there may be other errors that quietly being handled, so perhaps this thread should how to detect the "silent errors". For example, I had an incorrect view ID referenced in my Perspective class. I did not see any error message.. it just did not work. I only guessed correctly. Even debug mode did not show it.

Ray
Re: No View in Eclipse 3.2 [message #459437 is a reply to message #459375] Fri, 01 December 2006 07:23 Go to previous message
Eclipse UserFriend
There are the trace options, like -debug or -debug <options> that print
trace statements to the console. There's also the error log, which is
usually at <workspace>/.metadata/.log. AFAIK, that can be seen on the
console with the -consoleLog flag.

If you have a view open and then delete its extension definition and
restart with -clean, you should get an error in the error log, or at
least a popup saying the workbench could not restore its layout.

If you have a view that's not open and delete its extension points it'll
just disappear from the menus. That's not an error scenario, that's
dynamically removing a "plugin" :-)

Later,
PW
Previous Topic:j3d in RCP-App?
Next Topic:Predefine dialog settings of problems view in a RCP
Goto Forum:
  


Current Time: Mon Mar 24 16:42:55 EDT 2025

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

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

Back to the top