/** * Handles the shared location button being selected */ 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); } }
@Override 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); } } } });
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();