当前位置: 首页>>代码示例>>Java>>正文


Java SWT.PRIMARY_MODAL属性代码示例

本文整理汇总了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 ();
    }

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:25,代码来源:ShowDetailDialog.java

示例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();
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:23,代码来源:AboutAvoCADoGPLShell.java

示例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");
	}
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:10,代码来源:ChoicesDialog.java

示例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;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:10,代码来源:ShellFactory.java

示例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();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:71,代码来源:SequenceImportFromXsdAction.java

示例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();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:71,代码来源:SequenceImportFromXmlAction.java


注:本文中的org.eclipse.swt.SWT.PRIMARY_MODAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。