Skip to content

Commit

Permalink
[BACKLOG-11071] - Updated keys to be blocked. Removed print key block
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Mariano authored and annapopova1 committed Oct 4, 2016
1 parent 631eede commit aa305e2
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions ui/src/org/pentaho/di/ui/spoon/ExpandedContentManager.java
Expand Up @@ -33,8 +33,6 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.pentaho.di.ui.spoon.trans.TransGraph;

import java.util.function.Consumer;
Expand Down Expand Up @@ -104,30 +102,23 @@ public static void createExpandedContent( TransGraph parent, String url ) {
arrowNavigation = ( state == SWT.COMMAND || state == SWT.ALT )
&& ( key == SWT.ARROW_LEFT || key == SWT.ARROW_RIGHT ),
backslashNavigation = ( state == SWT.SHIFT && key == SWT.BS ) || key == SWT.BS,
reloadContent = state == SWT.CTRL && ( key == SWT.F5 || key == 82 ) || key == SWT.F5,
printContent = state == SWT.CTRL && key == 80;
reloadContent = state == SWT.CTRL && ( key == SWT.F5 || key == 114 /* r key */ ) || key == SWT.F5,
zoomContent = state == SWT.CTRL && ( key == SWT.KEYPAD_ADD || key == SWT.KEYPAD_SUBTRACT
|| key == 61 /* + key */ || key == 45 /* - key */ );

if ( copyContent ) {
Browser thisBrowser = (Browser) keyEvent.getSource();
Clipboard clipboard = new Clipboard( thisBrowser.getDisplay() );
clipboard.setContents( new String[]{thisBrowser.getUrl()}, new Transfer[]{ TextTransfer.getInstance()} );
clipboard.dispose();
} else if ( arrowNavigation || backslashNavigation || reloadContent || printContent ) {
} else if ( arrowNavigation || backslashNavigation || reloadContent || zoomContent ) {
keyEvent.doit = false;
}
}

@Override public void keyReleased( KeyEvent keyEvent ) {
}
} );

browser.addListener( SWT.MouseWheel, new Listener() {
@Override public void handleEvent( Event event ) {
if ( event.stateMask == SWT.CTRL ) {
event.doit = false;
}
}
} );
}
browser.setUrl( url );
}
Expand Down

0 comments on commit aa305e2

Please sign in to comment.