本文整理匯總了Java中org.eclipse.swt.widgets.Display.getDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.getDefault方法的具體用法?Java Display.getDefault怎麽用?Java Display.getDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Display
的用法示例。
在下文中一共展示了Display.getDefault方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
* Build and show the Windows, dispose it after is is not longer needed.
*
* @throws IllegalStateException If the parent shell is unusable (null or disposed).
*/
public void show() {
try {
this.display = Display.getDefault();
createShell();
this.shell.open();
while (!this.shell.isDisposed()) {
if (!this.display.readAndDispatch())
this.display.sleep();
}
} catch (Throwable t) {
if (this.parentShell != null && !this.parentShell.isDisposed()) {
StaticGuiSupport.processGuiError(t, "log", this.parentShell);
}
} finally {
doExit();
}
}
示例2: openChat
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
@Override
public void
openChat(
final ChatInstance chat )
{
final Display display = Display.getDefault();
if ( display.isDisposed()){
return;
}
display.asyncExec(
new Runnable()
{
@Override
public void
run()
{
if ( display.isDisposed()){
return;
}
BuddyPluginViewBetaChat.createChatWindow( BuddyPluginView.this, plugin, chat );
}
});
}
示例3: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
if (treeObject instanceof MobileComponentTreeObject) {
if (treeObject instanceof MobileApplicationComponentTreeObject) {
MobileApplicationComponentTreeObject mpcto = (MobileApplicationComponentTreeObject) treeObject;
ApplicationComponentEditor editor = mpcto.activeEditor(false);
editor.launchBuilder(forceInstall, forceClean);
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to open the mobile builder!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例4: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
if ((treeObject != null) && (treeObject instanceof TransactionTreeObject)) {
TransactionTreeObject transactionTreeObject = (TransactionTreeObject)treeObject;
Transaction transaction = transactionTreeObject.getObject();
transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
Connector connector = (Connector)transaction.getParent();
ProjectTreeObject projectTreeObject = transactionTreeObject.getProjectTreeObject();
ConnectorEditor connectorEditor = projectTreeObject.getConnectorEditor(connector);
if (connectorEditor != null) {
getActivePage().activate(connectorEditor);
connectorEditor.getDocument(transaction.getName(), isStubRequested());
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to execute the selected transaction!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例5: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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 treeObject = null;
Listener listener = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length-1 ; i>=0 ; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof ListenerTreeObject) {
ListenerTreeObject listenerTreeObject = (ListenerTreeObject)treeObject;
listener = (Listener)listenerTreeObject.getObject();
listener.setEnabled(true);
listenerTreeObject.setEnabled(true);
listenerTreeObject.hasBeenModified(true);
// Updating the tree
explorerView.refreshTreeObject(listenerTreeObject);
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to enable listener!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例6: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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 treeObject = null;
PageComponent component = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length-1 ; i>=0 ; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof MobilePageComponentTreeObject) {
MobilePageComponentTreeObject componentTreeObject = (MobilePageComponentTreeObject)treeObject;
component = (PageComponent)componentTreeObject.getObject();
component.setEnabled(false);
componentTreeObject.setEnabled(false);
componentTreeObject.hasBeenModified(true);
TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.refreshSelectedTreeObjects();
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to disable page!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例7: showPaletteToolTip
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
*
* Show tooltip
*
* @param toolTipMessage - text message to be display on tooltip
*/
private void showPaletteToolTip(String toolTipMessage) {
paletteToolTip = new PaletteToolTip(Display.getDefault());
java.awt.Point mouseLocation = MouseInfo.getPointerInfo().getLocation();
paletteToolTip.setLocation(mouseLocation.x + 11 , mouseLocation.y +7);
paletteToolTip.setToolTipText(toolTipMessage);
paletteToolTip.setVisible(true);
}
示例8: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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) {
ProjectTreeObject projectTreeObject = (ProjectTreeObject)explorerView.getFirstSelectedTreeObject();
if (projectTreeObject != null) {
StatisticsDialog stats = new StatisticsDialog(shell,
projectTreeObject.getName(), projectTreeObject.getObject().getComment(),
projectTreeObject.getObject().getVersion());
stats.open();
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to compute statistics!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例9: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof Project)) {
Project project = (Project)treeObject.getObject();
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/projects/" + project.getName());
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to open the selected project!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例10: show
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
* Build and show the Windows, dispose it after is is not longer needed.
* @param parentShell The parent windows' Shell.
* @param classLoader The system MugglClassLoader.
* @param classFile The classFile the initial Method belongs to.
* @param method The initial Method.
*/
public void show(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
try {
this.parentShell = parentShell;
this.display = Display.getDefault();
if (createShell(parentShell, classLoader, classFile, method))
this.shell.open();
// Now make the parent shell invisible.
parentShell.setVisible(false);
// Keep the window alive.
while (!this.shell.isDisposed()) {
if (!this.display.readAndDispatch())
this.display.sleep();
}
} catch (Throwable t) {
StaticGuiSupport.processGuiError(t, "step by step execution", parentShell);
} finally {
// Make the parent shell visible.
if (!parentShell.isDisposed())
parentShell.setVisible(true);
// Make sure execution is aborted. Otherwise the Thread would not be stopped and the memory released after this window is closed.
if (this.executionComposite != null) this.executionComposite.abortExecution();
doExit();
}
}
示例11: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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) {
DesignDocumentTreeObject ddto = (DesignDocumentTreeObject)explorerView.getFirstSelectedTreeObject();
DesignDocumentViewTreeObject ddvto = ddto.addNewView();
if (ddto.hasChanged()) {
TreeParent treeParent = ddto.getParent();
if (treeParent instanceof FolderTreeObject)
treeParent = treeParent.getParent();
explorerView.objectChanged(new CompositeEvent(treeParent.getObject(),ddvto.getPath()));
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new view!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例12: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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 treeObject = null;
RouteActionComponent component = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length-1 ; i>=0 ; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof MobileRouteActionComponentTreeObject) {
MobileRouteActionComponentTreeObject componentTreeObject = (MobileRouteActionComponentTreeObject)treeObject;
component = (RouteActionComponent)componentTreeObject.getObject();
component.setEnabled(false);
componentTreeObject.setEnabled(false);
componentTreeObject.hasBeenModified(true);
TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.refreshSelectedTreeObjects();
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to disable action!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例13: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
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 treeObject = null;
RouteComponent component = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length-1 ; i>=0 ; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof MobileRouteComponentTreeObject) {
MobileRouteComponentTreeObject componentTreeObject = (MobileRouteComponentTreeObject)treeObject;
component = (RouteComponent)componentTreeObject.getObject();
component.setEnabled(false);
componentTreeObject.setEnabled(false);
componentTreeObject.hasBeenModified(true);
TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.refreshSelectedTreeObjects();
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to disable route!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例14: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof MobileApplication)) {
MobileApplication mobileApplication = (MobileApplication) databaseObject;
// Test plateform
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/project.html#"
+ mobileApplication.getProject() + "?launch=webapp");
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to launch the mobile device selected project!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例15: run
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
@Override
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 treeObject = (DatabaseObjectTreeObject) explorerView.getFirstSelectedTreeObject();
DatabaseObject databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof IfXpathExistsThenElseStatement)) {
IfXpathExistsThenElseStatement ifThenElseStatement = (IfXpathExistsThenElseStatement) databaseObject;
// IfXpathExistsThenElse statement
if (ifThenElseStatement.hasThenElseStatements()) {
DatabaseObjectTreeObject parentTreeObject = treeObject.getOwnerDatabaseObjectTreeObject();
if (parentTreeObject != null) {
// New IfXpathExistsStatement statement
IfXpathExistsStatement ifStatement = new IfXpathExistsStatement();
ifStatement.bNew = true;
ifStatement.hasChanged = true;
// Add new If statement to parent
StatementWithExpressions parentDbo = (StatementWithExpressions) ifThenElseStatement.getParent();
parentDbo.addStatementAfter(ifStatement, ifThenElseStatement);
for (Statement statement: ifThenElseStatement.getThenStatement().getStatements()) {
ifStatement.addStatement(statement);
}
// Set properties
ifStatement.setCondition(ifThenElseStatement.getCondition());
ifStatement.setComment(ifThenElseStatement.getComment());
ifStatement.setEnabled(ifThenElseStatement.isEnabled());
ifStatement.setVersion(ifThenElseStatement.getVersion());
String name = ifThenElseStatement.getName();
// Delete IfThenElse statement
ifThenElseStatement.delete();
ifStatement.setName(name);
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(parentTreeObject.findTreeObjectByUserObject(ifStatement));
}
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change statement to If statement!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}