/** * @param parent * the parent * @param config * to be used instead of the user configuration * @param useDialogFont * if <code>true</code>, the current dialog font is used * @param changeablePath * The user can change the path of the configuration file */ public ConfigurationEditorComponent(Composite parent, StoredConfig config, boolean useDialogFont, boolean changeablePath) { editableConfig = config; this.shellProvider = new SameShellProvider(parent); this.parent = parent; this.useDialogFont = useDialogFont; this.changeablePath = changeablePath; }
/** * Creates a new action for opening a property dialog on the elements from * the given selection provider. * * @param shell * the shell in which the dialog will open * @param provider * the selection provider whose elements the property dialog will * describe * @deprecated use PropertyDialogAction(IShellProvider, ISelectionProvider) */ @Deprecated public PropertyDialogAction(Shell shell, ISelectionProvider provider) { this(new SameShellProvider(shell), provider); }
/** * Changes the parent shell. This is only safe to use when the shell is not * yet realized (i.e., created). Once the shell is created, it must be * disposed (i.e., closed) before this method can be called. * * @param newParentShell * The new parent shell; this value may be <code>null</code> if * there is to be no parent. * @since 3.1 */ protected void setParentShell(final Shell newParentShell) { Assert.isTrue((shell == null), "There must not be an existing shell."); //$NON-NLS-1$ parentShell = new SameShellProvider(newParentShell); }
/** * Changes the parent shell. This is only safe to use when the shell is not * yet realized (i.e., created). Once the shell is created, it must be * disposed (i.e., closed) before this method can be called. * * @param newParentShell * The new parent shell; this value may be <code>null</code> if * there is to be no parent. * @since 1.0 */ protected void setParentShell(final Shell newParentShell) { Assert.isTrue((shell == null), "There must not be an existing shell."); //$NON-NLS-1$ parentShell = new SameShellProvider(newParentShell); }
/** * Changes the parent shell. This is only safe to use when the shell is not * yet realized (i.e., created). Once the shell is created, it must be * disposed (i.e., closed) before this method can be called. * * @param newParentShell * The new parent shell; this value may be <code>null</code> if * there is to be no parent. * @since 3.1 */ protected void setParentShell(final Shell newParentShell) { Assert.isTrue((shell == null), "There must not be an existing shell."); //$NON-NLS-1$ parentShell = new SameShellProvider(newParentShell); }
/** * Creates a dialog instance. Note that the window will have no visual * representation (no widgets) until it is told to open. By default, * <code>open</code> blocks for dialogs. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell */ protected Dialog(Shell parentShell) { this(new SameShellProvider(parentShell)); if (parentShell == null && Policy.DEBUG_DIALOG_NO_PARENT) { Policy.getLog().log( new Status(IStatus.INFO, Policy.JFACE, IStatus.INFO, this .getClass() + " created with no shell",//$NON-NLS-1$ new Exception())); } }
/** * Creates a dialog instance. Note that the window will have no visual * representation (no widgets) until it is told to open. By default, * <code>open</code> blocks for dialogs. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell */ protected Dialog(Shell parentShell) { this(new SameShellProvider(parentShell)); if (parentShell == null && Policy.DEBUG_DIALOG_NO_PARENT) { Policy.getLog().log( new Status(IStatus.INFO, Policy.JFACE, IStatus.INFO, this .getClass() + " created with no shell",//$NON-NLS-1$ new Exception())); } }
@Override public void run() { Tree tree = (Tree) viewer.getControl(); ConfigureColumns.forTree(tree, new SameShellProvider(tree)); } };
@Override public void run() { Tree tree = (Tree) viewer.getControl(); ConfigureColumns.forTree(tree, new SameShellProvider(tree)); } };
/** * Creates a dialog instance. Note that the window will have no visual * representation (no widgets) until it is told to open. By default, * <code>open</code> blocks for dialogs. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell */ protected Dialog(Shell parentShell) { this(new SameShellProvider(parentShell)); if (parentShell == null && Policy.DEBUG_DIALOG_NO_PARENT) { Policy.getLog().log( new Status(IStatus.INFO, Policy.JFACE, IStatus.INFO, this .getClass() + " created with no shell",//$NON-NLS-1$ new Exception())); } }
/** * Details area underneath the group that displays more info on the selected IU * @param parent parent composite */ private void createDetailsArea(Composite parent) { Group detailsGroup = SWTFactory.createGroup(parent, Messages.EditIUContainerPage_12, 1, 1, GridData.FILL_HORIZONTAL); fDetailsText = SWTFactory.createText(detailsGroup, SWT.WRAP | SWT.READ_ONLY, 1, GridData.FILL_HORIZONTAL); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); gd.heightHint = 50; gd.widthHint = 400; fDetailsText.setLayoutData(gd); // TODO Use a link instead of a button? To be consistent with the install wizard fPropertiesButton = SWTFactory.createPushButton(detailsGroup, Messages.EditIUContainerPage_13, null); ((GridData) fPropertiesButton.getLayoutData()).horizontalAlignment = SWT.RIGHT; fPropertiesButton.addSelectionListener(widgetSelectedAdapter(event -> fPropertyAction.run())); fPropertyAction = new PropertyDialogAction(new SameShellProvider(getShell()), fAvailableIUGroup.getStructuredViewer()); fPropertiesButton.setEnabled(false); }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
public void run(IAction action) { if (mSelection != null && allProfilesInSelectionAreDisconnected(mSelection)) { List list = mSelection.toList(); if (list == null || list.size() == 0) return; for (int i = 0; i < list.size(); i++) { PropertyDialogAction propertyDialogAction = new PropertyDialogAction( new SameShellProvider(mShell), this); if (list.get(i) instanceof IConnectionProfile) { IConnectionProfile profile = (IConnectionProfile) list.get(i); StructuredSelection ssel = new StructuredSelection(profile); propertyDialogAction.selectionChanged(ssel); if (!profile.arePropertiesComplete() && propertyDialogAction.isApplicableForSelection()) { PreferenceDialog dialog = propertyDialogAction.createDialog(); String initialPage = getInitialPropertyPageID(profile); if (initialPage != null) { ((IWorkbenchPreferenceContainer) dialog).openPage( initialPage, null); } if (dialog.open() == Dialog.CANCEL) { return; } } profile.connect(null); } } } }
propLink = createLink(detailsComposite, new PropertyDialogAction(new SameShellProvider(parent.getShell()), selectionProvider), ProvUIMessages.AvailableIUsPage_GotoProperties); propLink.setLayoutData(gd);
public void run(IAction action) { PropertyDialogAction propertyDialogAction = new PropertyDialogAction( new SameShellProvider(mParentShell), this); propertyDialogAction .selectionChanged((IStructuredSelection) getSelection()); if (!mConnectionProfile.arePropertiesComplete() && propertyDialogAction.isApplicableForSelection()) { PreferenceDialog dialog = propertyDialogAction.createDialog(); String initialPage = getInitialPropertyPageID(); if (initialPage != null) { ((IWorkbenchPreferenceContainer) dialog).openPage( initialPage, null); } if (dialog.open() == Dialog.CANCEL) { return; } } new PingJob(mParentShell, mConnectionProfile).schedule(); }
parentShell = new SameShellProvider(null);
parentShell = new SameShellProvider(null);
parentShell = new SameShellProvider(null);