本文整理汇总了Java中org.eclipse.jface.dialogs.Dialog类的典型用法代码示例。如果您正苦于以下问题:Java Dialog类的具体用法?Java Dialog怎么用?Java Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dialog类属于org.eclipse.jface.dialogs包,在下文中一共展示了Dialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setFont(parent.getFont());
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
configurationBlockControl = super.createContents(composite);
configurationBlockControl.setLayoutData(data);
if (isProjectPreferencePage()) {
boolean useProjectSpecificSettings = hasProjectSpecificOptions();
enableProjectSpecificSettings(useProjectSpecificSettings);
}
Dialog.applyDialogFont(composite);
return composite;
}
示例2: getReplacementText
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
public String getReplacementText() {
SelectEcoreIFileDialog dialog = new SelectEcoreIFileDialog();
if (dialog.open() == Dialog.OK) {
Object[] selections = dialog.getResult();
if(selections != null
&& selections.length != 0
&& selections[0] instanceof IResource
){
IResource ecoreFile = (IResource) selections[0];
ecoreProject = ecoreFile.getProject();
String path = "/"+ecoreFile.getProject().getName() +"/"+ecoreFile.getProjectRelativePath();
URI uri = URI.createPlatformResourceURI(path,true);
String replacementText = "\""+uri.toString()+"\"";
return replacementText;
}
}
return "";
}
示例3: getReplacementText
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
public String getReplacementText() {
SelectAnyIProjectDialog dialog = new SelectAnyIProjectDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
if (dialog.open() == Dialog.OK) {
Object[] selections = dialog.getResult();
if(selections != null
&& selections.length != 0
&& selections[0] instanceof IProject
){
dsaProject = (IProject) selections[0];
Set<String> aspects = SequentialSingleLanguageTemplate.getAspectClassesList(dsaProject);
final StringBuilder insertion = new StringBuilder();
for (String asp : aspects) {
insertion.append("\twith " + asp + "\n");
}
insertion.replace(0, 1, "");//remove the first \t
return insertion.toString();
}
}
return "";
}
示例4: chooseWorkspace
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
protected void chooseWorkspace ()
{
final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog ( getShell (), new WorkbenchLabelProvider (), new WorkbenchContentProvider () );
dialog.setTitle ( "Select driver exporter configuration file" );
dialog.setMessage ( "Choose a driver exporter file for the configuration" );
dialog.setInput ( ResourcesPlugin.getWorkspace ().getRoot () );
dialog.setComparator ( new ResourceComparator ( ResourceComparator.NAME ) );
dialog.setAllowMultiple ( true );
dialog.setDialogBoundsSettings ( getDialogBoundsSettings ( HiveTab.WORKSPACE_SELECTION_DIALOG ), Dialog.DIALOG_PERSISTSIZE );
if ( dialog.open () == IDialogConstants.OK_ID )
{
final IResource resource = (IResource)dialog.getFirstResult ();
if ( resource != null )
{
final String arg = resource.getFullPath ().toString ();
final String fileLoc = VariablesPlugin.getDefault ().getStringVariableManager ().generateVariableExpression ( "workspace_loc", arg ); //$NON-NLS-1$
this.fileText.setText ( fileLoc );
makeDirty ();
}
}
}
示例5: chooseFile
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
private static final IStashing chooseFile(PersistType type) throws IOException {
FileSelectionDialog dialog = new FileSelectionDialog(Display.getCurrent().getActiveShell(), previousFile);
dialog.setExtensions(extensions);
dialog.setFiles(files);
dialog.setNewFile(type==PersistType.SAVE);
dialog.setFolderSelector(false);
dialog.create();
if (dialog.open() != Dialog.OK) return null;
String path = dialog.getPath();
if (!path.endsWith(extensions[0])) { //should always be saved to .json
path = path.concat("." + extensions[0]);
}
final File file = new File(path);
previousFile = file.getCanonicalPath();
IStashing stash = ServiceHolder.getStashingService().createStash(file);
return stash;
}
示例6: createControl
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
/**
* @wbp.parser.entryPoint
*/
@Override
public void createControl(Composite p) {
parent_1 = new Composite(p, SWT.NONE);
setControl(parent_1);
GridLayout gl_parent_1 = new GridLayout();
gl_parent_1.numColumns = 3;
parent_1.setLayout(gl_parent_1);
createAllSections(parent_1);
Dialog.applyDialogFont(parent_1);
new Label(parent_1, SWT.NONE);
validatePage();
updateLaunchConfigurationDialog();
updateConfigState();
}
示例7: createControl
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
/**
* Creates the page control by creating individual options in the order
* subject to their position in the list.'
*
* @param composite
*/
public void createControl(Composite composite) {
Composite container = new Composite(composite, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.verticalSpacing = 9;
container.setLayout(layout);
for (int i = 0; i < options.size(); i++) {
TemplateOption option = (TemplateOption) options.get(i);
option.createControl(container, 3);
}
if (helpContextId != null)
PlatformUI.getWorkbench().getHelpSystem().setHelp(container, helpContextId);
setControl(container);
Dialog.applyDialogFont(container);
container.forceFocus();
}
示例8: createContents
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
protected Control createContents(Composite parent) {
Control control = super.createContents(parent);
boolean selected = false;
if (folder.getItemCount() > 0) {
if (lastSelectedTabId != null) {
CTabItem[] items = folder.getItems();
for (int i = 0; i < items.length; i++)
if (items[i].getData(ID).equals("30.PluginPage")) {
folder.setSelection(i);
tabSelected(items[i]);
selected = true;
break;
}
}
if (!selected)
tabSelected(folder.getItem(0));
}
// need to reapply the dialog font now that we've created new
// tab items
Dialog.applyDialogFont(folder);
return control;
}
示例9: getEventLoopMonitor
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
/**
* Get a progress monitor that forwards to an event loop monitor.
* Override #setBlocked() so that we always open the blocked dialog.
*
* @return the monitor on the event loop
*/
private IProgressMonitor getEventLoopMonitor() {
if (PlatformUI.isWorkbenchStarting())
return new NullProgressMonitor();
return new EventLoopProgressMonitor(new NullProgressMonitor()) {
@Override
public void setBlocked(IStatus reason) {
// Set a shell to open with as we want to create
// this
// even if there is a modal shell.
Dialog.getBlockedHandler().showBlocked(
ProgressManagerUtil.getDefaultParent(), this,
reason, getTaskName());
}
};
}
示例10: createDialogArea
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite top = (Composite) super.createDialogArea(parent);
Composite editArea = new Composite(top, SWT.NONE);
editArea.setLayout(new GridLayout());
editArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
runInBackground = new BooleanFieldEditor(IProgressConstants.RUN_IN_BACKGROUND, ProgressMessages.JobsViewPreferenceDialog_RunInBackground, editArea);
runInBackground.setPreferenceName(IProgressConstants.RUN_IN_BACKGROUND);
runInBackground.setPreferenceStore(preferenceStore);
runInBackground.load();
showSystemJob = new BooleanFieldEditor(IProgressConstants.SHOW_SYSTEM_JOBS, ProgressMessages.JobsViewPreferenceDialog_ShowSystemJobs, editArea);
showSystemJob.setPreferenceName(IProgressConstants.SHOW_SYSTEM_JOBS);
showSystemJob.setPreferenceStore(preferenceStore);
showSystemJob.load();
Dialog.applyDialogFont(top);
return top;
}
示例11: execute
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Execute
public void execute(
@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@Optional TerminologyService terminologyService,
@Optional ETerminology terminology,
@Optional IndexedCorpus indexedCorpus
) throws IOException {
FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
fileDialog.setText("Exporting terminology "+ TerminologyPart.toPartLabel(terminology) +" to " + formatName);
String path = fileDialog.open();
if(path != null) {
if(withOptionDialog) {
Dialog dialog = getDialog(shell);
if(dialog.open() == Dialog.OK)
export(shell, terminology, getExporter(dialog), indexedCorpus, path);
} else
// no option dialog
export(shell, terminology, getExporter(), indexedCorpus, path);
}
}
示例12: execute
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Execute
public void execute(
@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@Optional TerminologyService terminologyService,
@Optional ETerminoViewerConfig viewerConfig,
@Optional MPart terminologyPart
) {
EList<String> viewerList = viewerConfig.getSelectedPropertyNames();
List<Property<?>> selectedProperties = viewerList
.stream()
.map(s -> PropertyUtil.forName(s)).collect(Collectors.toList());
SelectPropertyDialog dialog = new SelectPropertyDialog(shell, selectedProperties, p-> true, false);
if(dialog.open() == Dialog.OK) {
List<String> propertyNames = dialog.getSelectedPropertyNames();
viewerList.retainAll(propertyNames);
propertyNames.removeAll(viewerList);
viewerList.addAll(propertyNames);
}
}
示例13: createContents
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
protected Control createContents(Composite ancestor) {
Composite parent = new Composite(ancestor, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginHeight = 0;
layout.marginWidth = 0;
parent.setLayout(layout);
Composite innerParent = new Composite(parent, SWT.NONE);
GridLayout innerLayout = new GridLayout();
innerLayout.numColumns = 2;
innerLayout.marginHeight = 0;
innerLayout.marginWidth = 0;
innerParent.setLayout(innerLayout);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
innerParent.setLayoutData(gd);
Dialog.applyDialogFont(parent);
innerParent.layout();
return parent;
}
示例14: createControl
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
composite = SWTFactory.createComposite(parent, 1, SWT.FILL, SWT.FILL);
initializeDialogUnits(parent);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
initCommonParts(composite);
initMultiProjectParts(composite);
initJavaParts(composite);
// Show description on opening
setErrorMessage(null);
setMessage(null);
setControl(composite);
Dialog.applyDialogFont(composite);
updateUI();
}
示例15: createDialogArea
import org.eclipse.jface.dialogs.Dialog; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
setTitle("Path placeholder");
getShell().setText("Path placeholder usage");
setMessage("Path placeholder usage");
Composite parentComposite = (Composite) super.createDialogArea(parent);
Composite container = new Composite(parentComposite, SWT.NONE);
GridData gd = new GridData(GridData.FILL_BOTH);
container.setLayoutData(gd);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.makeColumnsEqualWidth = false;
layout.horizontalSpacing = 5;
layout.verticalSpacing = 10;
container.setLayout(layout);
createCollapsableBookmarksList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
createButtonArea(container);
createCollapsedBookmarksList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
updateButtonEnablement();
Dialog.applyDialogFont(parentComposite);
return container;
}