Java Code Examples for org.eclipse.swt.widgets.Shell#setText()

The following examples show how to use org.eclipse.swt.widgets.Shell#setText() . 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: GraphDemo.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public static void main(final String[] args) {
	final Shell shell = new Shell();
	shell.setSize(800, 500);
    shell.open();

	final LightweightSystem lws = new LightweightSystem(shell);
	final XYGraphTest2 testFigure = new XYGraphTest2();
	lws.setContents(testFigure);

    shell.setText("XY Graph Test");
    final Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
           display.sleep();
       }
    }
    //System.out.println(Calendar.getInstance().getTime());
}
 
Example 2
Source File: SWTMultipleAxisDemo1.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args)
{
    final JFreeChart chart = createChart();
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 300);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    frame.setDisplayToolTips(false);
    frame.setHorizontalAxisTrace(true);
    frame.setVerticalAxisTrace(true);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
Example 3
Source File: CompositeTableSnippet1.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setText("CompositeTable Snippet 1 -- Display first/last name");
    shell.setLayout(new FillLayout());

    CompositeTable table = new CompositeTable(shell, SWT.NULL);
    new Header(table, SWT.NULL); // Just drop the Header and Row in that order...
    new Row(table, SWT.NULL);
    table.setRunTime(true);
    table.setNumRowsInCollection(swtCommitters.length);
    
    // Note the JFace-like virtual table API
    table.addRowContentProvider((sender,currentObjectOffset,rowControl) -> {
			Row row = (Row) rowControl;
			row.firstName.setText(swtCommitters[currentObjectOffset].first);
			row.lastName.setText(swtCommitters[currentObjectOffset].last);
    });
    
    shell.setSize(500, 150);
    shell.open ();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
}
 
Example 4
Source File: KettleFileRepositoryDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public KettleFileRepositoryDialog( Shell parent, int style, RepositoryMeta repositoryMeta,
  RepositoriesMeta repositoriesMeta ) {
  this.display = parent.getDisplay();
  this.props = PropsUI.getInstance();
  this.input = (KettleFileRepositoryMeta) repositoryMeta;
  this.masterRepositoriesMeta = repositoriesMeta.clone();
  this.masterRepositoryName = repositoryMeta.getName();

  // this.repositories = repositoriesMeta;
  shell = new Shell( parent, style | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
  shell.setText( BaseMessages.getString( PKG, "KettleFileRepositoryDialog.Dialog.Main.Title" ) );
}
 
Example 5
Source File: TLAPMErrorDialog.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * This method was mostly copied from {@link MessageDialog}. Apparently
 * this is the way to set the title for a dialog.
 */
protected void configureShell(Shell shell)
{
    super.configureShell(shell);
    if (title != null)
    {
        shell.setText(title);
    }
}
 
Example 6
Source File: TMXValidatorDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText(Messages.getString("dialog.TMXValidatorDialog.title")); //$NON-NLS-1$
	imagePath = PluginUtil.getAbsolutePath(PluginConstants.LOGO_TMXVALIDATOR_PATH);
	newShell.setImage(new Image(Display.getDefault(), imagePath));
}
 
Example 7
Source File: Martif2TBXConverterDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText(Messages.getString("dialog.Martif2TBXConverterDialog.title"));
	imagePath = PluginUtil.getAbsolutePath(PluginConstants.LOGO_MARTIF2TBX_PATH);
	newShell.setImage(new Image(Display.getDefault(), imagePath));
}
 
Example 8
Source File: CarouselSnippet.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @param args
 */
public static void main(final String[] args) {
	final Display display = new Display();
	shell = new Shell(display);
	shell.setText("Carousel Snippet");
	shell.setLayout(new FillLayout());
	shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE));

	final Carousel carousel = new Carousel(shell, SWT.NONE);
	carousel.addImage(loadImage("images/first.png"));
	carousel.addImage(loadImage("images/second.jpg"));
	carousel.addImage(loadImage("images/third.png"));

	final Listener listener = event -> {
		System.out.println("Click on " + carousel.getSelection());
	};
	carousel.addListener(SWT.Selection, listener);

	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}

	display.dispose();

}
 
Example 9
Source File: PluginHelpDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	if (title == null) {
		newShell.setText(Messages.getString("dialog.PluginHelpDialog.title"));
	} else {
		newShell.setText(title);
	}
}
 
Example 10
Source File: RouteResourceSelectionDialog.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
protected void configureShell(Shell shell) {
    super.configureShell(shell);
    shell.setText("Select a Route Resource");
}
 
