Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Action, View and common programming style
Action, View and common programming style [message #453488] Mon, 31 July 2006 19:52
Eclipse UserFriend
Originally posted by: dittmar.steiner.web.de

Hi,

i have a View with a ContentProvider holding the model.
And i have a declared Action that has no direct reference to the View or ContentProvider.
The following solution works fine for standalone Views, but somehow i don't like it.

Is it common style to retrieve the View, cast it to the concrete type and access some custom method to add an object to the model?
<snippet>
// create a model object
Extension extension = new Extension("sip", "12345", "<secret>");
// retrieve the standalone reference
IViewPart view = window.getActivePage().findView(ExtensionView.ID);
if (view != null) {
if (view instanceof ExtensionView) {
// cast to the concrete type
ExtensionView extensionView = (ExtensionView)view;
// add the new model object to the view through a _custom_ method
extensionView.addExtension(extension); // view will call it's ContentProvider
}
}
<end snippet>

i have know idea how to get a reference to the ContentProvider instance...

Thanks in advance
Dittmar

--
Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound.
Previous Topic:save state of view in perspective
Next Topic:Context Sensitive Help Error
Goto Forum:
  


Current Time: Sat Oct 05 16:56:21 GMT 2024

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

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

Back to the top