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


Java BusyIndicator.showWhile方法代码示例

本文整理汇总了Java中org.eclipse.swt.custom.BusyIndicator.showWhile方法的典型用法代码示例。如果您正苦于以下问题:Java BusyIndicator.showWhile方法的具体用法?Java BusyIndicator.showWhile怎么用?Java BusyIndicator.showWhile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.custom.BusyIndicator的用法示例。


在下文中一共展示了BusyIndicator.showWhile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: endTableEdit

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
protected void endTableEdit(TableCursor tableCursor, ControlEditor editor,
        final CommitEditRunnable commitEditRunnable, TableItem row, int column, String newValue) throws Exception {

    if (commitEditRunnable == null) {
        return;
    }

    commitEditRunnable.setTableCursor(tableCursor);
    commitEditRunnable.setEditor(editor);
    commitEditRunnable.setRow(row);
    commitEditRunnable.setColumn(column);
    commitEditRunnable.setNewValue(newValue);

    BusyIndicator.showWhile(row.getDisplay(), commitEditRunnable);

    Exception error = commitEditRunnable.getError();
    if (error != null) {
        throw error;
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:21,代码来源:TableEdit.java

示例2: buttonPressed

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
protected void buttonPressed(int buttonId) {
	switch (buttonId) {
	case DETAILS_ID:
		BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
			public void run() {
				IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
				InstallationDialog dialog = new InstallationDialog(getShell(), workbenchWindow);
				dialog.setModalParent(CustomAboutDialog.this);
				dialog.open();
			}
		});
		break;
	default:
		super.buttonPressed(buttonId);
		break;
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:CustomAboutDialog.java

示例3: expandAll

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public static void expandAll(final TreeViewer treeViewer, final String context) {
  	AvroSchemaLogger.logMsg(context + " BEGIN", false);
  	BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {				
	@Override
	public void run() {
		long time1 = System.currentTimeMillis();				
		try {		
			treeViewer.getTree().setRedraw(false);
			treeViewer.expandAll();
		} finally {
			treeViewer.getTree().setRedraw(true);
			long time2 = System.currentTimeMillis();
			long delay = time2 - time1;
			AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
		}
	}
});
  }
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:19,代码来源:UIUtils.java

示例4: run

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public static void run(final TreeViewer treeViewer, final Runnable runnable, final String context) {
  	AvroSchemaLogger.logMsg(context + " BEGIN", false);
  	BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {				
	@Override
	public void run() {
		long time1 = System.currentTimeMillis();				
		try {					
			treeViewer.getTree().setRedraw(false);
			runnable.run();
		} finally {
			treeViewer.getTree().setRedraw(true);
			long time2 = System.currentTimeMillis();
			long delay = time2 - time1;
			AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
		}
	}
});
  }
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:19,代码来源:UIUtils.java

