本文整理汇总了Java中org.eclipse.ui.dialogs.SelectionDialog.setInitialSelections方法的典型用法代码示例。如果您正苦于以下问题:Java SelectionDialog.setInitialSelections方法的具体用法?Java SelectionDialog.setInitialSelections怎么用?Java SelectionDialog.setInitialSelections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.dialogs.SelectionDialog
的用法示例。
在下文中一共展示了SelectionDialog.setInitialSelections方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMainClassBrowseButtonPressed
import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
protected void handleMainClassBrowseButtonPressed() {
List<IResource> resources= JarPackagerUtil.asResources(fJarPackage.getElements());
if (resources == null) {
setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_noResourceSelected);
return;
}
IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(resources.toArray(new IResource[resources.size()]), true);
SelectionDialog dialog= JavaUI.createMainTypeDialog(getContainer().getShell(), getContainer(), searchScope, 0, false, ""); //$NON-NLS-1$
dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_title);
dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_message);
if (fJarPackage.getManifestMainClass() != null)
dialog.setInitialSelections(new Object[] {fJarPackage.getManifestMainClass()});
if (dialog.open() == Window.OK) {
fJarPackage.setManifestMainClass((IType)dialog.getResult()[0]);
fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage));
} else if (!fJarPackage.isMainClassValid(getContainer())) {
// user did not cancel: no types were found
fJarPackage.setManifestMainClass(null);
fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage));
}
}
示例2: handleSealPackagesDetailsButtonPressed
import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
protected void handleSealPackagesDetailsButtonPressed() {
SelectionDialog dialog= createPackageDialog(getPackagesForSelectedResources());
dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_sealedPackagesSelectionDialog_title);
dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_sealedPackagesSelectionDialog_message);
dialog.setInitialSelections(fJarPackage.getPackagesToSeal());
if (dialog.open() == Window.OK)
fJarPackage.setPackagesToSeal(getPackagesFromDialog(dialog));
updateSealingInfo();
}
示例3: handleUnSealPackagesDetailsButtonPressed
import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
protected void handleUnSealPackagesDetailsButtonPressed() {
SelectionDialog dialog= createPackageDialog(getPackagesForSelectedResources());
dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_unsealedPackagesSelectionDialog_title);
dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_unsealedPackagesSelectionDialog_message);
dialog.setInitialSelections(fJarPackage.getPackagesToUnseal());
if (dialog.open() == Window.OK)
fJarPackage.setPackagesToUnseal(getPackagesFromDialog(dialog));
updateSealingInfo();
}