No View in Eclipse 3.2 [message #459263] |
Wed, 29 November 2006 12:26  |
Eclipse User |
|
|
|
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 #459437 is a reply to message #459375] |
Fri, 01 December 2006 07:23  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04693 seconds