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 195700 Details for
Bug 345597
[Theming] Background color is not applied
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]
Proposed patch
Bug-345597.patch (text/plain), 10.42 KB, created by
Ivan Furnadjiev
on 2011-05-16 05:13:22 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2011-05-16 05:13:22 EDT
Size:
10.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: src/org/eclipse/rwt/internal/lifecycle/JSConst.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/rwt/internal/lifecycle/JSConst.java,v >retrieving revision 1.16 >diff -u -r1.16 JSConst.java >--- src/org/eclipse/rwt/internal/lifecycle/JSConst.java 27 Jan 2011 23:11:23 -0000 1.16 >+++ src/org/eclipse/rwt/internal/lifecycle/JSConst.java 16 May 2011 09:07:36 -0000 >@@ -158,6 +158,7 @@ > public static final String QX_FIELD_FONT = "font"; > public static final String QX_FIELD_COLOR = "textColor"; > public static final String QX_FIELD_BG_COLOR = "backgroundColor"; >+ public static final String QX_FIELD_BG_GRADIENT = "backgroundGradient"; > public static final String QX_FIELD_ORIENTATION = "orientation"; > public static final String QX_FIELD_CAPTION = "caption"; > public static final String QX_FIELD_ENABLED = "enabled"; >Index: src/org/eclipse/rwt/lifecycle/WidgetLCAUtil.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/rwt/lifecycle/WidgetLCAUtil.java,v >retrieving revision 1.25 >diff -u -r1.25 WidgetLCAUtil.java >--- src/org/eclipse/rwt/lifecycle/WidgetLCAUtil.java 4 May 2011 11:09:02 -0000 1.25 >+++ src/org/eclipse/rwt/lifecycle/WidgetLCAUtil.java 16 May 2011 09:07:36 -0000 >@@ -690,9 +690,7 @@ > * @throws IOException > * @see {@link #preserveBackground(Widget, Color, boolean)} > */ >- public static void writeBackground( final Widget widget, >- final Color background, >- final boolean transparency ) >+ public static void writeBackground( Widget widget, Color background, boolean transparency ) > throws IOException > { > JSWriter writer = JSWriter.getWriterFor( widget ); >@@ -701,15 +699,17 @@ > Boolean.valueOf( transparency ), > Boolean.FALSE ); > if( !changed && !transparency ) { >- changed >- = WidgetLCAUtil.hasChanged( widget, PROP_BACKGROUND, background, null ); >+ changed = WidgetLCAUtil.hasChanged( widget, PROP_BACKGROUND, background, null ); > } > if( changed ) { > if( transparency ) { >+ writer.set( JSConst.QX_FIELD_BG_GRADIENT, ( Object )null ); > writer.set( JSConst.QX_FIELD_BG_COLOR, ( Object )null ); > } else if( background != null ) { >+ writer.set( JSConst.QX_FIELD_BG_GRADIENT, ( Object )null ); > writer.set( JSConst.QX_FIELD_BG_COLOR, background ); > } else { >+ writer.reset( JSConst.QX_FIELD_BG_GRADIENT ); > writer.reset( JSConst.QX_FIELD_BG_COLOR ); > } > } >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/rwt/lifecycle/WidgetLCAUtil_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/rwt/lifecycle/WidgetLCAUtil_Test.java,v >retrieving revision 1.18 >diff -u -r1.18 WidgetLCAUtil_Test.java >--- src/org/eclipse/rwt/lifecycle/WidgetLCAUtil_Test.java 4 May 2011 11:08:59 -0000 1.18 >+++ src/org/eclipse/rwt/lifecycle/WidgetLCAUtil_Test.java 16 May 2011 09:07:37 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2011 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -31,10 +31,21 @@ > > > public class WidgetLCAUtil_Test extends TestCase { >+ >+ private Display display; >+ private Shell shell; >+ >+ protected void setUp() throws Exception { >+ Fixture.setUp(); >+ display = new Display(); >+ shell = new Shell( display , SWT.NONE ); >+ } >+ >+ protected void tearDown() throws Exception { >+ Fixture.tearDown(); >+ } > > public void testHasChanged() { >- Display display = new Display(); >- Shell shell = new Shell( display , SWT.NONE ); > Text text = new Text( shell, SWT.NONE ); > // test initial behaviour, text is same as default value -> no 'change' > text.setText( "" ); >@@ -60,8 +71,6 @@ > } > > public void testHasChangedWidthArrays() { >- Display display = new Display(); >- Shell shell = new Shell( display , SWT.NONE ); > List list = new List( shell, SWT.MULTI ); > > boolean hasChanged; >@@ -205,8 +214,6 @@ > } > > public void testFontBold() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display, SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -225,8 +232,6 @@ > } > > public void testFontItalic() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display, SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -245,8 +250,6 @@ > } > > public void testFontSize() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display, SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > Fixture.fakeResponseWriter(); > Fixture.markInitialized( display ); >@@ -259,8 +262,6 @@ > } > > public void testFontReset() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display, SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > Fixture.fakeResponseWriter(); > Font font = Graphics.getFont( "Arial", 12, SWT.BOLD ); >@@ -272,8 +273,6 @@ > } > > public void testForegroundReset() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display, SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > Fixture.fakeResponseWriter(); > Color red = Graphics.getColor( 255, 0, 0 ); >@@ -285,8 +284,6 @@ > } > > public void testWriteImage() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Label item = new Label( shell, SWT.NONE ); > > // for an un-initialized control: no image -> no markup >@@ -320,8 +317,6 @@ > } > > public void testWriteVariant() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -337,8 +332,6 @@ > } > > public void testWriteCustomVariant() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Control control = new Label( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -371,8 +364,6 @@ > } > > public void testWriteBackground() throws Exception { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Control control = new Label( shell, SWT.NONE ); > Color red = display.getSystemColor( SWT.COLOR_RED ); > >@@ -422,9 +413,45 @@ > assertEquals( "", Fixture.getAllMarkup() ); > } > >+ public void testWriteBackground_Transparency_RemoveBackgroundGradient() throws IOException { >+ Control control = new Label( shell, SWT.NONE ); >+ Fixture.markInitialized( control ); >+ >+ Fixture.fakeResponseWriter(); >+ WidgetLCAUtil.preserveBackground( control, null, false ); >+ WidgetLCAUtil.writeBackground( control, null, true ); >+ >+ String expected = "w.setBackgroundGradient( null );w.setBackgroundColor( null );"; >+ assertTrue( Fixture.getAllMarkup().indexOf( expected ) != -1 ); >+ } >+ >+ public void testWriteBackground_ResetBackgroundGradient() throws IOException { >+ Control control = new Label( shell, SWT.NONE ); >+ Fixture.markInitialized( control ); >+ Color red = display.getSystemColor( SWT.COLOR_RED ); >+ >+ Fixture.fakeResponseWriter(); >+ WidgetLCAUtil.preserveBackground( control, red, false ); >+ WidgetLCAUtil.writeBackground( control, null, false ); >+ >+ String expected = "w.resetBackgroundGradient();w.resetBackgroundColor();"; >+ assertTrue( Fixture.getAllMarkup().indexOf( expected ) != -1 ); >+ } >+ >+ public void testWriteBackground_RemoveBackgroundGradient() throws IOException { >+ Control control = new Label( shell, SWT.NONE ); >+ Fixture.markInitialized( control ); >+ Color red = display.getSystemColor( SWT.COLOR_RED ); >+ >+ Fixture.fakeResponseWriter(); >+ WidgetLCAUtil.preserveBackground( control, null, false ); >+ WidgetLCAUtil.writeBackground( control, red ); >+ >+ String expected = "w.setBackgroundGradient( null );w.setBackgroundColor( \"#ff0000\" );"; >+ assertTrue( Fixture.getAllMarkup().indexOf( expected ) != -1 ); >+ } >+ > public void testWriteMenu() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Label label = new Label( shell, SWT.NONE ); > > // for an un-initialized control: no menu -> no markup >@@ -456,8 +483,6 @@ > } > > public void testWriteStyleFlag() throws IOException { >- Display display = new Display(); >- Composite shell = new Shell( display , SWT.NONE ); > Control control = new Label( shell, SWT.NONE ); > Control borderControl = new Label( shell, SWT.BORDER ); > >@@ -472,8 +497,6 @@ > } > > public void testWriteBackgroundGradient() throws IOException { >- Display display = new Display(); >- Shell shell = new Shell( display , SWT.NONE ); > Control control = new Composite( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -527,8 +550,6 @@ > } > > public void testWriteBackgroundGradient_Horizontal() throws IOException { >- Display display = new Display(); >- Shell shell = new Shell( display , SWT.NONE ); > Control control = new Composite( shell, SWT.NONE ); > > Fixture.fakeResponseWriter(); >@@ -552,8 +573,6 @@ > } > > public void testWriteRoundedBorder() throws IOException { >- Display display = new Display(); >- Shell shell = new Shell( display , SWT.NONE ); > Widget widget = new Composite( shell, SWT.NONE ); > > CompositeLCA lca = new CompositeLCA(); >@@ -593,12 +612,4 @@ > + "( wm.findWidgetById( \"w2\" ), 4, \"#00ff00\", 5, 4, 7, 8 );"; > assertEquals( expected, Fixture.getAllMarkup() ); > } >- >- protected void setUp() throws Exception { >- Fixture.setUp(); >- } >- >- protected void tearDown() throws Exception { >- Fixture.tearDown(); >- } > }
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:
ivan
:
review?
Actions:
View
|
Diff
Attachments on
bug 345597
:
195495
| 195700