List of usage examples for org.eclipse.jface.dialogs Dialog DIALOG_PERSISTSIZE
int DIALOG_PERSISTSIZE
To view the source code for org.eclipse.jface.dialogs Dialog DIALOG_PERSISTSIZE.
Click Source Link
From source file:com.arc.embeddedcdt.gui.ARCCommonTab.java
License:Open Source License
/** * Creates the component set for the capture output composite * @param parent the parent to add this component to *///from w w w. j a v a2s .c o m private void createOutputCaptureComponent(Composite parent) { Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_4, 5, 2, GridData.FILL_HORIZONTAL); Composite comp = SWTFactory.createComposite(group, 5, 5, GridData.FILL_BOTH); GridLayout ld = (GridLayout) comp.getLayout(); ld.marginWidth = 1; ld.marginHeight = 1; fConsoleOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_5); GridData gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false); gd.horizontalSpan = 5; fConsoleOutput.setLayoutData(gd); fConsoleOutput.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateLaunchConfigurationDialog(); } }); fFileOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_6); fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false)); fFileOutput.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { enableOuputCaptureWidgets(fFileOutput.getSelection()); updateLaunchConfigurationDialog(); } }); fFileText = SWTFactory.createSingleText(comp, 4); fFileText.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { e.result = LaunchConfigurationsMessages.CommonTab_6; } }); fFileText.addModifyListener(fBasicModifyListener); Composite bcomp = SWTFactory.createComposite(comp, 3, 5, GridData.HORIZONTAL_ALIGN_END); ld = (GridLayout) bcomp.getLayout(); ld.marginHeight = 1; ld.marginWidth = 0; fWorkspaceBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_12, null); fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13); dialog.setMessage(LaunchConfigurationsMessages.CommonTab_14); dialog.setInput(ResourcesPlugin.getWorkspace().getRoot()); dialog.setComparator(new ResourceComparator(ResourceComparator.NAME)); dialog.setDialogBoundsSettings(getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG), Dialog.DIALOG_PERSISTSIZE); if (dialog.open() == IDialogConstants.OK_ID) { IResource resource = (IResource) dialog.getFirstResult(); if (resource != null) { String arg = resource.getFullPath().toString(); String fileLoc = VariablesPlugin.getDefault().getStringVariableManager() .generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$ fFileText.setText(fileLoc); } } } }); fFileBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_7, null); fFileBrowse.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { String filePath = fFileText.getText(); FileDialog dialog = new FileDialog(getShell(), SWT.SAVE); filePath = dialog.open(); if (filePath != null) { fFileText.setText(filePath); } } }); fVariables = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_9, null); fVariables.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell()); dialog.open(); String variable = dialog.getVariableExpression(); if (variable != null) { fFileText.insert(variable); } } public void widgetDefaultSelected(SelectionEvent e) { } }); fAppend = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_11); gd = new GridData(SWT.LEFT, SWT.TOP, true, false); gd.horizontalSpan = 4; fAppend.setLayoutData(gd); fAppend.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateLaunchConfigurationDialog(); } }); }
From source file:com.arc.embeddedcdt.gui.ARCCommonTab.java
License:Open Source License
/** * Handles the shared location button being selected *//* w w w. j a va 2s.c o m*/ private void handleSharedLocationButtonSelected() { String currentContainerString = fSharedLocationText.getText(); IContainer currentContainer = getContainer(currentContainerString); ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), currentContainer, false, LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13); dialog.showClosedProjects(false); dialog.setDialogBoundsSettings(getDialogBoundsSettings(SHARED_LAUNCH_CONFIGURATON_DIALOG), Dialog.DIALOG_PERSISTSIZE); dialog.open(); Object[] results = dialog.getResult(); if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) { IPath path = (IPath) results[0]; String containerName = path.toOSString(); fSharedLocationText.setText(containerName); } }
From source file:com.rawpixil.eclipse.launchpad.internal.ui.component.dialog.AbstractSelectionDialog.java
License:Open Source License
/** * Constructor/* w w w .j a v a 2 s . c om*/ * @param parentShell the parent shell */ public AbstractSelectionDialog(Shell parentShell) { super(parentShell); setDialogBoundsSettings(getDialogBoundsSettings(), Dialog.DIALOG_PERSISTSIZE); }
From source file:de.loskutov.anyedit.actions.compare.CompareWithEditorAction.java
License:Open Source License
public static ListDialog createSelectionDialog(AbstractEditor myEditor, ContentWrapper selectedContent, String message) {//from www . j a va2 s . com EditorsContentProvider contentProvider = new EditorsContentProvider(myEditor, selectedContent); ILabelProvider labelProvider = new EditorsLabelProvider(contentProvider); class MyListDialog extends ListDialog { public MyListDialog(Shell parent) { super(parent); setShellStyle(getShellStyle() | SWT.RESIZE); } } ListDialog dialog = new MyListDialog(AnyEditToolsPlugin.getShell()); dialog.setContentProvider(contentProvider); dialog.setLabelProvider(labelProvider); dialog.setTitle("Select editor"); dialog.setMessage(message); dialog.setInput(new byte[0]); dialog.setDialogBoundsSettings(AnyEditToolsPlugin.getDefault().getDialogSettings(), Dialog.DIALOG_PERSISTLOCATION | Dialog.DIALOG_PERSISTSIZE); return dialog; }
From source file:de.walware.statet.r.internal.console.ui.launching.RRemoteConsoleSelectionDialog.java
License:Open Source License
public RRemoteConsoleSelectionDialog(final Shell parentShell, final boolean onlyRunning) { super(parentShell); setTitle(RConsoleMessages.RRemoteConsoleSelectionDialog_title); setMessage(RConsoleMessages.RRemoteConsoleSelectionDialog_message); setStatusLineAboveButtons(true);//ww w . ja va 2 s .c om setDialogBoundsSettings(getDialogSettings(), Dialog.DIALOG_PERSISTSIZE); fUsername = System.getProperty("user.name"); //$NON-NLS-1$ fFilterOnlyRunning = onlyRunning; }
From source file:melnorme.lang.ide.ui.build.AbstractDebugSelectionDialog.java
License:Open Source License
/** * Constructor//from ww w . j a v a2 s .c o m * @param parentShell the parent shell */ public AbstractDebugSelectionDialog(Shell parentShell) { super(parentShell); setDialogBoundsSettings(getDialogBoundsSettings(), Dialog.DIALOG_PERSISTSIZE); }
From source file:net.tourbook.ui.views.rawData.ActionSaveTourInDatabase.java
License:Open Source License
private TourPerson selectPersonInDialog() { if (_people == null) { _people = PersonManager.getTourPeople(); }//from w w w. j av a 2 s . com final ResizeableListDialog dialog = new ResizeableListDialog(_rawDataView.getSite().getShell()); dialog.setContentProvider(new PeopleContentProvider()); dialog.setLabelProvider(new PeopleLabelProvider()); dialog.setTitle(Messages.import_data_dlg_save_tour_title); dialog.setMessage(Messages.import_data_dlg_save_tour_msg); dialog.setDialogBoundsSettings(_state, Dialog.DIALOG_PERSISTLOCATION | Dialog.DIALOG_PERSISTSIZE); // select last person try { final long personId = _state.getLong(STATE_SELECTED_PERSON); for (final TourPerson person : _people) { if (person.getPersonId() == personId) { dialog.setInitialSelections(new TourPerson[] { person }); break; } } } catch (final NumberFormatException e) { } dialog.setInput(this); dialog.create(); // disable ok button when no people are available if (_people.size() == 0) { dialog.getOkButton().setEnabled(false); } if (dialog.open() != Window.OK) { return null; } final Object[] people = dialog.getResult(); if (people != null && people.length > 0) { final TourPerson selectedPerson = (TourPerson) people[0]; _state.put(STATE_SELECTED_PERSON, selectedPerson.getPersonId()); return selectedPerson; } else { return null; } }
From source file:org.eclipse.debug.internal.ui.groups.CommonTabLite.java
License:Open Source License
/** * Handles the shared location button being selected *///from w w w . j a va2 s . c om private void handleSharedLocationButtonSelected() { String currentContainerString = fSharedLocationText.getText(); IContainer currentContainer = getContainer(currentContainerString); ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), currentContainer, false, LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13); dialog.showClosedProjects(false); dialog.setDialogBoundsSettings(getDialogBoundsSettings(), Dialog.DIALOG_PERSISTSIZE); dialog.open(); Object[] results = dialog.getResult(); if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) { IPath path = (IPath) results[0]; String containerName = path.toOSString(); fSharedLocationText.setText(containerName); } }
From source file:org.eclipse.mylyn.internal.tasks.ui.actions.OpenRepositoryTaskAction.java
License:Open Source License
public void run(IAction action) { RemoteTaskSelectionDialog dlg = new RemoteTaskSelectionDialog(WorkbenchUtil.getShell()); dlg.setTitle(Messages.OpenRepositoryTask_Open_Repository_Task); IDialogSettings settings = TasksUiPlugin.getDefault().getDialogSettings(); IDialogSettings dlgSettings = settings.getSection(OPEN_REMOTE_TASK_DIALOG_DIALOG_SETTINGS); if (dlgSettings == null) { dlgSettings = settings.addNewSection(OPEN_REMOTE_TASK_DIALOG_DIALOG_SETTINGS); }// w w w . j a va 2 s . c o m dlg.setDialogBoundsSettings(dlgSettings, Dialog.DIALOG_PERSISTLOCATION | Dialog.DIALOG_PERSISTSIZE); if (dlg.open() == Window.OK) { if (dlg.getSelectedTask() != null) { openExistingTask(dlg); } else { openRemoteTask(dlg); } } }
From source file:org.eclipse.scada.da.server.ui.launcher.driver.HiveTab.java
License:Open Source License
protected void chooseVariable() { final StringVariableSelectionDialog dlg = new StringVariableSelectionDialog(getShell()); dlg.setDialogBoundsSettings(getDialogBoundsSettings(HiveTab.VARIABLE_SELECTION_DIALOG), Dialog.DIALOG_PERSISTSIZE); if (dlg.open() == Window.OK) { this.fileText.insert(dlg.getVariableExpression()); makeDirty();/*w w w . ja va 2 s. c o m*/ } }