| Editor dirty handling [message #910964] |
Mon, 10 September 2012 14:01  |
Sir Wayne Messages: 172 Registered: July 2009 |
Senior Member |
|
|
Hello,
why doesn't the DefaultPersistencyBehavior use the "normal" dirty handling from the basic command stack (isSaveNeeded). What is the intention of implement it on its own way?
public boolean isDirty() {
BasicCommandStack commandStack = (BasicCommandStack) diagramEditor.getEditingDomain().getCommandStack();
return savedCommand != commandStack.getUndoCommand();
}
|
|
|
|
| Re: Editor dirty handling [message #911364 is a reply to message #911170] |
Tue, 11 September 2012 09:04   |
Sir Wayne Messages: 172 Registered: July 2009 |
Senior Member |
|
|
First time all my Features and Commands works well. But after the first saving the dirty handling is buggy.
Steps:
1. Move a Shape
2. Saving
3. Click ContextButtonPad with follow Feature
public class OpenPropertyViewFeature extends AbstractCustomFeature
{
public OpenPropertyViewFeature (IFeatureProvider fp)
{
super(fp);
}
@Override
public boolean canExecute(ICustomContext context)
{
return true;
}
@Override
public void execute(ICustomContext context)
{
try
{
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().showView("org.eclipse.ui.views.PropertySheet");
catch (PartInitException e)
{
}
}
@Override
public boolean hasDoneChanges()
{
return false;
}
@Override
public boolean canUndo(IContext context)
{
return false;
}
The Editor is dirty, because savedCommand = Move Shape Command and commandStack.getUndoCommand() is null.
So savedCommand != commandStack.getUndoCommand() is true
And the Undo/Redo Handling (e.g Toolbar action) is buggy too.
[Updated on: Tue, 11 September 2012 09:08] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01647 seconds