My application have an Editor and some View extend ViewPart. In the Editor I can create a Save action like this
Action action = (Action) ActionFactory.SAVE.create(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
and the add action in a ToolBar. I can control this SAVE action by Override isDirty()
and doSave()
method. And my question is:
- Can I add a SAVE ActionFactory in a ViewPart?
- How can I Override SAVE method in ViewPart?
- Is there any other way to do it?
My View look like this:
GridLayout layoutProperties = new GridLayout(2, false);
layoutProperties.marginHeight = 0;
layoutProperties.marginWidth = 0;
propertiesVersion.setLayout(layoutProperties);
propertiesVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
toolkitProperties = new FormToolkit(propertiesVersion.getDisplay());
sectionProperties = toolkitProperties.createSection(propertiesVersion, Section.TITLE_BAR);
sectionProperties.setText("Version Properties");
sectionProperties.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 0));
//some Label and Text here