Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 268442

Summary: UI - Web Page Editor should provide a mechanism so that a developer or user can change the default value for the Design View's layout
Product: [WebTools] Java Server Faces Reporter: Carlin Rogers <carlin.rogers>
Component: UIAssignee: Ian Trimble <ian.trimble>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: raghunathan.srinivasan
Version: unspecifiedFlags: raghunathan.srinivasan: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved? (naci.dai)
raghunathan.srinivasan: pmc_approved? (deboer)
raghunathan.srinivasan: pmc_approved? (neil.hauge)
raghunathan.srinivasan: pmc_approved? (kaloyan)
raghunathan.srinivasan: review+
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
URL: ORACLE_P2
Whiteboard:
Attachments:
Description Flags
patch none

Description Carlin Rogers CLA 2009-03-12 17:44:54 EDT
Build ID: M20080911-1700

Steps To Reproduce:
1. create a dynamic web project
2. create or add a JSP to the project and open it with Web Page Editor
3. select a different mode for the design view from the tool bar options (such as design and source split in a vertical pane layout, or a source only layout)
4. quit eclipse
5. reopen eclipse

result: the page that you were last editing comes up but in the default horizontal split pane layout.

There is no way for either a user or other tools that extend the WPE to override this default value.


More information:
The org.eclipse.jst.pagedesigner.ui.common.sash.SashEditorPart class initializes the _orientation field to SWT.VERTICAL for each instance. This could be change to look for a value from a preference setting or look at plug-ins for an extension that has a value set for the inital layout to use.

Could start by providing a preference setting. There may be other WPE preferences that would be useful in the future so it could be exposed to the user via the 'Window | Preferences' UI.

Or, some sort of plug-in extension could be created so other plug-ins can implement an extension point that inculdes a different preferred default value.

Maybe in the future both are used so if the user does not have a preference set, other extensions can still override the default horizontal layout.
Comment 1 Raghunathan Srinivasan CLA 2009-03-13 17:58:35 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 
This is a hot-bug requested by Oracle. This is required to customize the layout, page(tab) labels in WPE
    * Is there a work-around? If so, why do you believe the work-around is insufficient?
No.
Comment 2 Carlin Rogers CLA 2009-03-24 14:25:32 EDT
Created attachment 129729 [details]
patch

This patch moves the default value for the WPE design mode to a preference, initializing it in the plug-in's store. Another Eclipse "product" could change the initial value using the Eclipse plugin_customization.ini mechanism - setting a "product preference".

The patch also includes code to use the persistent properties API of a resource to save the user's choice of design mode for a given file opened in the WPE. If this property is set, then the file will be displayed with the user's selection, otherwise the editor will use the default value set/initialized with preferences.

There are no public API changes so I believe this change could also be back ported.
Comment 3 Raghunathan Srinivasan CLA 2009-03-24 14:39:45 EDT
Assigning this to Ian to review the patch and commit it
Comment 4 Raghunathan Srinivasan CLA 2009-03-24 16:34:36 EDT
(In reply to comment #2)
> 
> There are no public API changes so I believe this change could also be back
> ported.
> 
Approving release of this patch since it doesn't involve an API or UI change.
Comment 5 Ian Trimble CLA 2009-03-24 16:49:47 EDT
Fixed at 13:49 on March 24th 2009. Pending release.
Comment 6 Carlin Rogers CLA 2009-03-25 15:30:04 EDT
Verified in build I-3.1-20090325010756
Comment 7 Ian Trimble CLA 2009-03-25 15:39:24 EDT
Closing.