disable save [message #496805] |
Wed, 11 November 2009 07:27  |
Eclipse User |
|
|
|
Hi,
how mayI disable the save action (due to sematically check state)? I
trie to use an own
DiagramGlobalActionHandler#canSave(IGlobalActionContext), that is
registered by an own GlobalActionHandlerProvider replacing the default
registered one. But it does not effects the proper save action.
I need to prevent save before the model got a valid state.
Thanks in advance,
Sven
<extension
point=" org.eclipse.gmf.runtime.common.ui.services.action.globalActi onHandlerProviders "
id="global-actions">
<?gmfgen generated="true"?>
<GlobalActionHandlerProvider
class="xyz....DiagramGlobalActionHandlerProviderExt"
id="0815Presentation">
<Priority name="Lowest"/>
<ViewId id="xyz....model.pkg.diagram.part.XYZDiagramEditorID">
<ElementType
class=" org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditP art ">
<GlobalActionId actionId="delete"/>
</ElementType>
<ElementType
class=" org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart ">
<GlobalActionId actionId="save"/>
</ElementType>
</ViewId>
</GlobalActionHandlerProvider>
....
</extension>
publix class DiagramGlobalActionHandlerProviderExt extends
AbstractGlobalActionHandlerProvider {
....
public IGlobalActionHandler getGlobalActionHandler(final
IGlobalActionHandlerContext context) {
...
getHandlerList().put(context.getActivePart(), new
DiagramGlobalActionHandlerExt());
.... }
}
.... }
public class DiagramGlobalActionHandlerExt extends
DiagramGlobalActionHandler {
protected boolean canSave(IGlobalActionContext cntxt) {
return super.canSave(cntxt) && checkState(cntx);
}
}
|
|
|
|
|
Re: disable save [message #500899 is a reply to message #499572] |
Mon, 30 November 2009 03:36  |
Eclipse User |
|
|
|
Hi Sven,
If I was the user, I'd prefer to have the button enabled and to get a message when I try to save, telling me why it's not allowed at the moment, and what I need to do to resolve the problem.
Disabling the button without providing information about why I can't save my document sounds like poor usability too.
Regards, Peter
|
|
|
Powered by
FUDForum. Page generated in 0.42934 seconds