Java Code Examples for org.eclipse.swt.SWT#APPLICATION_MODAL
The following examples show how to use
org.eclipse.swt.SWT#APPLICATION_MODAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserDefinedJavaClassDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
private boolean cancel() { if ( input.hasChanged() ) { MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL ); box.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.WarningDialogChanged.Title" ) ); box.setMessage( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.WarningDialogChanged.Message", Const.CR ) ); int answer = box.open(); if ( answer == SWT.NO ) { return false; } } stepname = null; input.setChanged( changed ); dispose(); return true; }
Example 2
Source File: ScriptValuesModDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
private boolean cancel() { if ( input.hasChanged() ) { MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL | SWT.SHEET ); box.setText( BaseMessages.getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Title" ) ); box .setMessage( BaseMessages .getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Message", Const.CR ) ); int answer = box.open(); if ( answer == SWT.NO ) { return false; } } stepname = null; input.setChanged( changed ); dispose(); return true; }
Example 3
Source File: ScriptValuesModDialog.java From hop with Apache License 2.0 | 6 votes |
private boolean cancel() { if ( input.hasChanged() ) { MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL | SWT.SHEET ); box.setText( BaseMessages.getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Title" ) ); box .setMessage( BaseMessages .getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Message", Const.CR ) ); int answer = box.open(); if ( answer == SWT.NO ) { return false; } } transformName = null; input.setChanged( changed ); dispose(); return true; }
Example 4
Source File: TeraFastAboutDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * * @param shell * the shell. */ public TeraFastAboutDialog( final Shell shell ) { this.dialog = new Shell( shell, SWT.BORDER | SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.SHEET ); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; this.dialog.setLayout( gridLayout ); this.dialog.setText( BaseMessages.getString( PKG, "TeraFastDialog.About.Shell.Title" ) ); this.dialog.setImage( shell.getImage() ); this.buildIconCell(); this.buildPluginInfoCell(); this.buildOkButton(); this.dialog.pack(); Rectangle shellBounds = shell.getBounds(); Point dialogSize = this.dialog.getSize(); this.dialog.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y + ( shellBounds.height - dialogSize.y ) / 2 ); }
Example 5
Source File: ScriptValuesMetaModDialog.java From hop with Apache License 2.0 | 6 votes |
private boolean cancel() { if ( input.hasChanged() ) { MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL | SWT.SHEET ); box.setText( BaseMessages.getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Title" ) ); box .setMessage( BaseMessages .getString( PKG, "ScriptValuesModDialog.WarningDialogChanged.Message", Const.CR ) ); int answer = box.open(); if ( answer == SWT.NO ) { return false; } } transformName = null; input.setChanged( changed ); dispose(); return true; }
Example 6
Source File: KettleDatabaseRepositoryDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public KettleDatabaseRepositoryDialog( Shell parent, int style, RepositoryMeta repositoryMeta, RepositoriesMeta repositoriesMeta ) { this.display = parent.getDisplay(); this.props = PropsUI.getInstance(); this.input = (KettleDatabaseRepositoryMeta) repositoryMeta; this.repositories = repositoriesMeta; this.masterRepositoriesMeta = repositoriesMeta.clone(); this.masterRepositoryName = repositoryMeta.getName(); shell = new Shell( parent, style | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN | SWT.APPLICATION_MODAL | SWT.SHEET ); shell.setText( BaseMessages.getString( PKG, "RepositoryDialog.Dialog.Main.Title" ) ); }
Example 7
Source File: BaseDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * Returns a {@link org.eclipse.swt.events.SelectionAdapter} that is used to "submit" the dialog. */ private Display prepareLayout() { // Prep the parent shell and the dialog shell final Shell parent = getParent(); final Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.SHEET ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); props.setLook( shell ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { @Override public void shellClosed( ShellEvent e ) { dispose(); } } ); final FormLayout formLayout = new FormLayout(); formLayout.marginWidth = MARGIN_SIZE; formLayout.marginHeight = MARGIN_SIZE; shell.setLayout( formLayout ); shell.setText( this.title ); return display; }
Example 8
Source File: Utils.java From BiglyBT with GNU General Public License v2.0 | 5 votes |
/** * Waits until modal dialogs are disposed. Assumes we are on SWT thread * * @since 3.0.1.3 */ public static void waitForModals() { SWTThread swt = SWTThread.getInstance(); Display display; if (swt == null) { display = Display.getDefault(); if (display == null) { System.err.println("SWT Thread not started yet!"); return; } } else { if (swt.isTerminated()) { return; } display = swt.getDisplay(); } if (display == null || display.isDisposed()) { return; } Shell[] shells = display.getShells(); Shell modalShell = null; for (int i = 0; i < shells.length; i++) { Shell shell = shells[i]; if ((shell.getStyle() & SWT.APPLICATION_MODAL) != 0) { modalShell = shell; break; } } if (modalShell != null) { while (!modalShell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } }
Example 9
Source File: PositiveNegativeColorDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
protected void setShellStyle( int newShellStyle ) { super.setShellStyle( newShellStyle | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL ); }
Example 10
Source File: FindReplaceDialog.java From pmTrans with GNU Lesser General Public License v3.0 | 5 votes |
private List<WordIndexerWrapper> findAll(String keyWord, boolean matchCase, boolean wholeWord, boolean regex, Point searchBounds) { String wholeText = text.getText(); if (!matchCase) { keyWord = keyWord.toLowerCase(); wholeText = wholeText.toLowerCase(); } if (!regex) { String temp = ""; for (int i = 0; i < keyWord.length(); i++) temp += ("[" + keyWord.charAt(i) + "]"); keyWord = temp; } if (wholeWord) keyWord = "\\b" + keyWord + "\\b"; System.out.println("looking for: " + keyWord); WordIndexer finder = new WordIndexer(wholeText); List<WordIndexerWrapper> indexes = new LinkedList<WordIndexerWrapper>(); try { indexes = finder.findIndexesForKeyword(keyWord, searchBounds.x, searchBounds.y); } catch (PatternSyntaxException e) { MessageBox diag = new MessageBox(Display.getCurrent().getActiveShell(), SWT.APPLICATION_MODAL | SWT.ICON_ERROR | SWT.OK); diag.setMessage("Regular expression error.\n\n" + e.getMessage()); diag.open(); } return indexes; }
Example 11
Source File: ExcelExportProgessBar.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public void open(int minValue, int maxValue) { childShell = new Shell(shell.getDisplay(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); childShell.setText("Exporting to Excel.. please wait"); progressBar = new ProgressBar(childShell, SWT.SMOOTH); progressBar.setMinimum(minValue); progressBar.setMaximum(maxValue); progressBar.setBounds(0, 0, 400, 25); progressBar.setFocus(); childShell.pack(); childShell.open(); }
Example 12
Source File: LifecycleEnvironmentDialog.java From hop with Apache License 2.0 | 5 votes |
public LifecycleEnvironmentDialog( Shell parent, LifecycleEnvironment environment, IVariables variables ) { super( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE ); this.environment = environment; this.variables = variables; props = PropsUi.getInstance(); }
Example 13
Source File: ProjectDialog.java From hop with Apache License 2.0 | 5 votes |
public ProjectDialog( Shell parent, Project project, ProjectConfig projectConfig, IVariables variables ) { super( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE ); this.project = project; this.projectConfig = projectConfig; props = PropsUi.getInstance(); this.variables = new Variables(); this.variables.initializeVariablesFrom( null ); project.modifyVariables( variables, projectConfig, Collections.emptyList(), null ); }
Example 14
Source File: ImportRulesDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Import the rules from an XML rules file... */ protected void importRules() { if ( !importRules.getRules().isEmpty() ) { MessageBox box = new MessageBox( shell, SWT.ICON_WARNING | SWT.APPLICATION_MODAL | SWT.SHEET | SWT.YES | SWT.NO ); box.setText( "Warning" ); box.setMessage( "Are you sure you want to load a new set of rules, replacing the current list?" ); int answer = box.open(); if ( answer != SWT.YES ) { return; } } FileDialog dialog = new FileDialog( shell, SWT.OPEN ); dialog.setFilterExtensions( new String[] { "*.xml;*.XML", "*" } ); dialog.setFilterNames( new String[] { BaseMessages.getString( PKG, "System.FileType.XMLFiles" ), BaseMessages.getString( PKG, "System.FileType.AllFiles" ) } ); if ( dialog.open() != null ) { String filename = dialog.getFilterPath() + System.getProperty( "file.separator" ) + dialog.getFileName(); ImportRules newRules = new ImportRules(); try { newRules.loadXML( XMLHandler.getSubNode( XMLHandler.loadXMLFile( filename ), ImportRules.XML_TAG ) ); importRules = newRules; // Re-load the dialog. // getCompositesData(); } catch ( Exception e ) { new ErrorDialog( shell, "Error", "There was an error during the import of the import rules file, verify the XML format.", e ); } } }
Example 15
Source File: ExternalizedTextEditorDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
protected void setShellStyle( int newShellStyle ) { super.setShellStyle( newShellStyle | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL ); }
Example 16
Source File: ShellFactory.java From BiglyBT with GNU General Public License v2.0 | 5 votes |
static private int fixupStyle(int style) { if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL)) != 0 && Utils.anyShellHaveStyle(SWT.ON_TOP | SWT.TITLE)) { UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT(); if (uiFunctions != null && uiFunctions.getMainShell() != null) { style |= SWT.ON_TOP; } } return style; }
Example 17
Source File: UIFunctionsImpl.java From BiglyBT with GNU General Public License v2.0 | 4 votes |
@Override public Shell showCoreWaitDlg() { final SkinnedDialog closeDialog = new SkinnedDialog( "skin3_dlg_coreloading", "coreloading.body", SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL); closeDialog.setTitle(MessageText.getString("dlg.corewait.title")); SWTSkin skin = closeDialog.getSkin(); SWTSkinObjectButton soButton = (SWTSkinObjectButton) skin.getSkinObject("close"); final SWTSkinObjectText soWaitTask = (SWTSkinObjectText) skin.getSkinObject("task"); final SWTSkinObject soWaitProgress = skin.getSkinObject("progress"); if (soWaitProgress != null) { soWaitProgress.getControl().addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { Control c = (Control) e.widget; Point size = c.getSize(); e.gc.setBackground(ColorCache.getColor(e.display, "#23a7df")); Object data = soWaitProgress.getData("progress"); if (data instanceof Long) { int waitProgress = ((Long) data).intValue(); int breakX = size.x * waitProgress / 100; e.gc.fillRectangle(0, 0, breakX, size.y); e.gc.setBackground(ColorCache.getColor(e.display, "#cccccc")); e.gc.fillRectangle(breakX, 0, size.x - breakX, size.y); } } }); } if (!CoreFactory.isCoreRunning()) { final Initializer initializer = Initializer.getLastInitializer(); if (initializer != null) { initializer.addListener(new InitializerListener() { @Override public void reportPercent(final int percent) { Utils.execSWTThread(new AERunnable() { @Override public void runSupport() { if (soWaitProgress != null && !soWaitProgress.isDisposed()) { soWaitProgress.setData("progress", new Long(percent)); soWaitProgress.getControl().redraw(); soWaitProgress.getControl().update(); } } }); if (percent > 100) { initializer.removeListener(this); } } @Override public void reportCurrentTask(String currentTask) { if (soWaitTask != null && !soWaitTask.isDisposed()) { soWaitTask.setText(currentTask); } } }); } } if (soButton != null) { soButton.addSelectionListener(new ButtonListenerAdapter() { @Override public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) { closeDialog.close(); } }); } closeDialog.addCloseListener(new SkinnedDialogClosedListener() { @Override public void skinDialogClosed(SkinnedDialog dialog) { } }); closeDialog.open(); return closeDialog.getShell(); }
Example 18
Source File: SWTWindow.java From tuxguitar with GNU Lesser General Public License v2.1 | 4 votes |
public SWTWindow(SWTWindow parent, boolean modal, boolean resizable) { this(new Shell(parent.getControl(), SWT.DIALOG_TRIM | (modal ? SWT.APPLICATION_MODAL : 0) | (resizable ? SWT.RESIZE | SWT.MAX : 0)), parent); }
Example 19
Source File: AbstractStyleEditorDialog.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
public AbstractStyleEditorDialog(Shell parent) { super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); }
Example 20
Source File: ExtendedItemFilterDialog.java From birt with Eclipse Public License 1.0 | 4 votes |
protected void setShellStyle( int newShellStyle ) { super.setShellStyle( newShellStyle | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL ); }