Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Master/Details Block not refreshing after delete
Master/Details Block not refreshing after delete [message #308788] Tue, 03 October 2006 10:23 Go to next message
Eclipse UserFriend
Hi all,
Can anyone let me know why am facing a problem stated below,

I have a Master/Details block , there is treeviewer that displays the
EMF model and there is details section that displays the Properties of
the selected model .

I have context menu that displays the New with the allowed child of the
Model element displayed in the Tree and other default context menus like
delete , undo etc.,

When i choose the model element its displaying the data correctly on my
details page. Now the issue starts when I right click selected model and
click delete , my model element in the Tree Viewer is deleted where in
my Details page still remains with the old data ?

Can anyone help how to over come that and make my details page disappear
once i delete the Model Element in the Tree .

I reffered to org.eclipse.pde.ui , but they had used the
IDetailsPageProvider , wherein I have a details page per master part.

Thanks.

--

Kamesh Sampath
Re: Master/Details Block not refreshing after delete [message #308791 is a reply to message #308788] Tue, 03 October 2006 11:21 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------060203060508050106080100
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Kamesh,

I assume that your details page responds to selection and that deleting
an object should cause a new selection so that new selection should
cause the details view to update. Note that in the generated EMF
editor, the command stack listener refreshes the properties view, so
maybe that's what you need to do:

commandStack.addCommandStackListener
(new CommandStackListener()
{
public void commandStackChanged(final EventObject event)
{
getContainer().getDisplay().asyncExec
(new Runnable()
{
public void run()
{
firePropertyChange(IEditorPart.PROP_DIRTY);

// Try to select the affected objects.
//
Command mostRecentCommand =
((CommandStack)event.getSource()).getMostRecentCommand();
if (mostRecentCommand != null)
{

setSelectionToViewer(mostRecentCommand.getAffectedObjects()) ;
}
* if (propertySheetPage != null &&
!propertySheetPage.getControl().isDisposed())
{
propertySheetPage.refresh();
}*
}
});
}
});


Kamesh Sampath wrote:
> Hi all,
> Can anyone let me know why am facing a problem stated below,
>
> I have a Master/Details block , there is treeviewer that displays the
> EMF model and there is details section that displays the Properties of
> the selected model .
>
> I have context menu that displays the New with the allowed child of
> the Model element displayed in the Tree and other default context
> menus like delete , undo etc.,
>
> When i choose the model element its displaying the data correctly on
> my details page. Now the issue starts when I right click selected
> model and click delete , my model element in the Tree Viewer is
> deleted where in my Details page still remains with the old data ?
>
> Can anyone help how to over come that and make my details page
> disappear once i delete the Model Element in the Tree .
>
> I reffered to org.eclipse.pde.ui , but they had used the
> IDetailsPageProvider , wherein I have a details page per master part.
>
> Thanks.
>


--------------060203060508050106080100
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Kamesh,<br>
<br>
I assume that your details page responds to selection and that deleting
an object should cause a new selection so that new selection should
cause the details view to update.&nbsp; Note that in the generated EMF
editor, the command stack listener refreshes the properties view, so
maybe that's what you need to do:<br>
<blockquote><small>&nbsp;&nbsp;&nbsp; commandStack.addCommandStackListener</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (new CommandStackListener()</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; public void commandStackChanged(final EventObject
event)</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; getContainer().getDisplay().asyncExec</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (new Runnable()</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void run()</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; firePropertyChange(IEditorPart.PROP_DIRTY);</small><br>
<br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Try to select the affected objects.</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command mostRecentCommand =
((CommandStack)event.getSource()).getMostRecentCommand();</small ><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (mostRecentCommand != null)</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
setSelectionToViewer(mostRecentCommand.getAffectedObjects()) ; </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<b><small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (propertySheetPage != null &amp;&amp;
!propertySheetPage.getControl().isDisposed())</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; propertySheetPage.refresh();</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small></b><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; });</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; }</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</small><br>
</blockquote>
<br>
Kamesh Sampath wrote:
<blockquote cite="mideftrpr$qi2$1@utils.eclipse.org" type="cite">Hi
all,
<br>
Can anyone let me know why am facing a problem stated below,
<br>
<br>
I have a Master/Details block , there is treeviewer that displays the
EMF model and there is details section that displays the Properties of
the selected model .
<br>
<br>
I have context menu that displays the New with the allowed child of the
Model element displayed in the Tree and other default context menus
like delete , undo etc.,
<br>
<br>
When i choose the model element its displaying the data correctly on my
details page. Now the issue starts when I right click selected model
and click delete , my model element in the Tree Viewer is deleted where
in my Details page still remains with the old data ?
<br>
<br>
Can anyone help how to over come that and make my details page
disappear once i delete the Model Element in the Tree .
<br>
<br>
I reffered to org.eclipse.pde.ui , but they had used the
IDetailsPageProvider , wherein I have a details page per master part.
<br>
<br>
Thanks.
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------060203060508050106080100--
Previous Topic:Modifying menus of platform
Next Topic:icon from another plugin
Goto Forum:
  


Current Time: Fri May 09 15:37:46 EDT 2025

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

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

Back to the top