本文整理汇总了Java中org.eclipse.swt.SWT.PRIMARY_MODAL属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.PRIMARY_MODAL属性的具体用法?Java SWT.PRIMARY_MODAL怎么用?Java SWT.PRIMARY_MODAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.PRIMARY_MODAL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openWithWaitShell
protected void openWithWaitShell ( final Shell parentShell, final String detailViewId, final Map<String, String> parameters )
{
final Shell waitShell = new Shell ( parentShell, SWT.PRIMARY_MODAL | SWT.BORDER );
waitShell.setLayout ( new FillLayout () );
final Label label = new Label ( waitShell, SWT.NONE );
label.setText ( "Opening view…" );
waitShell.pack ();
waitShell.open ();
// make sure the text is visible
waitShell.getDisplay ().update ();
try
{
open ( parentShell, detailViewId, parameters );
}
finally
{
// close the wait shell
waitShell.close ();
}
}
示例2: AboutAvoCADoGPLShell
/**
* create the startup splash shell and display it
* @param display
*/
public AboutAvoCADoGPLShell(Display display){
shell = new Shell(display, SWT.PRIMARY_MODAL);
setupShell(); // place components in the avoCADo license shell
shell.setText("avoCADo GPLv2");
shell.setSize(583, 350); //TODO: set initial size to last known size
Rectangle b = display.getBounds();
int xPos = Math.max(0, (b.width-583)/2);
int yPos = Math.max(0, (b.height-350)/2);
shell.setLocation(xPos, yPos);
shell.open();
// handle events while the shell is not disposed
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
示例3: checkStyle
private void checkStyle(int style) {
if ((style & ~(SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL
| SWT.MODELESS)) != 0) {
throw new SWTException("Unsupported style");
}
if (Integer.bitCount(style) > 1) {
throw new SWTException(
"Unsupports only one of APPLICATION_MODAL, PRIMARY_MODAL, SYSTEM_MODAL or SWT.MODELESS");
}
}
示例4: fixupStyle
static private int fixupStyle(int style) {
if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL)) != 0
&& Utils.anyShellHaveStyle(SWT.ON_TOP | SWT.TITLE)) {
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null && uiFunctions.getMainShell() != null) {
style |= SWT.ON_TOP;
}
}
return style;
}
示例5: run
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject)explorerView.getFirstSelectedTreeObject();
DatabaseObject databaseObject = databaseObjectTreeObject.getObject();
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) ((databaseObject instanceof Sequence) ? databaseObjectTreeObject:databaseObjectTreeObject.getParentDatabaseObjectTreeObject());
Sequence sequence = (databaseObject instanceof Sequence) ? (Sequence)databaseObject:((StepWithExpressions)databaseObject).getSequence();
FileDialog fileDialog = new FileDialog(shell, SWT.PRIMARY_MODAL | SWT.SAVE);
fileDialog.setText("Import schema file");
fileDialog.setFilterExtensions(new String[]{"*.xsd"});
fileDialog.setFilterNames(new String[]{"Schema files"});
fileDialog.setFilterPath(Engine.PROJECTS_PATH);
String filePath = fileDialog.open();
if (filePath != null) {
filePath = filePath.replaceAll("\\\\", "/");
XmlSchemaCollection collection = new XmlSchemaCollection();
collection.setBaseUri(filePath);
XmlSchema xmlSchema = SchemaUtils.loadSchema(new File(filePath), collection);
SchemaMeta.setCollection(xmlSchema, collection);
SchemaObjectsDialog dlg = new SchemaObjectsDialog(shell, sequence, xmlSchema);
if (dlg.open() == Window.OK) {
if (dlg.result instanceof Throwable) {
throw (Throwable)dlg.result;
}
else {
Step step = (Step)dlg.result;
if (step != null) {
if (databaseObject instanceof Sequence) {
sequence.addStep(step);
sequence.hasChanged = true;
}
else {
StepWithExpressions swe = (StepWithExpressions)databaseObject;
swe.addStep(step);
swe.hasChanged = true;
}
sequence.hasChanged = true;
// Reload sequence in tree without updating its schema for faster reload
ConvertigoPlugin.logDebug("Reload sequence: start");
explorerView.reloadTreeObject(sequenceTreeObject);
ConvertigoPlugin.logDebug("Reload sequence: end");
// Select target dbo in tree
explorerView.objectSelected(new CompositeEvent(databaseObject));
}
}
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to import step from xsd!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例6: run
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject)explorerView.getFirstSelectedTreeObject();
DatabaseObject databaseObject = databaseObjectTreeObject.getObject();
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) ((databaseObject instanceof Sequence) ? databaseObjectTreeObject:databaseObjectTreeObject.getParentDatabaseObjectTreeObject());
Sequence sequence = (databaseObject instanceof Sequence) ? (Sequence)databaseObject:((StepWithExpressions)databaseObject).getSequence();
// Open a file dialog to search a XML file
FileDialog fileDialog = new FileDialog(shell, SWT.PRIMARY_MODAL | SWT.SAVE);
fileDialog.setText("Import XML file");
fileDialog.setFilterExtensions(new String[]{"*.xml"});
fileDialog.setFilterNames(new String[]{"XML"});
fileDialog.setFilterPath(Engine.PROJECTS_PATH);
String filePath = fileDialog.open();
if (filePath != null) {
// Get XML content from the file
File xmlFile = new File(filePath);
Charset charset = XMLUtils.getEncoding(xmlFile);
String xmlContent = FileUtils.readFileToString(xmlFile, charset.name());
// Open and add XML content to the dialog area
XmlStructureDialog dlg = new XmlStructureDialog(shell, sequence, xmlContent);
if (dlg.open() == Window.OK) {
if (dlg.result instanceof Throwable) {
throw (Throwable)dlg.result;
}
else {
Step step = (Step)dlg.result;
if (step != null) {
if (databaseObject instanceof Sequence) {
sequence.addStep(step);
}
else {
StepWithExpressions swe = (StepWithExpressions)databaseObject;
swe.addStep(step);
}
sequence.hasChanged = true;
// Reload sequence in tree without updating its schema for faster reload
ConvertigoPlugin.logDebug("Reload sequence: start");
explorerView.reloadTreeObject(sequenceTreeObject);
ConvertigoPlugin.logDebug("Reload sequence: end");
// Select target dbo in tree
explorerView.objectSelected(new CompositeEvent(databaseObject));
}
}
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to import step from xml!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}