Example 11
Source File: Tester.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
		Display display = new Display ();
		Shell shell = new Shell (display);
		shell.setText("Calendar Combo Tester");
		shell.setSize(200, 400);
		
		// allow other date formats than default
		class Settings extends DefaultSettings {
			
/*			public Locale getLocale() {
				//return Locale.GERMAN;
			}
*/
			public boolean keyboardNavigatesCalendar() {
				return false;
			}

			
		}
		
		shell.setLayout(new FillLayout());
		Composite inner = new Composite(shell, SWT.None);
		GridLayout gl = new GridLayout(1, true);		
		inner.setLayout(gl);

		Label foo = new Label(inner, SWT.NONE);
		foo.setText("Test");
		final CalendarCombo cc = new CalendarCombo(inner, SWT.NONE, new Settings(), null);
		cc.addCalendarListener(new ICalendarListener() {

			public void dateChanged(Calendar date) {
				if (date == null) {
					System.err.println("Date changed to null");
				}
				else {
					System.err.println("Date changed " + date.getTime());
				}
			}

			public void dateRangeChanged(Calendar start, Calendar end) {
			}

			public void popupClosed() {
			}
			
		});

		final CalendarCombo cc2 = new CalendarCombo(inner, SWT.READ_ONLY, new Settings(), null);

		Button b = new Button(inner, SWT.PUSH);
		b.setText("Check date");
		b.addListener(SWT.Selection, new Listener() {

			public void handleEvent(Event event) {
				System.err.println(cc.getDate().getTime());
			}
			
		});
	
		shell.open();

		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}
 
Example 12
Source File: LicenseAgreementDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText(Messages.getString("license.LicenseAgreementDialog.title"));
}
 
Example 13
Source File: LongFormDialog.java    From tlaplus with MIT License 4 votes vote down vote up
@Override
protected void configureShell(final Shell newShell) {
    super.configureShell(newShell);
    newShell.setText(m_title);
}
 
Example 14
Source File: LicenseAgreementDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText(Messages.getString("license.LicenseAgreementDialog.title"));
}
 
Example 15
Source File: BonitaPreferenceDialog.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configureShell(final Shell newShell) {
    super.configureShell(newShell);
    newShell.setText(Messages.BonitaPreferenceDialog_preferences);
}
 
Example 16
Source File: CFGTests.java    From JAADAS with GNU General Public License v3.0 4 votes vote down vote up
public void run(IAction action){
	Shell shell = new Shell();
	shell.open();
	shell.setText("CFG Test");
	
	LightweightSystem lws = new LightweightSystem(shell);
	Panel p = new Panel();
	p.setBounds(new Rectangle(0,0,-1,-1));
	lws.setContents(p);
	HashMap nodeMap = new HashMap();
	DirectedGraph dg = makeSimpleGraph();
	Iterator nIt = dg.nodes.iterator();
	while (nIt.hasNext()){
		Node nextNode = (Node)nIt.next();
		IFigure node = new RectangleFigure();
		IFigure label = new Label((String)nextNode.data);
		label.setSize(nextNode.width, 36);
		node.add(label);
		int len = ((String)nextNode.data).length() * 5;
		node.setLocation(new Point(nextNode.x, nextNode.y));
		node.setSize(nextNode.width, 36);
		System.out.println("bounds: "+node.getBounds());
		p.add(node);
		nodeMap.put(nextNode, node);
	}
	Iterator eIt = dg.edges.iterator();
	while (eIt.hasNext()){
		Edge nextEdge = (Edge)eIt.next();
		PolylineConnection edge = new PolylineConnection();
		ChopboxAnchor ca1 = new ChopboxAnchor((IFigure)nodeMap.get(nextEdge.source));
		ChopboxAnchor ca2 = new ChopboxAnchor((IFigure)nodeMap.get(nextEdge.target));
		
		edge.setSourceAnchor(ca1);
		edge.setTargetAnchor(ca2);
		edge.setTargetDecoration(new PolygonDecoration());
		p.add(edge);
	}
	lws.setContents(p);
	Display display = Display.getDefault();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ())
			display.sleep ();
	}
}
 
Example 17
Source File: BuilderConfigDialog.java    From texlipse with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Set dialog title when the window is created.
 */
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    newShell.setText(TexlipsePlugin.getResourceString("preferenceBuilderDialogTitle"));
}
 
Example 18
Source File: RewriteSchemaDialog.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    newShell.setText("Import WSDL Schemas");
}
 
Example 19
Source File: OptInDialog.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
@Override
protected void configureShell(Shell shell) {
  super.configureShell(shell);
  shell.setText(Messages.getString("OPT_IN_DIALOG_TITLE"));
}
 
Example 20
Source File: ElementSourceDialog.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void configureShell(Shell shell) {
	super.configureShell(shell);
	shell.setText("Select Material");
}