@Override protected void configureShell(Shell newShell) { super.configureShell(newShell); if (originalAction == null) newShell.setText(MessagesForTracepointActions.TracepointActions_ActionDialog_New); else newShell.setText(originalAction.getName()); }
private void setTitle() { if (displayModel.getName() != null && displayModel.getName().trim().length() > 0) { shell.setText(displayModel.getName()); } else { // If the name doesn't exist, use the OPI path shell.setText(path.toString()); } }
private void createDialog(Shell applicationShell) { if (dialog == null || dialog.isDisposed()) { dialog = new Shell(applicationShell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); if (applicationShell.getImage() != null) { dialog.setImage(applicationShell.getImage()); } dialog.addListener( SWT.Close, new Listener() { public void handleEvent(Event event) { hideCustomPanelChildren(); } }); dialog.addDisposeListener( new DisposeListener() { public void widgetDisposed(DisposeEvent arg0) { disposeImages(); } }); if (fileDialogMode != VFS_DIALOG_SAVEAS) { dialog.setText(Messages.getString("VfsFileChooserDialog.openFile")); // $NON-NLS-1$ } else { dialog.setText(Messages.getString("VfsFileChooserDialog.saveAs")); // $NON-NLS-1$ } dialog.setLayout(new GridLayout()); dialog.setBackgroundMode(SWT.INHERIT_FORCE); dialog.setBackground(dialog.getDisplay().getSystemColor(SWT.COLOR_WHITE)); createCustomUIPanel(dialog); } }
/* * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ @Override protected void configureShell(Shell shell) { super.configureShell(shell); if (StringUtils.isSet(fBookmark.getName())) shell.setText(NLS.bind(Messages.PreviewFeedDialog_PREVIEW_OF, fBookmark.getName())); else shell.setText(Messages.PreviewFeedDialog_PREVIEW); }
@Override protected void configureShell(Shell newShell) { super.configureShell(newShell); if (system) { newShell.setText(Messages.getString("ShowRoutineItemsDialog.systemTitle")); // $NON-NLS-1$ } else { newShell.setText(Messages.getString("ShowRoutineItemsDialog.title")); // $NON-NLS-1$ } }
@Override protected void configureShell(Shell shell) { super.configureShell(shell); if (isEdit) { shell.setText(EDIT_TITLE); } else { shell.setText(CREATE_TITLE); } }
@Override protected void configureShell(final Shell shell) { super.configureShell(shell); if (this.selectionMaxSize > 1) { shell.setText(Messages.ETypedElementSelectionDialog_dialogTitleMultiSelection); } else { shell.setText(Messages.ETypedElementSelectionDialog_dialogTitle); } // TODO: image for ETypedElement // shell.setImage(...); }
@Override protected void configureShell(Shell shell) { super.configureShell(shell); Shell s2 = shell.getParent().getShell(); if (s2 != null) shell.setLocation(s2.getLocation()); shell.setBounds(shell.getLocation().x, shell.getLocation().y, 550, 500); if (domain == null) shell.setText(CredentialMessages.AddACredentialDomain); else { shell.setText(CredentialMessages.EditACredentialDomain); } }
private void updateShellTitle() { if (shell.isDisposed()) return; String post = ""; switch (modeServer) { case SERVER_WITH_GAME: case SERVER_WITHOUT_GAME: post += " [serveur]"; break; case NO_SERVER: break; default: throw new RuntimeException("Not managed :" + modeServer); } switch (modeClient) { case DISCONNECTED: post += " [non connecté]"; break; case MONITOR: post += " [observation]"; break; case PLAYING: post += " [joueur]"; break; default: throw new RuntimeException("Not managed :" + modeClient); } shell.setText(TXT_WINDOW_TITLE + post); }
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("StyledText with underline and strike through"); shell.setLayout(new FillLayout()); StyledText text = new StyledText(shell, SWT.BORDER); text.setText("0123456789 ABCDEFGHIJKLM NOPQRSTUVWXYZ"); // make 0123456789 appear underlined StyleRange style1 = new StyleRange(); style1.start = 0; style1.length = 10; style1.underline = true; text.setStyleRange(style1); // make ABCDEFGHIJKLM have a strike through StyleRange style2 = new StyleRange(); style2.start = 11; style2.length = 13; style2.strikeout = true; text.setStyleRange(style2); // make NOPQRSTUVWXYZ appear underlined and have a strike through StyleRange style3 = new StyleRange(); style3.start = 25; style3.length = 13; style3.underline = true; style3.strikeout = true; text.setStyleRange(style3); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
@Override protected void configureShell(Shell newShell) { super.configureShell(newShell); if (title != null) { newShell.setText(title); } }
public static void main(String[] args) { Display d = new Display(); Shell shell = new Shell(d); shell.setText("GraphSnippet1"); shell.setLayout(new FillLayout()); shell.setSize(400, 400); final Graph g = new Graph(shell, SWT.NONE); hookMenu(g); SpaceTreeLayoutAlgorithm spaceTreeLayoutAlgorithm = new SpaceTreeLayoutAlgorithm(); g.setLayoutAlgorithm(spaceTreeLayoutAlgorithm, false); g.setExpandCollapseManager(spaceTreeLayoutAlgorithm.getExpandCollapseManager()); g.setSubgraphFactory(new DefaultSubgraph.LabelSubgraphFactory()); for (int i = 0; i < 20; i++) { GraphNode graphNode = new GraphNode(g, SWT.NONE); graphNode.setText("" + i); } shell.open(); while (!shell.isDisposed()) { while (!d.readAndDispatch()) { d.sleep(); } } }
/** Create contents of the window. */ protected void createContents() { mAndroidSdkUpdater = new Shell(mParentShell, SWT.SHELL_TRIM); mAndroidSdkUpdater.addDisposeListener( new DisposeListener() { public void widgetDisposed(DisposeEvent e) { onAndroidSdkUpdaterDispose(); // $hide$ (hide from SWT designer) } }); FillLayout fl; mAndroidSdkUpdater.setLayout(fl = new FillLayout(SWT.HORIZONTAL)); fl.marginHeight = fl.marginWidth = 5; mAndroidSdkUpdater.setMinimumSize(new Point(200, 50)); mAndroidSdkUpdater.setSize(745, 433); mAndroidSdkUpdater.setText("Android SDK and AVD Manager"); mSashForm = new SashForm(mAndroidSdkUpdater, SWT.NONE); mPageList = new List(mSashForm, SWT.BORDER); mPageList.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onPageListSelected(); // $hide$ (hide from SWT designer) } }); mPagesRootComposite = new Composite(mSashForm, SWT.NONE); mStackLayout = new StackLayout(); mPagesRootComposite.setLayout(mStackLayout); createPages(); mSashForm.setWeights(new int[] {150, 576}); }
/* (non-Javadoc) * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText( Messages.getString( "org.nightlabs.jfire.issuetimetracking.ui.CreateIssueQuickDialog.dialogTitle")); //$NON-NLS-1$ }
public void run(String trace) throws JDOMException, IOException, JniException { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Flightbox"); shell.setSize(800, 800); shell.setLayout(new FillLayout(SWT.VERTICAL)); IntervalView widget = new IntervalView(shell, SWT.NONE); VersionizedStack<String> stack = new VersionizedStack<String>(); int i; int max = 1000; for (i = 0; i < max; i++) { long disp = i * 100; stack.push("FOO", 10L + disp); stack.push("BAR", 20L + disp); stack.pop(30L + disp); stack.pop(40L + disp); } widget.setStack(stack); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } shell.dispose(); }
public void buildView(List<String> files) { this.files = files; display = new Display(); shell = new Shell(display); shell.setText("Ebook converter"); shell.setSize(300, 400); list = new org.eclipse.swt.widgets.List(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); list.setBounds(40, 20, 220, 100); label = new Label(shell, SWT.BORDER); label.setBounds(60, 130, 160, 25); label.setText("Converted:"); listConverted = new org.eclipse.swt.widgets.List(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); listConverted.setBounds(40, 170, 220, 100); updateList(); list.addListener(SWT.DefaultSelection, this); listConverted.addListener( SWT.DefaultSelection, new Listener() { public void handleEvent(Event event) { try { int i = listConverted.getSelectionIndices()[0]; System.err.println(i); Runtime.getRuntime().exec(pdfViewer + " " + listConverted.getItem(i)); } catch (IOException e) { e.printStackTrace(); } } }); }
public Main(String args[]) { // must be before display is created (on Macs at least) Display.setAppName("BrailleZephyr"); Display display = Display.getDefault(); // needed to catch Quit (Command-Q) on Macs display.addListener(SWT.Close, new CloseHandler()); shell = new Shell(display); shell.setLayout(new FillLayout()); shell.setText("BrailleZephyr"); shell.addShellListener(new ShellHandler()); bzStyledText = new BZStyledText(shell); bzFile = new BZFile(bzStyledText); bzSettings = new BZSettings(bzStyledText); new BZMenu(bzStyledText, bzFile, bzSettings); // assume any argument is a file to open if (args.length > 0) bzFile.openFile(args[0]); shell.open(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep(); display.dispose(); }
/** @see Windows#configureShell */ protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(JREMessages.VMDetailsDialog_0); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(newShell, IJavaDebugHelpContextIds.JRE_DETAILS_DIALOG); }
/** * Configure Shell. Set a title to it. * * @param newShell The new shell. * @see org.eclipse.jface.dialogs.Dialog#configureShell(org.eclipse.swt.widgets.Shell) */ @Override protected void configureShell(Shell newShell) { newShell.setText( authorResourceBundle.getMessage( showChoiceTable ? ExtensionTags.INSERT_CHOICE_TABLE : ExtensionTags.INSERT_TABLE)); super.configureShell(newShell); }
/** {@inheritDoc} */ protected void configureShell(final Shell shell) { super.configureShell(shell); shell.setText(JarPackagerMessages.JarRefactoringDialog_dialog_title); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(shell, IJavaHelpContextIds.JARPACKAGER_REFACTORING_DIALOG); }
@Override protected void configureShell(final Shell shell) { super.configureShell(shell); shell.setText("XPath Variables Dialog"); final Image headImage = ImageManager.getInstance().getSharedImage(StandardImages.TREE_SMALL); shell.setImage(headImage); }
@Override protected void configureShell(final Shell shell) { super.configureShell(shell); shell.setText(Messages.Dialog_OfflineArea_Title); }
public static void main(java.lang.String[] args) { org.eclipse.swt.widgets.Display display = new org.eclipse.swt.widgets.Display(); org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(display); shell.setLayout(new org.eclipse.swt.layout.FillLayout()); shell.setText(getResourceString("window.title")); java.io.InputStream stream = (org.eclipse.swt.examples.browserexample.BrowserExample.class) .getResourceAsStream(iconLocation); org.eclipse.swt.graphics.Image icon = new org.eclipse.swt.graphics.Image(display, stream); shell.setImage(icon); try { stream.close(); } catch (java.io.IOException e) { e.printStackTrace(); } org.eclipse.swt.examples.browserexample.BrowserExample app = new org.eclipse.swt.examples.browserexample.BrowserExample(shell, true); app.setShellDecoration(icon, true); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } icon.dispose(); app.dispose(); display.dispose(); }
/** * {@inheritDoc} * * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText( DocBridgeUI.getInstance().getString("DocumentationLinkDialog_title")); // $NON-NLS-1$ newShell.setSize(450, 520); }
protected void runTestAGL(GLProfile glprofile) throws InterruptedException { GLData gldata = new GLData(); gldata.doubleBuffer = true; // need SWT.NO_BACKGROUND to prevent SWT from clearing the window // at the wrong times (we use glClear for this instead) final GLCanvas glcanvas = new GLCanvas(composite, SWT.NO_BACKGROUND, gldata); Assert.assertNotNull(glcanvas); glcanvas.setCurrent(); final GLContext glcontext = GLDrawableFactory.getFactory(glprofile).createExternalGLContext(); Assert.assertNotNull(glcontext); // fix the viewport when the user resizes the window glcanvas.addListener( SWT.Resize, new Listener() { public void handleEvent(Event event) { Rectangle rectangle = glcanvas.getClientArea(); glcanvas.setCurrent(); glcontext.makeCurrent(); GL2ES1 gl = glcontext.getGL().getGL2ES1(); OneTriangle.setup(gl, rectangle.width, rectangle.height); glcontext.release(); System.err.println("resize"); } }); // draw the triangle when the OS tells us that any part of the window needs drawing glcanvas.addPaintListener( new PaintListener() { public void paintControl(PaintEvent paintevent) { Rectangle rectangle = glcanvas.getClientArea(); glcanvas.setCurrent(); glcontext.makeCurrent(); GL2ES1 gl = glcontext.getGL().getGL2ES1(); OneTriangle.render(gl, rectangle.width, rectangle.height); glcanvas.swapBuffers(); glcontext.release(); System.err.println("paint"); } }); shell.setText(getClass().getName()); shell.setSize(640, 480); shell.open(); long lStartTime = System.currentTimeMillis(); long lEndTime = lStartTime + duration; try { while ((System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed()) { if (!display.readAndDispatch()) { // blocks on linux .. display.sleep(); Thread.sleep(10); } } } catch (Throwable throwable) { throwable.printStackTrace(); Assume.assumeNoException(throwable); } glcanvas.dispose(); }
/** Create contents of the dialog. */ private void createContents() { shell = new Shell(getParent()); shell.setSize(334, 100); shell.setText(getText()); shell.setLayout(new GridLayout(2, false)); combo = new Combo(shell, SWT.READ_ONLY); combo.setItems(options); combo.select(0); combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); Button btnNewButton = new Button(shell, SWT.NONE); btnNewButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { result = combo.getText(); shell.close(); } }); btnNewButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1)); btnNewButton.setText("Select"); Button btnNewButton_1 = new Button(shell, SWT.NONE); btnNewButton_1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { result = null; shell.close(); } }); btnNewButton_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); btnNewButton_1.setText("Cancel"); }
/** Subclasses may override to create a shell. */ protected void createShell() { if (shell == null || shell.isDisposed()) { shell = new Shell(display, SWT.SHELL_TRIM); shell.setLayout(new FillLayout()); shell.setText("TITLE"); } }
/* * (non-Javadoc) * * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ @Override protected void configureShell(final Shell shell) { super.configureShell(shell); if (this.title != null) { shell.setText(this.title); } }
private static void initShell() { askShell.setText("New Game of Life"); askShell.setLayout(new GridLayout(2, true)); askShell.addShellListener( new ShellListener() { @Override public void shellIconified(ShellEvent arg0) {} @Override public void shellDeiconified(ShellEvent arg0) {} @Override public void shellDeactivated(ShellEvent arg0) {} @Override public void shellClosed(ShellEvent arg0) { GameOfLife.CANCELLED = true; } @Override public void shellActivated(ShellEvent arg0) {} }); askShell.addListener( SWT.OK, new Listener() { @Override public void handleEvent(Event arg0) { askShell.dispose(); } }); }
@Override public void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText( String.format("%s v%s", SystemDefine.NAME, SystemDefine.MAJOR_VERSION)); // $NON-NLS-1$ newShell.setImage(GlobalImageUtils.getTadpoleIcon()); }