本文整理汇总了Java中org.eclipse.jface.dialogs.ProgressMonitorDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressMonitorDialog.open方法的具体用法?Java ProgressMonitorDialog.open怎么用?Java ProgressMonitorDialog.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.dialogs.ProgressMonitorDialog
的用法示例。
在下文中一共展示了ProgressMonitorDialog.open方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: okPressed
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void okPressed() {
ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(getShell());
progressMonitorDialog.open();
progressMonitorDialog.getProgressMonitor().beginTask("connecting", IProgressMonitor.UNKNOWN);
Properties serverProperties = new Properties();
serverProperties.put(Context.PROVIDER_URL, serverName.getText());
serverProperties.put(LdapImportSource.LDAP_BASE, ldapBase.getText());
this.ldapImport.setProperties(serverProperties);
try {
this.ldapImport.connect();
this.isInitFinished = true;
progressMonitorDialog.close();
} catch (CorruptedSourceException e) {
progressMonitorDialog.close();
this.isInitFinished = false;
EMFStoreMessageDialog.showExceptionDialog("An exception occured", e);
}
this.isOkPressed = true;
close();
}
示例2: performFinish
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
* @return a boolean which indicates, if there are items selected or not.
*/
@Override
public boolean performFinish() {
ArrayList<ImportItemWrapper> wrappedOrgUnits = ((AcUserImportPageTwo) this.getPages()[1]).getCheckedItems();
if (wrappedOrgUnits.size() > 0) {
ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(getShell());
progressMonitorDialog.open();
progressMonitorDialog.getProgressMonitor().beginTask("Importing users", IProgressMonitor.UNKNOWN);
importController.importOrgUnits(wrappedOrgUnits);
progressMonitorDialog.close();
return true;
} else {
return false;
}
}
示例3: execute
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Execute
public void execute(
IEclipseContext context,
@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@Named(IServiceConstants.ACTIVE_PART) final MContribution contribution)
throws InvocationTargetException, InterruptedException {
final IEclipseContext pmContext = context.createChild();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
dialog.open();
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
pmContext.set(IProgressMonitor.class.getName(), monitor);
if (contribution != null) {
Object clientObject = contribution.getObject();
// ContextInjectionFactory.invoke(clientObject, Persist.class, //$NON-NLS-1$
// pmContext, null);
}
}
});
pmContext.dispose();
}
示例4: execute
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Execute
public void execute(
IEclipseContext context,
@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@Named(IServiceConstants.ACTIVE_PART) final MContribution contribution)
throws InvocationTargetException, InterruptedException {
final IEclipseContext pmContext = context.createChild();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
dialog.open();
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
pmContext.set(IProgressMonitor.class.getName(), monitor);
if (contribution != null) {
Object clientObject = contribution.getObject();
ContextInjectionFactory.invoke(clientObject, Persist.class,
pmContext, null);
}
}
});
pmContext.dispose();
}
示例5: importImageToWorkspace
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
* This method will try to import an image to the work space at the editor,
* and put it at the resources folder.
*
* @param resourceImageData
*/
public void importImageToWorkspace(File newFile) {
String fileName = newFile.getName();
InputStream is = null;
try {
is = new FileInputStream(newFile);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
selectedResource = null;
if (is == null)
return;
try {
IEditorPart activeEditor = getActiveEditor();
if (activeEditor != null) {
IEditorInput editorInput = activeEditor.getEditorInput();
if ((editorInput instanceof IFileEditorInput)) {
IFile editorFile = ((IFileEditorInput) editorInput)
.getFile();
IProject project = editorFile.getProject();
if (project != null) {
IFolder folder = project.getFolder("Resources");
if (!folder.exists())
folder.create(false, true, null);
IFile file = folder.getFile(fileName);
if (!file.exists()) {
file.create(is, false,
null);
ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(
null);
progressMonitorDialog.open();
project.refreshLocal(IResource.DEPTH_INFINITE,
progressMonitorDialog.getProgressMonitor());
progressMonitorDialog.close();
// Refreshing the tree to show the new inputs.
imagesTree.refreshInput();
imagesTree.getTreeViewer().expandAll();
}
}
}
}
} catch (CoreException e) {
}
}
示例6: finish
import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
public boolean finish() throws CoreException, IOException
{
cuinaProject = CuinaCore.getCuinaProject(getProjectHandle());
if (cuinaProject.getProject().exists()) return false;
cuinaProject.create(null);
ResourceProvider rp = cuinaProject.getService(ResourceProvider.class);
ProgressMonitorDialog pmd = new ProgressMonitorDialog(getShell());
pmd.open();
rp.createFileStructure(pmd.getProgressMonitor());
Ini ini = cuinaProject.getIni();
ini.set("Game", "Title", cuinaProject.getName());
return true;
}