@Override public void widgetSelected(SelectionEvent e) { WatchDialog dialog = new WatchDialog(shell.getParent() .getShell(), image, text_value.getText()); dialog.open(); } });
@Override public void widgetSelected(SelectionEvent e) { WatchDialog dialog = new WatchDialog(shell.getParent() .getShell(), image, currentData.getValue()); dialog.open(); } });
@Override public void widgetSelected(SelectionEvent e) { WatchDialog dialog = new WatchDialog(shell.getParent() .getShell(), image, currentData.getValue()); dialog.open(); } });
public Point getRealPosition( Composite canvas, int x, int y ) { Point p = new Point( 0, 0 ); Composite follow = canvas; while ( follow != null ) { Point xy = new Point( follow.getLocation().x, follow.getLocation().y ); p.x += xy.x; p.y += xy.y; follow = follow.getParent(); } p.x = x - p.x - 8; p.y = y - p.y - 48; return screen2real( p.x, p.y ); }
@Override public void widgetSelected(SelectionEvent e) { TableItem[] items = table.getSelection(); WatchDialog dialog = new WatchDialog(shell.getParent() .getShell(), image, items[0].getText(1)); dialog.open(); } });
@Override public void widgetSelected(SelectionEvent e) { TableItem[] items = table.getSelection(); WatchDialog dialog = new WatchDialog(shell.getParent() .getShell(), image, items[0].getText()); dialog.open(); } });
@Override public void widgetSelected(SelectionEvent e) { InputDialog inputDialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null); if (inputDialog.open() == InputDialog.OK) { String values = inputDialog.getValue(); String[] setValues = values.split(";"); long size = service.addValues(id, db, key, setValues); if(size == 0) MessageDialog.openInformation(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.ADDSETVALUES)); refresh(); } } });
public Point getRealPosition( Composite canvas, int x, int y ) { Point p = new Point( 0, 0 ); Composite follow = canvas; while ( follow != null ) { org.eclipse.swt.graphics.Point loc = follow.getLocation(); Point xy = new Point( loc.x, loc.y ); p.x += xy.x; p.y += xy.y; follow = follow.getParent(); } int offsetX = -16; int offsetY = -64; if ( Const.isOSX() ) { offsetX = -2; offsetY = -24; } p.x = x - p.x + offsetX; p.y = y - p.y + offsetY; return screen2real( p.x, p.y ); }
@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INSERTHEAD), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null); if(dialog.open() == InputDialog.OK){ String value = dialog.getValue(); service.addHead(id, db, key, value); refresh(); } } });
break; case Adding: boolean ok = MessageDialog.openConfirm(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.DELETE), RedisClient.i18nFile.getText(I18nFile.DELETEHASH)); if(ok){ delete(); ok = MessageDialog.openConfirm(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.DELETE), RedisClient.i18nFile.getText(I18nFile.DELETEHASH)); if(ok){ deleteData(); currentData.reset(); ok = MessageDialog.openConfirm(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.DELETE), RedisClient.i18nFile.getText(I18nFile.DELETEHASH)); if(ok){ deleteData();
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Menu.StopTranformation" ) ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { stopTransformation(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Menu.SafeStopTranformation" ) ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { safeStop(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { stopTransformation(); } } } );
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Run.Run" ) ); item1.setAccelerator( SWT.F9 ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { runJob(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Run.RunOptions" ) ); item2.setAccelerator( SWT.F8 ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { runOptionsJob(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { runJob(); } } } );
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Run.Run" ) ); item1.setAccelerator( SWT.F9 ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { runTransformation(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Run.RunOptions" ) ); item2.setAccelerator( SWT.F8 ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { runOptionsTransformation(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { runTransformation(); } } } );
@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.APPENDTAIL), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null); if(dialog.open() == InputDialog.OK){ String value = dialog.getValue(); service.addTail(id, db, key, value); pageListener.setCount(); table.clear(table.getItemCount()-1); table.setSelection(table.getItemCount()-1); table.setSelection(-1); currentData.setItem(null); status = Status.Normal; statusChanged(); } } });
boolean ok = MessageDialog.openConfirm(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.UPDATE), RedisClient.i18nFile.getText(I18nFile.UPDATEFIELD)); if(ok){ service.setField(id, db, key, field, value); boolean ok = MessageDialog.openConfirm(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.UPDATE), RedisClient.i18nFile.getText(I18nFile.UPDATEFIELD)); if(ok){ service.setField(id, db, key, field, value);
content.getParent().pack();
public static ScrolledComposite getScrolledComposite(Control c) { Composite parent = c.getParent(); while (parent != null) { if (parent instanceof ScrolledComposite) { return (ScrolledComposite) parent; } parent = parent.getParent(); } return null; }
/** * Disposes the controls from this page */ public void dispose() { fMainComp.getParent().dispose(); }
private void reflow() { Composite parent = section.getParent(); while (parent != null) { if (parent instanceof SharedScrolledComposite) { ((SharedScrolledComposite) parent).reflow(true); return; } parent = parent.getParent(); } }
public void setShowProgress(boolean showProgress) { this.showProgress = showProgress; progressComposite.setVisible(showProgress); ((GridData) progressComposite.getLayoutData()).exclude = !showProgress; getParent().getParent().layout(true, true); }