示例5: updateProjectSelector

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void updateProjectSelector() {
  final Credential credential = accountSelector.getSelectedCredential();
  if (credential == null) {
    projectSelector.setProjects(new ArrayList<GcpProject>());
    return;
  }

  BusyIndicator.showWhile(projectSelector.getDisplay(), new Runnable() {
    @Override
    public void run() {
      try {
        List<GcpProject> gcpProjects = projectRepository.getProjects(credential);
        projectSelector.setProjects(gcpProjects);
      } catch (ProjectRepositoryException e) {
        logger.log(Level.WARNING,
            "Could not retrieve GCP project information from server.", e); //$NON-NLS-1$
      }
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:21,代码来源:GcpLocalRunTab.java

示例6: getTreeConflict

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private SVNTreeConflict getTreeConflict(final IResource resource) {
	BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
		public void run() {
			ISVNClientAdapter client = null;
			try {
				client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
				ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
				for (int i = 0; i < statuses.length; i++) {
					if (statuses[i].hasTreeConflict()) {
						treeConflict = new SVNTreeConflict(statuses[i]);
						break;
					}
				}
			} catch (Exception e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
			finally {
				SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
			}
		}			
	});
	return treeConflict;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:ResolveActionWithChoices.java

示例7: openLinkUnderMouseCursor

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
/**
 * Handles the user clicking (or typing control-enter on) an existing link
 * in the editor.
 */
private void openLinkUnderMouseCursor() {
    log.debug("opening link under mouse cursor"); //$NON-NLS-1$

    BusyIndicator.showWhile(getDisplay(), new Runnable() {
        @Override
        public void run() {
            // More immediate feedback.
            hideToolTip();

            final Object linkObject = evaluate("return editor.getLinkUnderMouseCursor() || '';"); //$NON-NLS-1$
            if ((linkObject instanceof String) && linkObject.toString().length() > 0) {
                openLink((String) linkObject);
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:HTMLEditor.java

示例8: okPressed

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
protected void okPressed() {

	net.tourbook.ui.UI.disableAllControls(_inputContainer);

	BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
		@Override
		public void run() {
			try {
				doPrint();
			} catch (final Exception e) {
				e.printStackTrace();
				displayErrorMessage(e);
			}
		}
	});

	super.okPressed();
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:20,代码来源:DialogPrintTour.java

示例9: checkStateChanged

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public void checkStateChanged(final CheckStateChangedEvent event)
    {
        BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {

            public void run()
            {
                if(event.getCheckable().equals(fTreeViewer))
                    treeItemChecked(event.getElement(), event.getChecked());
                else
                    listItemChecked(event.getElement(), event.getChecked(), true);
                notifyCheckStateChangeListeners(event);
            }

        }
);
    }
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:17,代码来源:CheckboxTreeAndListGroup.java

示例10: create

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public void create() {

    BusyIndicator.showWhile(null, new Runnable() {
        @Override
        public void run() {
            access$superCreate();

            fViewer.setCheckedElements(
                    getInitialElementSelections().toArray());

            fViewer.expandToLevel(2);
            if (fExisting != null) {
                for (Iterator iter= fExisting.iterator(); iter.hasNext();) {
                    fViewer.reveal(iter.next());
                }
            }

            updateOKStatus();
        }
    });

}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:24,代码来源:MultipleFolderSelectionDialog.java

示例11: getSelectedTours

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public ArrayList<TourData> getSelectedTours() {

	// get selected tour id's

	final Set<Long> tourIds = getSelectedTourIDs();

	/*
	 * show busyindicator when multiple tours needs to be retrieved from the database
	 */
	final ArrayList<TourData> selectedTourData = new ArrayList<TourData>();

	if (tourIds.size() > 1) {
		BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
			@Override
			public void run() {
				getSelectedTourData(selectedTourData, tourIds);
			}
		});
	} else {
		getSelectedTourData(selectedTourData, tourIds);
	}

	return selectedTourData;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:TourBookView.java

示例12: configureWorkspaceSettings

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void configureWorkspaceSettings() {
	String preferenceNodeId = this.getPreferenceNodeId();
	IPreferencePage preferencePage = newPreferencePage();
	final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage);
	PreferenceManager manager = new PreferenceManager();
	manager.addToRoot(preferenceNode);
	final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager);
	BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
		@Override
		public void run() {
			dialog.create();
			dialog.setMessage(preferenceNode.getLabelText());
			dialog.open();
		}
	});
}
 
开发者ID:cincheo,项目名称:jsweet-eclipse-plugin,代码行数:17,代码来源:FieldEditorProjectPreferencePage.java

示例13: performFinish

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public boolean performFinish() {      
    projectsInstalled = true;
    final ExampleDescriptor[] selectedExamples = page.getSelectedExamples();
    BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
        
        @Override
        public void run() {
            try {
                // Install and check that at least one project was imported.
                ExamplesInstaller installer = new ExamplesInstaller(selectedExamples);
                projectsInstalled = !installer.installExamples().isEmpty();
            } catch (ExampleInstallationException eie) {
                projectsInstalled = false;
                EasyProducerDialog.showErrorDialog(eie.getMessage());
            }
        }
    });
    
    return projectsInstalled;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:22,代码来源:ExamplesWizard.java

示例14: validator

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
/**
 * 访问api以验证 Key是否可用。 ;
 */
private void validator() {
	final String googleKey = googleKeyText.getText();
	BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {

		public void run() {
			// TODO Auto-generated method stub
			if (googleKey != null && !googleKey.trim().equals("")) {
				GoogleAPI.setHttpReferrer("http://www.heartsome.net");
				GoogleAPI.setKey(googleKey);
				try {
					String result = Translate.DEFAULT.execute("test", GoogleTransUtils.processLanguage("en-US"),
							GoogleTransUtils.processLanguage("zh-CN"));
					if (result.equals("测试")) {
						state = true;
					}
				} catch (GoogleAPIException e) {
					state = false;
				}
			} else {
				state = false;
			}
		}
	});
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:28,代码来源:GooglePreferencePage.java

示例15: valueChanged

import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void valueChanged(final boolean on, boolean store) {
	setChecked(on);
	BusyIndicator.showWhile(fOutlineViewer.getControl().getDisplay(), new Runnable() {
		public void run() {
			if (on) {
				fOutlineViewer.setComparator(fComparator);
				fDropSupport.setFeedbackEnabled(false);
			} else {
				fOutlineViewer.setComparator(fSourcePositonComparator);
				fDropSupport.setFeedbackEnabled(true);
			}
		}
	});

	if (store)
		JavaPlugin.getDefault().getPreferenceStore().setValue("LexicalSortingAction.isChecked", on); //$NON-NLS-1$
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavaOutlinePage.java


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