|
From: Marcelo V. <va...@us...> - 2006-06-13 04:38:22
|
Hi Dale, I'll break the answer in two parts. Dale Anson wrote: > I've added an option pane to JavaSideKick that sets the appropriate > properties so this option pane shows up in the ProjectViewer options. > That all works well with no dependencies on ProjectViewer. However, I'm > not seeing a way to save the properties set in my option pane on a per > project basis. Saving project-specific options is kinda non-optimal right now since I strived to keep things as compatible as possible with jEdit's option panes without code mofidication. If you want to keep both, I'd recomment having your option pane work on a java.util.Properties object directly; when loading/saving the values, you detect whether you're being called from jEdit or ProjectViewer (both jEdit and VPTProject have a getProperties() method). To get the project being edited when the project option pane is shown, you can call "projectviewer.config.ProjectOptions.getProject()". I'm pretty sure it returns null if no project is being edited. > Right now, it doesn't matter which project is open, the > same properties from my option pane apply. How can I get per project > properties set? Similarly, to apply project-specific properties you'll need a reference to the currently active project in the view. You can get that by calling projectviewer.ProjectViewer.getActiveProject(View). Note that this method can return null. This kinda goes back to the discussion we had here a long time ago: should we have some system where there's a "property context" so that option panes can save "context specific" properties, and plugins could provide custom contexts (like a project would be a "property context")? -- Marcelo Vanzin va...@us... "Life is too short to drink cheap beer" |