本文整理匯總了Java中org.eclipse.swt.widgets.Shell.open方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.open方法的具體用法?Java Shell.open怎麽用?Java Shell.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell
的用法示例。
在下文中一共展示了Shell.open方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
}
示例2: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void open() {
final Shell shell = new Shell(getParent(), getStyle());
shell.setText("Find/replace");
createContents(shell);
shell.pack();
shell.open();
Listener researcherListener = new Listener() {
public void handleEvent(Event event) {
if (resultsIterator != null)
resultsIterator = null;
}
};
text.addListener(SWT.Modify, researcherListener);
Display display = getParent().getDisplay();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
text.removeListener(SWT.Modify, researcherListener);
clearSearchResults();
}
示例3: 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();
}
}
示例4: StartupSplashShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* create the startup splash shell and display it
* @param display
*/
public StartupSplashShell(Display display){
shell = new Shell(display, SWT.NO_TRIM);
setupShell(); // place components in the main avoCADo shell
shell.setText("avoCADo");
shell.setBackgroundImage(ImageUtils.getIcon("./avoCADo-Splash.jpg", 360, 298));
shell.setSize(360, 298); //TODO: set intial size to last known size
Rectangle b = display.getBounds();
int xPos = Math.max(0, (b.width-360)/2);
int yPos = Math.max(0, (b.height-298)/2);
shell.setLocation(xPos, yPos);
shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
shell.open();
// handle events while the shell is not disposed
//while (!shell.isDisposed()) {
// if (!display.readAndDispatch())
// display.sleep();
//}
}
示例5: 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();
}
}
示例6: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.viewer = interfaceService.createModelViewer();
Shell shell = new Shell(display);
shell.setText("Point Model");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例7: createShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {
this.viewer = new ScannableViewer();
Shell shell = new Shell(display);
shell.setText("Monitors");
shell.setLayout(new GridLayout(1, false));
viewer.createPartControl(shell);
shell.pack();
shell.setSize(500, 500);
shell.open();
return shell;
}
示例8: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Setup the Disk window and display (open) it.
*/
public void open() {
shell = new Shell(parentShell, SWT.SHELL_TRIM);
shell.setLayout(new FillLayout());
shell.setImage(imageManager.get(ImageManager.ICON_DISK));
setStandardWindowTitle();
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
dispose(event);
}
});
CTabFolder tabFolder = new CTabFolder(shell, SWT.BOTTOM);
new DiskExplorerTab(tabFolder, disks, imageManager, this);
diskMapTabs = new DiskMapTab[disks.length];
for (int i=0; i<disks.length; i++) {
if (disks[i].supportsDiskMap()) {
diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
}
}
diskInfoTab = new DiskInfoTab(tabFolder, disks);
tabFolder.setSelection(tabFolder.getItems()[0]);
shell.open();
}
示例9: 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();
}
}
示例10: openShell
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void openShell(String format, int weight, int height, Function<Shell, Control> function) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(weight, height);
shell.setLayout(new FillLayout());
function.apply(shell);
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
示例11: PmTrans
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
private PmTrans(GlobalKeyListener gkl) {
// Initialize the interface
d = new Display();
shell = new Shell(d);
menuManager = new MenuManager(shell, this);
barManager = new BarManager(shell, this);
// Global keys
this.gKL = gkl;
initState();
initGui();
startAutoSave();
shell.open();
while (!shell.isDisposed())
if (!d.readAndDispatch())
d.sleep();
if (player != null) {
player.close();
player = null;
}
GlobalScreen.unregisterNativeHook();
saveState();
try {
Config.getInstance().save();
} catch (IOException e) {
// ignore
}
}
示例12: 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();
}
示例13: 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();
}
示例14: main
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(1200, 500);
shell.setLayout(new GridLayout());
shell.setLocation(100, 150);
Figure root = new Figure();
root.setFont(shell.getFont());
// XYLayout layout = new XYLayout();
// root.setLayoutManager(layout);
org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
layout.horizontalSpacing = 100;
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
createDiagram(root);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例15: 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();
}
}
}