本文整理匯總了Java中org.eclipse.swt.widgets.Shell.isDisposed方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.isDisposed方法的具體用法?Java Shell.isDisposed怎麽用?Java Shell.isDisposed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell
的用法示例。
在下文中一共展示了Shell.isDisposed方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Test
public void test() {
JTouchBar jTouchBar = JTouchBarTestUtils.constructTouchBar();
assertNotNull(jTouchBar);
Display display = Display.getCurrent();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.open();
jTouchBar.show( shell );
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
break;
}
}
display.dispose();
}
示例2: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Starting point for the demonstration application.
*
* @param args ignored.
*/
public static void main( String[] args )
{
JFreeChart chart = createChart(createDataset());
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(600, 400);
shell.setLayout(new FillLayout());
shell.setText("Test for jfreechart running with SWT");
final ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
//frame.setDisplayToolTips(false);
frame.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例3: MainAvoCADoShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* create the main avoCADo shell and display it
* @param display
*/
public MainAvoCADoShell(Display display){
shell = new Shell(display);
setupShell(); // place components in the main avoCADo shell
shell.setText("avoCADo");
shell.setSize(800, 600); //TODO: set intial size to last known size
shell.setMinimumSize(640, 480);
Rectangle b = display.getBounds();
int xPos = Math.max(0, (b.width-800)/2);
int yPos = Math.max(0, (b.height-600)/2);
shell.setLocation(xPos, yPos);
shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
shell.open();
AvoGlobal.intializeNewAvoCADoProject(); // initialize app to starting model/view.
StartupSplashShell.closeSplash();
// handle events while the shell is not disposed
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例4: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Starting point for the demonstration application.
*
* @param args ignored.
*/
public static void main( String[] args )
{
JFreeChart chart = createChart(createDataset());
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");
final ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart,
true);
frame.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例5: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* 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();
}
}
示例6: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Starting point for the demonstration application.
*
* @param args ignored.
*/
public static void main(String[] args) {
final JFreeChart chart = createChart(createDataset());
final Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(600, 300);
shell.setLayout(new FillLayout());
shell.setText("Time series demo for jfreechart running with SWT");
ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
frame.setDisplayToolTips(true);
frame.setHorizontalAxisTrace(false);
frame.setVerticalAxisTrace(false);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例7: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
int formWidth = 750;
int formHeight = 280;
shell.setSize(formWidth, formHeight);
GridLayout gridLayout = new GridLayout(1, true);
gridLayout.makeColumnsEqualWidth = false;
shell.setLayout(gridLayout);
Composite composite = new Composite(shell, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
DirBrowseComposite dirBrowseComposite2 = new DirBrowseComposite(composite);
dirBrowseComposite2.pack();
DirBrowseComposite dirBrowseComposite3 = new DirBrowseComposite(shell);
dirBrowseComposite3.pack();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例8: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* <p>Creates a shell</p>
* <p>For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar</p>
* @see org.eclipse.swt.widgets.Shell
*/
public static Shell createShell(final Shell parent, final int styles) {
if (parent != null && parent.isDisposed())
return null;
return getRegisteredShell(new AEShell(parent, styles));
}
示例9: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void open() {
// Create the dialog window
Shell shell = new Shell(getParent(), getStyle());
shell.setText(getText());
createContents(shell);
shell.pack();
shell.open();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例10: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
// create a shell...
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("KTable examples");
// put a tab folder in it...
TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
// Item 1: a Text Table
TabItem item1 = new TabItem(tabFolder, SWT.NONE);
item1.setText("Text Table");
Composite comp1 = new Composite(tabFolder, SWT.NONE);
item1.setControl(comp1);
comp1.setLayout(new FillLayout());
// put a table in tabItem1...
KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
table.setRowSelectionMode(true);
//table.setMultiSelectionMode(true);
table.setModel(new KTableModelExample());
// display the shell...
shell.setSize(600, 600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
示例11: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
// create a shell...
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("KTable examples");
// put a tab folder in it...
TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
// Item 1: a Text Table
TabItem item1 = new TabItem(tabFolder, SWT.NONE);
item1.setText("Text Table");
Composite comp1 = new Composite(tabFolder, SWT.NONE);
item1.setControl(comp1);
comp1.setLayout(new FillLayout());
// put a table in tabItem1...
KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
table.setRowSelectionMode(true);
//table.setMultiSelectionMode(true);
table.setModel(new KTableModelExample());
// display the shell...
shell.setSize(600, 600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
示例12: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display, SWT.DIALOG_TRIM);
shell.setSize(800, 600);
new SimpleBrowserWindow(shell, "http://google.com", 0.8, 0.5, true, false);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例13: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
// create the widget's shell
Shell shell = new Shell();
shell.setLayout(new FillLayout());
shell.setSize(500, 500);
Display display = shell.getDisplay();
Composite parent = new Composite(shell, SWT.NONE);
parent.setLayout(new GridLayout());
StyledText styledText = new StyledText(parent, SWT.BORDER | SWT.V_SCROLL);
styledText.setLayoutData(new GridData(GridData.FILL_BOTH));
styledText.setText("a\nb\nc\nd");
StyledTextPatcher.setLineSpacingProvider(styledText, new ILineSpacingProvider() {
@Override
public Integer getLineSpacing(int lineIndex) {
if (lineIndex == 0) {
return 10;
} else if (lineIndex == 1) {
return 30;
}
return null;
}
});
shell.open();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
}
示例14: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
// create the widget's shell
Shell shell = new Shell();
shell.setLayout(new FillLayout());
shell.setSize(500, 500);
Display display = shell.getDisplay();
Composite parent = new Composite(shell, SWT.NONE);
parent.setLayout(new GridLayout(2, false));
ITextViewer textViewer = new TextViewer(parent, SWT.V_SCROLL | SWT.BORDER);
String delim = textViewer.getTextWidget().getLineDelimiter();
textViewer.setDocument(new Document(delim + " class A" + delim + "new A" + delim + "new A" + delim + "class B"
+ delim + "new B" + delim + "interface I" + delim + "class C implements I"));
StyledText styledText = textViewer.getTextWidget();
styledText.setLayoutData(new GridData(GridData.FILL_BOTH));
CodeLensProviderRegistry registry = CodeLensProviderRegistry.getInstance();
registry.register(CONTENT_TYPE_ID, new ClassReferencesCodeLensProvider());
registry.register(CONTENT_TYPE_ID, new ClassImplementationsCodeLensProvider());
CodeLensStrategy codelens = new CodeLensStrategy(new DefaultCodeLensContext(textViewer), false);
codelens.addTarget(CONTENT_TYPE_ID).reconcile(null);
styledText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
codelens.reconcile(null);
}
});
shell.open();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
}
示例15: launch
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Launch SwtAppleCommander with a given display.
* Primary motivation is getting S-Leak to work!
*/
public void launch(Display display) {
imageManager = new ImageManager(display);
SwtAppleCommander application = new SwtAppleCommander();
Shell shell = application.open(display);
shell.forceActive();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
UserPreferences.getInstance().save();
}