Skip to content

Commit

Permalink
Rebase onto 8.1.0.0-365
Browse files Browse the repository at this point in the history
This is a combination of the following commits.
Do not dispose the titleImageLabel to resolve "Widget is disposed" error when opening the repository dialog
Comment-out the use of an unimplemented SWT API "gc.copyArea"
Fix the issue that menuitems cannot be pushed on webSpoon unless their type is checkbox
Disable the use of CMD key for shortcuts. At least, this should not be determined in the server-side
Revert "Do not dispose the titleImageLabel to resolve "Widget is disposed" error when opening the repository dialog"
This reverts commit cd6fb78.
Change the version of pentaho-xul-swt
Restore the image of checkboxes in XulTree
  • Loading branch information
Hiromu Hota committed May 17, 2018
1 parent a52ea1b commit eeaa4a9
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 27 deletions.
4 changes: 2 additions & 2 deletions swt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<artifactId>commons-xul-swt</artifactId>
<packaging>jar</packaging>
<version>8.1.0.0-365</version>
<version>8.1.0.0-365-16</version>

<name>Commons XUL SWT</name>

Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>commons-xul-core</artifactId>
<version>${project.version}</version>
<version>${project.parent.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public IAction getAction() {
}

private Action initAction( Element self, Action alternativeAction ) {
int style = Action.AS_DROP_DOWN_MENU;
int style = Action.AS_PUSH_BUTTON;
if ( self != null && "checkbox".equals( self.getAttributeValue( "type" ) ) ) {
style = Action.AS_CHECK_BOX;
}
Expand Down Expand Up @@ -193,8 +193,7 @@ public void setAccesskey( String accessKey ) {
if ( contributionItem != null ) {
int mask = 0;
if ( accessKey.indexOf( "ctrl" ) > -1 ) { //$NON-NLS-1$
boolean isMac = System.getProperty( "os.name" ).toLowerCase().indexOf( "mac" ) >= 0;
mask += isMac ? SWT.COMMAND : SWT.CTRL;
mask += SWT.CTRL;
}
if ( accessKey.indexOf( "shift" ) > -1 ) { //$NON-NLS-1$
mask += SWT.SHIFT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,9 @@ public Image getColumnImage( Object row, int col ) {
}

private Image makeImage( final Shell shell, boolean type ) {
Shell placeholder = new Shell( shell, SWT.NO_TRIM );
Button btn = new Button( placeholder, SWT.CHECK );
btn.setSelection( type );
Point bsize = btn.computeSize( SWT.DEFAULT, SWT.DEFAULT );
btn.setSize( bsize );
placeholder.setSize( bsize );
btn.setLocation( 0, 0 );
placeholder.open();

final GC gc = new GC( btn );
final Image image = new Image( shell.getDisplay(), bsize.x, bsize.y );
shell.getDisplay().syncExec( new Runnable() {
@Override public void run() {
shell.getDisplay().readAndDispatch();
gc.copyArea( image, 0, 0 );
gc.dispose();
}
} );

placeholder.close();

return image;
String location = "org/pentaho/ui/xul/swt/tags/images/";
location += type ? "checked.png" : "unchecked.png";
return new Image( shell.getDisplay(), this.getClass().getClassLoader().getResourceAsStream( location ) );
}

private boolean isSelected( Object row, int col ) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eeaa4a9

Please sign in to comment.