Re: Eclipse RCP Question

"Raymond Hooker \(rhooker\)" <[email protected]>
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <848DB51F3E58E146B08D188F803DCB6F030C5A69@xmb-rtp-20c.amer.cisco.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 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Raymond Hooker (rhooker)
Sent: Wednesday, November 29, 2006 12:21 PM
To: [email protected]
Subject: [Juglist] Eclipse RCP Question

Does anyone have experience with Eclipse RCP.  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.

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();
	}
	

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.