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 195542 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 #3
bug343972_patch_3.txt (text/plain), 10.00 KB, created by
Greg Amerson
on 2011-05-12 16:17:23 EDT
(
hide
)
Description:
Patch #3
Filename:
MIME Type:
Creator:
Greg Amerson
Created:
2011-05-12 16:17:23 EDT
Size:
10.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.sapphire.samples >Index: src/org/eclipse/sapphire/samples/gallery/GalleryEditor.sdef >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.samples/src/org/eclipse/sapphire/samples/gallery/GalleryEditor.sdef,v >retrieving revision 1.2 >diff -u -r1.2 GalleryEditor.sdef >--- src/org/eclipse/sapphire/samples/gallery/GalleryEditor.sdef 10 May 2011 00:35:42 -0000 1.2 >+++ src/org/eclipse/sapphire/samples/gallery/GalleryEditor.sdef 12 May 2011 20:13:20 -0000 >@@ -11,6 +11,7 @@ > * Contributors: > * Konstantin Komissarchik - initial implementation and ongoing maintenance > * Greg Amerson - [342771] Support "image+label" hint for when actions are presented in a toolbar >+ * Greg Amerson - [bugzilla 343972] - Add support for setting the masterDetails formPage header image > ****************************************************************************** > --> > >@@ -39,6 +40,7 @@ > <editor-page> > <id>main</id> > <page-header-text>sapphire gallery</page-header-text> >+ <page-header-image>Prefix.png</page-header-image> > <initial-selection>simple values</initial-selection> > <documentation> > <title>Sapphire Gallery</title> >#P org.eclipse.sapphire.sdk >Index: src/org/eclipse/sapphire/sdk/DefinitionEditor.sdef >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.sdk/src/org/eclipse/sapphire/sdk/DefinitionEditor.sdef,v >retrieving revision 1.1 >diff -u -r1.1 DefinitionEditor.sdef >--- src/org/eclipse/sapphire/sdk/DefinitionEditor.sdef 7 May 2011 02:02:08 -0000 1.1 >+++ src/org/eclipse/sapphire/sdk/DefinitionEditor.sdef 12 May 2011 20:13:21 -0000 >@@ -8,6 +8,7 @@ > * > * Contributors: > * Konstantin Komissarchik - initial implementation and ongoing maintenance >+ * Greg Amerson - [bugzilla 343972] - Add support for setting the masterDetails formPage header image > ****************************************************************************** > --> > >@@ -991,6 +992,7 @@ > <include>PartId</include> > <property-editor>PageName</property-editor> > <property-editor>PageHeaderText</property-editor> >+ <property-editor>PageHeaderImage</property-editor> > <property-editor>OutlineHeaderText</property-editor> > <property-editor>InitialSelectionPath</property-editor> > </content> >#P org.eclipse.sapphire.ui >Index: src/org/eclipse/sapphire/ui/SapphireEditorFormPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/SapphireEditorFormPage.java,v >retrieving revision 1.6 >diff -u -r1.6 SapphireEditorFormPage.java >--- src/org/eclipse/sapphire/ui/SapphireEditorFormPage.java 18 Apr 2011 19:13:33 -0000 1.6 >+++ src/org/eclipse/sapphire/ui/SapphireEditorFormPage.java 12 May 2011 20:13:22 -0000 >@@ -8,11 +8,16 @@ > * 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; > >+import static org.eclipse.sapphire.ui.renderers.swt.SwtRendererUtil.toImageDescriptor; >+ > import org.eclipse.sapphire.modeling.IModelElement; >+import org.eclipse.sapphire.ui.SapphirePart.ImageChangedEvent; >+import org.eclipse.swt.widgets.Composite; > import org.eclipse.ui.forms.editor.FormPage; > > /** >@@ -26,6 +31,7 @@ > { > private final SapphireEditor editor; > private final SapphireEditorPagePart part; >+ private final SapphirePartListener listener; > > public SapphireEditorFormPage( final SapphireEditor editor, > final SapphireEditorPagePart editorPagePart ) >@@ -34,6 +40,20 @@ > > this.editor = editor; > this.part = editorPagePart; >+ >+ this.listener = new SapphirePartListener() >+ { >+ @Override >+ public void handleEvent( final SapphirePartEvent event ) >+ { >+ if( event instanceof ImageChangedEvent ) >+ { >+ refreshImage(); >+ } >+ } >+ }; >+ >+ this.part.addListener( this.listener ); > } > > public final SapphireEditor getEditor() >@@ -51,6 +71,29 @@ > return this.part.getModelElement(); > } > >+ @Override >+ public void createPartControl(Composite parent) { >+ super.createPartControl(parent); >+ >+ refreshImage(); >+ } >+ >+ private final void refreshImage() >+ { >+ if (this.getManagedForm() != null) >+ { >+ this.getManagedForm().getForm().setImage( toImageDescriptor( this.part.getPageHeaderImage() ).createImage() ); >+ } >+ } >+ >+ @Override >+ public void dispose() >+ { >+ super.dispose(); >+ >+ this.part.removeListener( this.listener ); >+ } >+ > public abstract String getId(); > > } >\ No newline at end of file >Index: src/org/eclipse/sapphire/ui/SapphireEditorPagePart.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/SapphireEditorPagePart.java,v >retrieving revision 1.1 >diff -u -r1.1 SapphireEditorPagePart.java >--- src/org/eclipse/sapphire/ui/SapphireEditorPagePart.java 18 Apr 2011 19:13:33 -0000 1.1 >+++ src/org/eclipse/sapphire/ui/SapphireEditorPagePart.java 12 May 2011 20:13:22 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Konstantin Komissarchik - initial implementation and ongoing maintenance >+ * Greg Amerson - [bugzilla 343972] - Add support for setting the masterDetails formPage header image > ******************************************************************************/ > > package org.eclipse.sapphire.ui; >@@ -15,6 +16,9 @@ > import java.util.Set; > > import org.eclipse.help.IContext; >+import org.eclipse.sapphire.modeling.IModelElement; >+import org.eclipse.sapphire.modeling.ImageData; >+import org.eclipse.sapphire.modeling.el.FunctionResult; > import org.eclipse.sapphire.ui.def.IEditorPageDef; > import org.eclipse.sapphire.ui.def.ISapphireDocumentation; > import org.eclipse.sapphire.ui.def.ISapphireDocumentationDef; >@@ -32,6 +36,30 @@ > > { > private PropertiesViewContributionPart propertiesViewContributionPart; >+ private FunctionResult imageFunctionResult; >+ >+ @Override >+ protected void init() { >+ super.init(); >+ >+ final IModelElement element = getModelElement(); >+ final IEditorPageDef def = getDefinition(); >+ >+ this.imageFunctionResult = initExpression >+ ( >+ element, >+ def.getPageHeaderImage().getContent(), >+ ImageData.class, >+ null, >+ new Runnable() >+ { >+ public void run() >+ { >+ notifyListeners( new ImageChangedEvent( SapphireEditorPagePart.this ) ); >+ } >+ } >+ ); >+ } > > @Override > public IEditorPageDef getDefinition() >@@ -86,6 +114,22 @@ > } > } > >+ public ImageData getPageHeaderImage() >+ { >+ return (ImageData) this.imageFunctionResult.value(); >+ } >+ >+ @Override >+ public void dispose() >+ { >+ super.dispose(); >+ >+ if( this.imageFunctionResult != null ) >+ { >+ this.imageFunctionResult.dispose(); >+ } >+ } >+ > public static abstract class Event extends SapphirePartEvent > { > public Event( final SapphireEditorPagePart part ) >Index: src/org/eclipse/sapphire/ui/def/IEditorPageDef.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/def/IEditorPageDef.java,v >retrieving revision 1.8 >diff -u -r1.8 IEditorPageDef.java >--- src/org/eclipse/sapphire/ui/def/IEditorPageDef.java 22 Apr 2011 22:26:38 -0000 1.8 >+++ src/org/eclipse/sapphire/ui/def/IEditorPageDef.java 12 May 2011 20:13:22 -0000 >@@ -8,7 +8,8 @@ > * 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.def; > >@@ -17,6 +18,8 @@ > import org.eclipse.sapphire.modeling.ValueProperty; > import org.eclipse.sapphire.modeling.annotations.DefaultValue; > 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; > >@@ -57,4 +60,16 @@ > Value<String> getPageHeaderText(); > void setPageHeaderText( String pageHeaderText ); > >+ // *** PageHeaderImage *** >+ >+ @Type( base = Function.class ) >+ @Label( standard = "page header image" ) >+ @XmlBinding( path = "page-header-image" ) >+ >+ ValueProperty PROP_PAGE_HEADER_IMAGE = new ValueProperty( TYPE, "PageHeaderImage" ); >+ >+ Value<Function> getPageHeaderImage(); >+ void setPageHeaderImage( String value ); >+ void setPageHeaderImage( 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
Flags:
konstantin
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 343972
:
194163
|
194167
| 195542