本文整理匯總了Java中org.eclipse.swt.widgets.Shell.isDisposed方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.isDisposed方法的具體用法?Java Shell.isDisposed怎麽用?Java Shell.isDisposed使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell的用法示例。
在下文中一共展示了Shell.isDisposed方法的20個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: test
點讚 4
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();
}
開發者ID:Thizzer,項目名稱:JTouchBar,代碼行數:24,
示例2: main
點讚 3
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();
}
}
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,
示例3: MainAvoCADoShell
點讚 3
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();
}
}
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:30,
示例4: main
點讚 3
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();
}
}
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,
示例5: main
點讚 3
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();
}
}
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:24,
示例6: main
點讚 3
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();
}
}
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,
示例7: main
點讚 3
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();
}
}
開發者ID:sergueik,項目名稱:SWET,代碼行數:26,
示例8: createShell
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
*
Creates a shell
*
For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar
* @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));
}
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:12,
示例9: open
點讚 2
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();
}
}
}
開發者ID:juanerasmoe,項目名稱:pmTrans,代碼行數:15,
示例10: main
點讚 2
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();
}
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,
示例11: main
點讚 2
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();
}
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,
示例12: main
點讚 2
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();
}
}
}
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:16,
示例13: main
點讚 2
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();
}
開發者ID:angelozerr,項目名稱:codelens-eclipse,代碼行數:34,
示例14: main
點讚 2
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();
}
開發者ID:angelozerr,項目名稱:codelens-eclipse,代碼行數:38,
示例15: launch
點讚 2
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();
}
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:17,
示例16: main
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(365, 280);
shell.setLayout(new GridLayout());
Figure root = new Figure();
root.setFont(shell.getFont());
XYLayout layout = new XYLayout();
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
VarParser parser = new VarParser("src/pt/iscte/pandionj/tests/Test.java");
parser.run();
System.out.println(parser.toText());
createDiagram(root, parser);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:33,
示例17: open
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Opens this window, creating it first if it has not yet been created.
*
* This method is reimplemented for special configuration of PopupDialogs.
* It never blocks on open, immediately returning OK
if the
* open is successful, or CANCEL
if it is not. It provides
* framework hooks that allow subclasses to set the focus and tab order, and
* avoids the use of shell.open()
in cases where the focus
* should not be given to the shell initially.
*
* @return the return code
*
* @see org.eclipse.jface.window.Window#open()
*/
public int open() {
Shell shell = getShell();
if (shell == null || shell.isDisposed()) {
shell = null;
// create the window
create();
shell = getShell();
}
// provide a hook for adjusting the bounds. This is only
// necessary when there is content driven sizing that must be
// adjusted each time the dialog is opened.
adjustBounds();
// limit the shell size to the display size
constrainShellSize();
// set up the tab order for the dialog
setTabOrder((Composite) getContents());
// initialize flags for listening to deactivate
listenToDeactivate = false;
listenToParentDeactivate = false;
// open the window
if (takeFocusOnOpen) {
shell.open();
getFocusControl().setFocus();
} else {
shell.setVisible(true);
}
return OK;
}
開發者ID:sergueik,項目名稱:SWET,代碼行數:51,
示例18: actionPerformed
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent arg0) {
//Test URL string for window
//String url = "https://maps.googleapis.com/maps/api/staticmap?&size=500x500&markers=size:small%7ccolor:green%7cHammond+Gavit+High+School,IN&markers=size:small%7ccolor:blue%7clabel:S%7c41.5762616,-87.4875017%7c41.5545436,-87.5048099%7c41.5481653,-87.45544319999999%7c41.5864118,-87.4398167%7c41.60522599999999,-87.509568%7c41.6283089,-87.491937%7c41.6179983,-87.5235321%7c41.5327164,-87.436207%7c41.59385,-87.4078595%7c41.6403209,-87.4853127%7c41.5476375,-87.4092115%7c41.5977957,-87.39227699999999%7c41.6782559,-87.50683839999999%7c&maptype=roadmap";
//Readme instructions for user(LEGEND)
String message="Welcome to the map view!\n The host School"
+ " is marked with a green label"
+ " and \n the other schools in the sectional are marked "
+ " with blue labels on the map. ";
JOptionPane.showMessageDialog(null, message);
//build new MapBuilder Obj
MapBuilder map = new MapBuilder(currentSect.getHostSchool(),currentSect.getSchools());
map.BuildURL();
String url = map.getFinalURL();
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(552, 575);
new MapGUI(shell, SWT.NONE, url);
// the layout manager handle the layout
// of the widgets in the container
shell.setLayout(new FillLayout());
//add some widgets to the Shell
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
開發者ID:Celethor,項目名稱:CS360proj1,代碼行數:42,
示例19: ShellSlider
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Slide In
*
* @param shell
* @param direction
* @param endBounds
*/
public ShellSlider(final Shell shell, int direction, final Rectangle endBounds) {
this.shell = shell;
this.endBounds = endBounds;
this.slideIn = true;
this.direction = direction;
if (shell == null || shell.isDisposed())
return;
Display display = shell.getDisplay();
display.syncExec(new Runnable() {
@Override
public void run() {
if (shell.isDisposed())
return;
switch (ShellSlider.this.direction) {
case SWT.UP:
default:
shell.setLocation(endBounds.x, endBounds.y);
Rectangle displayBounds = null;
try {
boolean ok = false;
Monitor[] monitors = shell.getDisplay().getMonitors();
for (int i = 0; i < monitors.length; i++) {
Monitor monitor = monitors[i];
displayBounds = monitor.getBounds();
if (displayBounds.contains(endBounds.x, endBounds.y)) {
ok = true;
break;
}
}
if (!ok) {
displayBounds = shell.getMonitor().getBounds();
}
} catch (Throwable t) {
displayBounds = shell.getDisplay().getBounds();
}
shellBounds = new Rectangle(endBounds.x, displayBounds.y
+ displayBounds.height, endBounds.width, 0);
break;
}
shell.setBounds(shellBounds);
shell.setVisible(true);
if (DEBUG)
System.out.println("Slide In: " + shell.getText());
}
});
}
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:59,
示例20: launchXMLTextContainerWindow
點讚 2
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Launches the component property editor window for Unknown components. It is used to display XML content of Unknown
* components on property window.
*
* @return XML content of component.
*/
public String launchXMLTextContainerWindow() {
try{
String xmlText = this.xmlText;
Shell shell = new Shell(Display.getDefault().getActiveShell(), SWT.WRAP | SWT.MAX | SWT.APPLICATION_MODAL);
shell.setLayout(new GridLayout(1, false));
shell.setText("XML Content");
shell.setSize(439, 432);
text = new Text(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
text.setEditable(false);
text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 250, 250, 250));
if (this.xmlText != null) {
xmlText = xmlText.substring(xmlText.indexOf('\n') + 1);
xmlText = xmlText.substring(xmlText.indexOf('\n') + 1, xmlText.lastIndexOf('\n') - 13);
text.setText(xmlText);
} else
text.setText(Messages.EMPTY_XML_CONTENT);
GridData gd_text = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
gd_text.widthHint = 360;
gd_text.heightHint = 360;
text.setLayoutData(gd_text);
Monitor primary = shell.getDisplay().getPrimaryMonitor();
Rectangle bounds = primary.getBounds();
Rectangle rect = shell.getBounds();
int x = bounds.x + (bounds.width - rect.width) / 2;
int y = bounds.y + (bounds.height - rect.height) / 2;
shell.setLocation(x, y);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
}catch(Exception e)
{
LOGGER.error("Error occurred while creating XML text container widget", e);
}
return getXmlText();
}
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:52,
注:本文中的org.eclipse.swt.widgets.Shell.isDisposed方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。