@Override public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(new GridLayout()); composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); composite.setFont(parent.getFont()); createResourcesGroup(composite); createButtonsGroup(composite); createDestinationGroup(composite); createOptionsGroup(composite); restoreResourceSpecificationWidgetValues(); // ie.- local restoreWidgetValues(); // ie.- subclass hook if (initialResourceSelection != null) { setupBasedOnInitialSelections(); } updateWidgetEnablements(); setPageComplete(determinePageCompletion()); setErrorMessage(null); // should not initially have error message setControl(composite); }
/** * Check if widgets are enabled or disabled by a change in the dialog. */ @Override protected void updateWidgetEnablements() { boolean pageComplete = determinePageCompletion(); setPageComplete(pageComplete); if (pageComplete) { setMessage(null); } super.updateWidgetEnablements(); } }
/** * Creates the checkbox tree and list for selecting resources. * * @param parent the parent control */ protected final void createResourcesGroup(Composite parent) { //create the input element, which has the root resource //as its only child List input = new ArrayList(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() .getProjects(); for (int i = 0; i < projects.length; i++) { if (projects[i].isOpen()) { input.add(projects[i]); } } showLinkedResources = getShowLinkedResources(); this.resourceGroup = new ResourceTreeAndListGroup(parent, input, getResourceProvider(IResource.FOLDER | IResource.PROJECT, showLinkedResources), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(), getResourceProvider(IResource.FILE, showLinkedResources), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(), SWT.NONE, DialogUtil.inRegularFontMode(parent)); ICheckStateListener listener = event -> updateWidgetEnablements(); this.resourceGroup.addCheckStateListener(listener); }
public void setPreviousPage(IWizardPage page) { super.setPreviousPage(page); if (getControl() != null) updatePageCompletion(); }
/** * Queries the user for the resource types that are to be exported and returns * these types as an array. * * @return the resource types selected for export (element type: * <code>String</code>), or <code>null</code> if the user canceled the * selection */ protected Object[] queryResourceTypesToExport() { TypeFilteringDialog dialog = new TypeFilteringDialog(getContainer() .getShell(), getTypesToExport()); dialog.open(); return dialog.getResult(); }
Button selectTypesButton = createButton(buttonComposite, IDialogConstants.SELECT_TYPES_ID, SELECT_TYPES_TITLE, false); selectTypesButton.addSelectionListener(listener); selectTypesButton.setFont(font); setButtonLayoutData(selectTypesButton); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE, false); selectButton.addSelectionListener(listener); selectButton.setFont(font); setButtonLayoutData(selectButton); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, DESELECT_ALL_TITLE, false); deselectButton.addSelectionListener(listener); deselectButton.setFont(font); setButtonLayoutData(deselectButton);
/** * Updates the resources tree to show or hide linked resources * * @param showLinked * {<code>true</code> if the page should show linked resources * @since 3.12 */ protected void updateContentProviders(boolean showLinked) { showLinkedResources = showLinked; resourceGroup.setTreeProviders( getResourceProvider(IResource.FOLDER | IResource.PROJECT, showLinkedResources), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); resourceGroup.setListProviders(getResourceProvider(IResource.FILE, showLinkedResources), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); }
@Override public void createControl(Composite parent) { super.createControl(parent); giveFocusToDestination(); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDataTransferHelpContextIds.FILE_SYSTEM_EXPORT_WIZARD_PAGE); }
public void setPreviousPage(IWizardPage page) { super.setPreviousPage(page); if (getControl() != null) updatePageCompletion(); }