Saturday, 15 June 2013

eclipse rcp - ActionFactory.SAVE in a ViewPart -



eclipse rcp - ActionFactory.SAVE in a ViewPart -

my application have editor , view extend viewpart. in editor can create save action

action action = (action) actionfactory.save.create(platformui.getworkbench().getactiveworkbenchwindow());

and add together action in toolbar. can command save action override isdirty() , dosave() method. , question is:

can add together save actionfactory in viewpart? how can override save method in viewpart? is there other way it?

my view 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 , text here

for rcp create save action in actionbaradvisor like:

class="lang-java prettyprint-override">@override protected void makeactions(iworkbenchwindow window) { saveaction = actionfactory.save.create(window); register(saveaction); ... more ... }

the save action work part implements isaveablepart, interface defines isdirty, dosave, ... if implement in view part save support.

eclipse-rcp rcp

No comments:

Post a Comment