Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 194163 Details for
Bug 343972
Support image in editor page header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch #1
bug343972_patch_1.txt (text/plain), 6.25 KB, created by
Greg Amerson
on 2011-04-27 10:43:43 EDT
(
hide
)
Description:
Patch #1
Filename:
MIME Type:
Creator:
Greg Amerson
Created:
2011-04-27 10:43:43 EDT
Size:
6.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.sapphire.ui >Index: src/org/eclipse/sapphire/ui/form/editors/masterdetails/MasterDetailsEditorPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/form/editors/masterdetails/MasterDetailsEditorPage.java,v >retrieving revision 1.2 >diff -u -r1.2 MasterDetailsEditorPage.java >--- src/org/eclipse/sapphire/ui/form/editors/masterdetails/MasterDetailsEditorPage.java 20 Apr 2011 05:40:24 -0000 1.2 >+++ src/org/eclipse/sapphire/ui/form/editors/masterdetails/MasterDetailsEditorPage.java 27 Apr 2011 14:41:29 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * Konstantin Komissarchik - initial implementation and ongoing maintenance > * Ling Hao - [bugzilla 329114] rewrite context help binding feature >+ * Greg Amerson - [bugzilla 343972] - Add support for setting the masterDetails formPage header image > ******************************************************************************/ > > package org.eclipse.sapphire.ui.form.editors.masterdetails; >@@ -57,7 +58,13 @@ > import org.eclipse.jface.viewers.Viewer; > import org.eclipse.sapphire.modeling.CapitalizationType; > import org.eclipse.sapphire.modeling.IModelElement; >+import org.eclipse.sapphire.modeling.ImageData; > import org.eclipse.sapphire.modeling.ResourceStoreException; >+import org.eclipse.sapphire.modeling.el.FailSafeFunction; >+import org.eclipse.sapphire.modeling.el.Function; >+import org.eclipse.sapphire.modeling.el.FunctionContext; >+import org.eclipse.sapphire.modeling.el.FunctionResult; >+import org.eclipse.sapphire.modeling.el.Literal; > import org.eclipse.sapphire.modeling.util.MutableReference; > import org.eclipse.sapphire.modeling.xml.RootXmlResource; > import org.eclipse.sapphire.modeling.xml.XmlResourceStore; >@@ -82,6 +89,7 @@ > import org.eclipse.sapphire.ui.form.editors.masterdetails.def.IMasterDetailsEditorPageDef; > import org.eclipse.sapphire.ui.form.editors.masterdetails.state.IMasterDetailsEditorPageState; > import org.eclipse.sapphire.ui.internal.SapphireUiFrameworkPlugin; >+import org.eclipse.sapphire.ui.renderers.swt.SwtRendererUtil; > import org.eclipse.sapphire.ui.swt.renderer.SapphireActionPresentationManager; > import org.eclipse.sapphire.ui.swt.renderer.SapphireKeyboardActionPresentation; > import org.eclipse.sapphire.ui.swt.renderer.SapphireMenuActionPresentation; >@@ -151,6 +159,7 @@ > private ContentOutline contentOutlinePage; > private IPartListener2 partListener; > private SapphirePartListener editorPagePartListener; >+ private final FunctionContext functionContext; > > public MasterDetailsEditorPage( final SapphireEditor editor, > final IModelElement rootModelElement, >@@ -210,6 +219,8 @@ > outlineHideActionHandler.init( outlineHideAction, null ); > outlineHideActionHandler.setChecked( isDetailsMaximized() ); > outlineHideAction.addHandler( outlineHideActionHandler ); >+ >+ this.functionContext = initFunctionContext(); > } > > private static MasterDetailsEditorPagePart createEditorPagePart( final SapphireEditor editor, >@@ -273,6 +284,15 @@ > > form.setText( this.definition.getPageHeaderText().getLocalizedText( CapitalizationType.TITLE_STYLE, false ) ); > >+ final Function imageFunction = FailSafeFunction.create( this.definition.getImage().getContent(), Literal.create( ImageData.class ) ); >+ final FunctionResult imageFunctionResult = imageFunction.evaluate( this.functionContext ); >+ final ImageData data = (ImageData) imageFunctionResult.value(); >+ >+ if (data != null) >+ { >+ form.setImage(SwtRendererUtil.toImageDescriptor(data).createImage()); >+ } >+ > this.mainSection = new RootSection(); > this.mainSection.createContent( managedForm ); > >@@ -810,6 +830,11 @@ > return filteredTree; > } > >+ protected FunctionContext initFunctionContext() >+ { >+ return new FunctionContext(); >+ } >+ > private static void updateExpandedState( final MasterDetailsContentOutline contentTree, > final Tree tree ) > { >Index: src/org/eclipse/sapphire/ui/form/editors/masterdetails/def/IMasterDetailsEditorPageDef.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/form/editors/masterdetails/def/IMasterDetailsEditorPageDef.java,v >retrieving revision 1.2 >diff -u -r1.2 IMasterDetailsEditorPageDef.java >--- src/org/eclipse/sapphire/ui/form/editors/masterdetails/def/IMasterDetailsEditorPageDef.java 22 Apr 2011 22:26:39 -0000 1.2 >+++ src/org/eclipse/sapphire/ui/form/editors/masterdetails/def/IMasterDetailsEditorPageDef.java 27 Apr 2011 14:41:29 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * Konstantin Komissarchik - initial implementation and ongoing maintenance > * Ling Hao - [bugzilla 329114] rewrite context help binding feature >+ * Greg Amerson - [bugzilla 343972] - Add support for setting the masterDetails formPage header image > ******************************************************************************/ > > package org.eclipse.sapphire.ui.form.editors.masterdetails.def; >@@ -20,6 +21,7 @@ > import org.eclipse.sapphire.modeling.annotations.GenerateImpl; > import org.eclipse.sapphire.modeling.annotations.Label; > import org.eclipse.sapphire.modeling.annotations.Type; >+import org.eclipse.sapphire.modeling.el.Function; > import org.eclipse.sapphire.modeling.localization.Localizable; > import org.eclipse.sapphire.modeling.xml.annotations.XmlBinding; > import org.eclipse.sapphire.ui.def.IEditorPageDef; >@@ -69,4 +71,15 @@ > > IMasterDetailsContentNodeDef getRootNode(); > >+ // *** Image *** >+ >+ @Type( base = Function.class ) >+ @Label( standard = "image" ) >+ @XmlBinding( path = "image" ) >+ >+ ValueProperty PROP_IMAGE = new ValueProperty( TYPE, "Image" ); >+ >+ Value<Function> getImage(); >+ void setImage( String value ); >+ void setImage( Function value ); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 343972
:
194163
|
194167
|
195542