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

Bug 80766

Summary: [Perspectives] How to place first view if no editor area
Product: [Eclipse Project] Platform Reporter: Sebastian Davids <sdavids>
Component: UIAssignee: Nick Edgar <n.a.edgar>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 Keywords: helpwanted
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Sebastian Davids CLA 2004-12-11 19:53:10 EST
!ENTRY org.eclipse.ui 4 4 2004-12-12 01:46:58.640
!MESSAGE Referenced part does not exist yet: org.eclipse.editorss.

@@@@

public class RcpPerspective implements IPerspectiveFactory {

    /** {@inheritDoc} */
    public void createInitialLayout(IPageLayout layout) {
        layout.setEditorAreaVisible(false);
    }
}

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
	id="rcp"
	name="Rcp Plug-in"
	version="1.0.0"
	provider-name="Sebastian Davids">

	<runtime>
		<library name="rcp.jar">
			<export name="*"/>
		</library>
	</runtime>

	<requires>
		<import plugin="org.eclipse.core.runtime"/>
		<import plugin="org.eclipse.ui"/>
	</requires>

	<extension point="org.eclipse.core.runtime.applications" id="application">
		<application>
			<run class="rcp.RcpApplication"/>
		</application>
	</extension>
   
	<extension point="org.eclipse.ui.perspectives">
		<perspective
			id="rcp.perspective"
			class="rcp.RcpPerspective"
			name="Perspective"/>
	</extension>
	
	<extension point="org.eclipse.ui.views">
		<view
			id="rcp.view"
			class="rcp.RcpView"
			name="View"/>
	</extension>

	<extension point="org.eclipse.ui.perspectiveExtensions">
		<perspectiveExtension targetID="rcp.perspective">
			<view
				id="rcp.view"
				relative="org.eclipse.editorss"
				relationship="top"
				standalone="true"
				showTitle="false"/>
		</perspectiveExtension>
	</extension>

</plugin>

@@@@

Version: 3.1.0
Build id: 200412011139

In 3.1 this used to not log an error.

The underlying problem is: how to you place a view in a perspective when there
is no editor area and no other views?
Comment 1 Sebastian Davids CLA 2004-12-11 19:53:46 EST
ment 3.0 :D
Comment 2 Sebastian Davids CLA 2004-12-11 20:26:04 EST
Rechecked with

Version: 3.0.1
Build id: 200409161125

This is not a regression.

@@@@

Still remains the problem how to place the first view if you do not have an
editor area.
Comment 3 Sebastian Davids CLA 2004-12-11 20:33:12 EST
One could use:

    /** {@inheritDoc} */
    public void createInitialLayout(IPageLayout layout) {
        layout.setEditorAreaVisible(false);
        layout.addView(
	            "rcp.view",
	            IPageLayout.TOP,
	            IPageLayout.RATIO_MAX,
	            IPageLayout.ID_EDITOR_AREA);
    }

But shouldn't it be also possible via the manifest?
Comment 4 Sebastian Davids CLA 2004-12-11 20:42:47 EST
Also, as far as I know 

standalone="true"
showTitle="false"

cannot be set in createInitialLayout(IPageLayout).
Comment 5 Nick Edgar CLA 2004-12-13 12:34:18 EST
For the original problem, I suspect that it's just not handling the editor area
special case, whether or not it is visible.  But yes, this should be possible
via the manifest.

For standalone views in the perspective factory, use
IPageLayout.addStandaloneView instead.
Comment 6 Nick Edgar CLA 2004-12-13 12:34:46 EST
Sebastian, if you wanted to apply your patching skills here, it would be
appreciated.
Comment 7 Sebastian Davids CLA 2004-12-13 12:55:38 EST
I'm going to take a look at it tonight or tomorrow.
Comment 8 Sebastian Davids CLA 2004-12-13 22:03:28 EST
Grr... <slaps his forehead>

>>relative="org.eclipse.editorss"

Forgot the "ui".
Comment 9 Sebastian Davids CLA 2004-12-13 22:07:33 EST
While I was debugging I realized that a view is registered under
"org.eclipse.ui.internal.introview".

Is there a reason why this isn't done in the intro plugin?
Comment 10 Nick Edgar CLA 2004-12-14 11:36:24 EST
The workbench provides the view that contains the intro part. 
org.eclipse.ui.intro doesn't know that it's a view.

For the original problem, was there nothing in the log?
Seems like the error reporting could be improved if not.
Comment 11 Nick Edgar CLA 2005-02-16 16:02:38 EST
Moving to VERIFIED state.
Note that you can use IPageLayout.ID_EDITOR_AREA instead of inlining the string
yourself.