issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13,799 |
Bug 13799 JAR exporter exports class files from output folder
|
There was a problem with the output folder not being detected as such.
|
resolved fixed
|
a65156e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:01:16Z | 2002-04-15T14:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
try {
List dirtyFilesList= Arrays.asList(dirtyFiles);
for (int i= 0; i < editorsToSave.length; i++) {
if (editorsToSave[i].getEditorInput() instanceof IFileEditorInput) {
IFile dirtyFile= ((IFileEditorInput)editorsToSave[i].getEditorInput()).getFile();
if (dirtyFilesList.contains((dirtyFile)))
editorsToSave[i].doSave(new SubProgressMonitor(pm, 1));
}
pm.worked(1);
}
} finally {
pm.done();
}
}
};
}
protected void saveFiles() {
if (fJarPackage.isManifestGenerated() && fJarPackage.isManifestSaved()) {
try {
saveManifest();
} catch (CoreException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex);
} catch (IOException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex);
}
}
if (fJarPackage.isDescriptionSaved()) {
|
13,799 |
Bug 13799 JAR exporter exports class files from output folder
|
There was a problem with the output folder not being detected as such.
|
resolved fixed
|
a65156e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:01:16Z | 2002-04-15T14:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
try {
saveDescription();
} catch (CoreException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
} catch (IOException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
}
}
}
protected void saveDescription() throws CoreException, IOException {
if (fJarPackage.isManifestReused())
fJarPackage.setGenerateManifest(false);
ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream();
IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput);
ByteArrayInputStream fileInput= null;
try {
writer.write(fJarPackage);
fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray());
IFile descriptionFile= fJarPackage.getDescriptionFile();
if (descriptionFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())))
descriptionFile.setContents(fileInput, true, true, null);
else {
descriptionFile.create(fileInput, true, null);
}
} finally {
if (fileInput != null)
fileInput.close();
if (writer != null)
writer.close();
|
13,799 |
Bug 13799 JAR exporter exports class files from output folder
|
There was a problem with the output folder not being detected as such.
|
resolved fixed
|
a65156e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:01:16Z | 2002-04-15T14:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
}
protected void saveManifest() throws CoreException, IOException {
ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream();
ByteArrayInputStream fileInput= null;
try {
Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage);
manifest.write(manifestOutput);
fileInput= new ByteArrayInputStream(manifestOutput.toByteArray());
IFile manifestFile= fJarPackage.getManifestFile();
if (manifestFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath().toString())))
manifestFile.setContents(fileInput, true, true, null);
else {
manifestFile.create(fileInput, true, null);
}
} finally {
if (manifestOutput != null)
manifestOutput.close();
if (fileInput != null)
fileInput.close();
}
}
private boolean isAutoBuilding() {
return ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding();
}
private boolean isCompilerGeneratingSourceFileAttribute() {
Object value= JavaCore.getOptions().get(COMPILER_SOURCE_FILE_ATTR);
if (value instanceof String)
return "generate".equalsIgnoreCase((String)value);
|
13,799 |
Bug 13799 JAR exporter exports class files from output folder
|
There was a problem with the output folder not being detected as such.
|
resolved fixed
|
a65156e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:01:16Z | 2002-04-15T14:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
else
return true;
}
private void buildProjects(IProgressMonitor progressMonitor) {
Set builtProjects= new HashSet(10);
Object[] elements= fJarPackage.getElements();
for (int i= 0; i < elements.length; i++) {
IProject project= null;
Object element= elements[i];
if (element instanceof IResource)
project= ((IResource)element).getProject();
else if (element instanceof IJavaElement)
project= ((IJavaElement)element).getJavaProject().getProject();
if (project != null && !builtProjects.contains(project)) {
try {
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, progressMonitor);
} catch (CoreException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringProjectBuild", project.getFullPath());
addError(message, ex);
} finally {
builtProjects.add(project);
}
}
}
}
/**
* Tells whether the given resource (or its children) have compile errors.
* The method acts on the current build state and does not recompile.
*
|
13,799 |
Bug 13799 JAR exporter exports class files from output folder
|
There was a problem with the output folder not being detected as such.
|
resolved fixed
|
a65156e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:01:16Z | 2002-04-15T14:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
* @param resource the resource to check for errors
* @return <code>true</code> if the resource (and its children) are error free
* @throws import org.eclipse.core.runtime.CoreException if there's a marker problem
*/
private boolean hasCompileErrors(IResource resource) throws CoreException {
IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
for (int i= 0; i < problemMarkers.length; i++) {
if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR)
return true;
}
return false;
}
/**
* Tells whether the given resource (or its children) have compile errors.
* The method acts on the current build state and does not recompile.
*
* @param resource the resource to check for errors
* @return <code>true</code> if the resource (and its children) are error free
* @throws import org.eclipse.core.runtime.CoreException if there's a marker problem
*/
private boolean hasCompileWarnings(IResource resource) throws CoreException {
IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
for (int i= 0; i < problemMarkers.length; i++) {
if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_WARNING)
return true;
}
return false;
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ClasspathVariablesPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.buildpaths.VariableBlock;
public class ClasspathVariablesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ClasspathVariablesPreferencePage.java
|
private VariableBlock fVariableBlock;
/**
* Constructor for ClasspathVariablesPreferencePage
*/
public ClasspathVariablesPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
IStatusChangeListener listener= new IStatusChangeListener() {
public void statusChanged(IStatus status) {
updateStatus(status);
}
};
fVariableBlock= new VariableBlock(listener, false, null);
setDescription(JavaUIMessages.getString("ClasspathVariablesPreferencePage.description"));
}
/**
* @see PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
protected Control createContents(Composite parent) {
WorkbenchHelp.setHelp(parent, IJavaHelpContextIds.CP_VARIABLES_PREFERENCE_PAGE);
return fVariableBlock.createContents(parent);
}
/**
* @see IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ClasspathVariablesPreferencePage.java
|
}
/**
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fVariableBlock.performDefaults();
super.performDefaults();
}
/**
* @see PreferencePage#performOk()
*/
public boolean performOk() {
return fVariableBlock.performOk();
}
private void updateStatus(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
/**
* Initializes the default values of this page in the preference bundle.
* Will be called on startup of the JavaPlugin
*/
public static void initDefaults(IPreferenceStore prefs) {
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.net.URL;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
public class CPListElement {
private int fEntryKind;
private IPath fPath;
private IResource fResource;
private boolean fIsMissing;
private IPath fSourceAttachmentPath;
private IPath fSourceAttachmentPrefix;
private URL fJavadocLocation;
private boolean fIsExported;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
private IClasspathEntry fCachedEntry;
public CPListElement(int entryKind, IPath path, IResource res, IPath attachPath, IPath attachRoot, boolean isExported) {
fEntryKind= entryKind;
fPath= path;
fSourceAttachmentPath= attachPath;
fSourceAttachmentPrefix= attachRoot;
fJavadocLocation= null;
fResource= res;
fIsMissing= false;
fIsExported= isExported;
fCachedEntry= null;
}
public CPListElement(int entryKind, IPath path, IResource res) {
this(entryKind, path, res, null, null, false);
}
public IClasspathEntry getClasspathEntry() {
if (fCachedEntry == null) {
fCachedEntry= newClasspathEntry();
}
return fCachedEntry;
}
private IClasspathEntry newClasspathEntry() {
switch (fEntryKind) {
case IClasspathEntry.CPE_SOURCE:
return JavaCore.newSourceEntry(fPath);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
case IClasspathEntry.CPE_LIBRARY:
return JavaCore.newLibraryEntry(fPath, fSourceAttachmentPath, fSourceAttachmentPrefix, fIsExported);
case IClasspathEntry.CPE_PROJECT:
return JavaCore.newProjectEntry(fPath, fIsExported);
default:
return JavaCore.newVariableEntry(fPath, fSourceAttachmentPath, fSourceAttachmentPrefix, fIsExported);
}
}
/**
* Gets the classpath entry path.
* @see IClasspathEntry#getPath()
*/
public IPath getPath() {
return fPath;
}
/**
* Gets the classpath entry kind.
* @see IClasspathEntry#getEntryKind()
*/
public int getEntryKind() {
return fEntryKind;
}
/**
* Entries without resource are either non existing or a variable entry
* External jars do not have a resource
*/
public IResource getResource() {
return fResource;
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
/**
* Sets the paths for source annotation
* @see org.eclipse.jdt.core.IPackageFragmentRoot#attachSource
*/
public void setSourceAttachment(IPath path, IPath prefix) {
fSourceAttachmentPath= path;
fSourceAttachmentPrefix= prefix;
fCachedEntry= null;
}
/**
* Gets the current path prefix used when accessing the source attachment
* @see org.eclipse.jdt.core.IPackageFragmentRoot#getSourceAttachmentPath
* @return The source attachment prefix
*/
public IPath getSourceAttachmentPath() {
return fSourceAttachmentPath;
}
/**
* Returns the root path used for accessing source attchments
* @see org.eclipse.jdt.core.IPackageFragmentRoot#getSourceAttachmentRootPath
*/
public IPath getSourceAttachmentRootPath() {
return fSourceAttachmentPrefix;
}
/*
* @see Object#equals(java.lang.Object)
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
*/
public boolean equals(Object other) {
if (other.getClass() == getClass()) {
CPListElement elem= (CPListElement)other;
return elem.fEntryKind == fEntryKind && elem.fPath == fPath;
}
return false;
}
/*
* @see Object#hashCode()
*/
public int hashCode() {
return fPath.hashCode() + fEntryKind;
}
/**
* Returns if a entry is missing.
* @return Returns a boolean
*/
public boolean isMissing() {
return fIsMissing;
}
/**
* Sets the 'missing' state of the entry.
*/
public void setIsMissing(boolean isMissing) {
fIsMissing= isMissing;
}
/**
* Returns if a entry is exported (only applies to libraries)
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java
|
* @return Returns a boolean
*/
public boolean isExported() {
return fIsExported;
}
/**
* Sets the export state of the entry.
*/
public void setExported(boolean isExported) {
if (isExported != fIsExported) {
fIsExported = isExported;
fCachedEntry= null;
}
}
/**
* Gets the Javadoc location.
* @return Returns a URL
*/
public URL getJavadocLocation() {
return fJavadocLocation;
}
/**
* Sets the Javadoc location.
* @param javadocLocation The javadocLocation to set
*/
public void setJavadocLocation(URL javadocLocation) {
fJavadocLocation= javadocLocation;
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ChooseVariableDialog.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
public class ChooseVariableDialog extends StatusDialog implements IStatusChangeListener, IDoubleClickListener {
private VariableBlock fVariableBlock;
public ChooseVariableDialog(Shell parent, String variableSelection) {
super(parent);
setTitle(NewWizardMessages.getString("ChooseVariableDialog.variabledialog.title"));
fVariableBlock= new VariableBlock(this, true, variableSelection);
}
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ChooseVariableDialog.java
|
fVariableBlock.createContents(composite);
fVariableBlock.addDoubleClickListener(this);
return composite;
}
protected void okPressed() {
fVariableBlock.performOk();
super.okPressed();
}
public String getSelectedVariable() {
return fVariableBlock.getSelectedVariable();
}
/*
* @see IStatusChangeListener#statusChanged(IStatus)
*/
public void statusChanged(IStatus status) {
updateStatus(status);
}
/*
* @see IDoubleClickListener#doubleClick(DoubleClickEvent)
*/
public void doubleClick(DoubleClickEvent event) {
if (getStatus().isOK()) {
okPressed();
}
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.IUIConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator;
import org.eclipse.jdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.jdt.internal.ui.util.PixelConverter;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
public class LibrariesWorkbookPage extends BuildPathBasePage {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
private ListDialogField fClassPathList;
private IJavaProject fCurrJProject;
private ListDialogField fLibrariesList;
private IWorkspaceRoot fWorkspaceRoot;
private IDialogSettings fDialogSettings;
private Control fSWTControl;
public LibrariesWorkbookPage(IWorkspaceRoot root, ListDialogField classPathList) {
fClassPathList= classPathList;
fWorkspaceRoot= root;
fSWTControl= null;
fDialogSettings= JavaPlugin.getDefault().getDialogSettings();
String[] buttonLabels= new String[] {
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.addnew.button"),
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.addexisting.button"),
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.addjar.button"),
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.addextjar.button"),
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.addvariable.button"),
null,
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.setsource.button"),
null,
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
NewWizardMessages.getString("LibrariesWorkbookPage.libraries.remove.button")
};
LibrariesAdapter adapter= new LibrariesAdapter();
fLibrariesList= new ListDialogField(adapter, buttonLabels, new CPListLabelProvider());
fLibrariesList.setDialogFieldListener(adapter);
fLibrariesList.setLabelText(NewWizardMessages.getString("LibrariesWorkbookPage.libraries.label"));
fLibrariesList.setRemoveButtonIndex(8);
fLibrariesList.enableButton(6, false);
fLibrariesList.setViewerSorter(new CPListElementSorter());
}
public void init(IJavaProject jproject) {
fCurrJProject= jproject;
updateLibrariesList();
}
private void updateLibrariesList() {
List cpelements= fClassPathList.getElements();
List libelements= new ArrayList(cpelements.size());
int nElements= cpelements.size();
for (int i= 0; i < nElements; i++) {
CPListElement cpe= (CPListElement)cpelements.get(i);
int kind= cpe.getEntryKind();
if (kind == IClasspathEntry.CPE_LIBRARY || kind == IClasspathEntry.CPE_VARIABLE) {
libelements.add(cpe);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
}
}
fLibrariesList.setElements(libelements);
}
public Control getControl(Composite parent) {
PixelConverter converter= new PixelConverter(parent);
Composite composite= new Composite(parent, SWT.NONE);
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrariesList }, true, SWT.DEFAULT, SWT.DEFAULT);
LayoutUtil.setHorizontalGrabbing(fLibrariesList.getListControl(null));
int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
fLibrariesList.setButtonsMinWidth(buttonBarWidth);
fLibrariesList.getTableViewer().setSorter(new CPListElementSorter());
fSWTControl= composite;
return composite;
}
private Shell getShell() {
if (fSWTControl != null) {
return fSWTControl.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
}
private class LibrariesAdapter implements IDialogFieldListener, IListAdapter {
public void customButtonPressed(DialogField field, int index) {
libaryPageCustomButtonPressed(field, index);
}
public void selectionChanged(DialogField field) {
libaryPageSelectionChanged(field);
}
public void dialogFieldChanged(DialogField field) {
libaryPageDialogFieldChanged(field);
}
}
private void libaryPageCustomButtonPressed(DialogField field, int index) {
CPListElement[] libentries= null;
switch (index) {
case 0:
libentries= createNewClassContainer();
break;
case 1:
libentries= chooseClassContainers();
break;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
case 2:
libentries= chooseJarFiles();
break;
case 3:
libentries= chooseExtJarFiles();
break;
case 4:
libentries= chooseVariableEntries();
break;
case 6:
List selElements= fLibrariesList.getSelectedElements();
CPListElement selElement= (CPListElement) selElements.get(0);
SourceAttachmentDialog dialog= new SourceAttachmentDialog(getShell(), selElement.getClasspathEntry());
if (dialog.open() == dialog.OK) {
selElement.setSourceAttachment(dialog.getSourceAttachmentPath(), dialog.getSourceAttachmentRootPath());
selElement.setJavadocLocation(dialog.getJavadocLocation());
fLibrariesList.refresh();
fClassPathList.refresh();
}
break;
}
if (libentries != null) {
int nElementsChosen= libentries.length;
List cplist= fLibrariesList.getElements();
List elementsToAdd= new ArrayList(nElementsChosen);
for (int i= 0; i < nElementsChosen; i++) {
CPListElement curr= libentries[i];
if (!cplist.contains(curr) && !elementsToAdd.contains(curr)) {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
elementsToAdd.add(curr);
addAttachmentsFromExistingLibs(curr);
}
}
fLibrariesList.addElements(elementsToAdd);
fLibrariesList.postSetSelection(new StructuredSelection(libentries));
}
}
private void libaryPageSelectionChanged(DialogField field) {
List selElements= fLibrariesList.getSelectedElements();
fLibrariesList.enableButton(6, canDoSourceAttachment(selElements));
}
private void libaryPageDialogFieldChanged(DialogField field) {
if (fCurrJProject != null) {
updateClasspathList();
}
}
private boolean canDoSourceAttachment(List selElements) {
if (selElements != null && selElements.size() == 1) {
CPListElement elem= (CPListElement) selElements.get(0);
return (!(elem.getResource() instanceof IFolder));
}
return false;
}
private void updateClasspathList() {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
List projelements= fLibrariesList.getElements();
boolean remove= false;
List cpelements= fClassPathList.getElements();
for (int i= cpelements.size() - 1; i >= 0; i--) {
CPListElement cpe= (CPListElement)cpelements.get(i);
int kind= cpe.getEntryKind();
if (kind == IClasspathEntry.CPE_LIBRARY || kind == IClasspathEntry.CPE_VARIABLE) {
if (!projelements.remove(cpe)) {
cpelements.remove(i);
remove= true;
}
}
}
for (int i= 0; i < projelements.size(); i++) {
cpelements.add(projelements.get(i));
}
if (remove || (projelements.size() > 0)) {
fClassPathList.setElements(cpelements);
}
}
private CPListElement[] createNewClassContainer() {
String title= NewWizardMessages.getString("LibrariesWorkbookPage.NewClassFolderDialog.title");
IProject currProject= fCurrJProject.getProject();
NewContainerDialog dialog= new NewContainerDialog(getShell(), title, currProject, getUsedContainers());
IPath projpath= currProject.getFullPath();
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
dialog.setMessage(NewWizardMessages.getFormattedString("LibrariesWorkbookPage.NewClassFolderDialog.description", projpath.toString()));
int ret= dialog.open();
if (ret == dialog.OK) {
IFolder folder= dialog.getFolder();
return new CPListElement[] { newCPLibraryElement(folder) };
}
return null;
}
private CPListElement[] chooseClassContainers() {
Class[] acceptedClasses= new Class[] { IFolder.class };
ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
acceptedClasses= new Class[] { IProject.class, IFolder.class };
ViewerFilter filter= new TypedViewerFilter(acceptedClasses, getUsedContainers());
ILabelProvider lp= new WorkbenchLabelProvider();
ITreeContentProvider cp= new WorkbenchContentProvider();
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
dialog.setValidator(validator);
dialog.setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.ExistingClassFolderDialog.title"));
dialog.setMessage(NewWizardMessages.getString("LibrariesWorkbookPage.ExistingClassFolderDialog.description"));
dialog.addFilter(filter);
dialog.setInput(fWorkspaceRoot);
dialog.setInitialSelection(fCurrJProject.getProject());
if (dialog.open() == dialog.OK) {
Object[] elements= dialog.getResult();
CPListElement[] res= new CPListElement[elements.length];
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
for (int i= 0; i < res.length; i++) {
IResource elem= (IResource) elements[i];
res[i]= newCPLibraryElement(elem);
}
return res;
}
return null;
}
private CPListElement[] chooseJarFiles() {
Class[] acceptedClasses= new Class[] { IFile.class };
ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
ViewerFilter filter= new ArchiveFileFilter(getUsedJARFiles());
ILabelProvider lp= new WorkbenchLabelProvider();
ITreeContentProvider cp= new WorkbenchContentProvider();
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
dialog.setValidator(validator);
dialog.setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.title"));
dialog.setMessage(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.description"));
dialog.addFilter(filter);
dialog.setInput(fWorkspaceRoot);
dialog.setInitialSelection(fCurrJProject.getProject());
if (dialog.open() == dialog.OK) {
Object[] elements= dialog.getResult();
CPListElement[] res= new CPListElement[elements.length];
for (int i= 0; i < res.length; i++) {
IResource elem= (IResource)elements[i];
res[i]= newCPLibraryElement(elem);
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
return res;
}
return null;
}
private IContainer[] getUsedContainers() {
ArrayList res= new ArrayList();
if (fCurrJProject.exists()) {
try {
IPath outputLocation= fCurrJProject.getOutputLocation();
if (outputLocation != null) {
IResource resource= fWorkspaceRoot.findMember(outputLocation);
if (resource instanceof IFolder) {
res.add(resource);
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
List cplist= fLibrariesList.getElements();
for (int i= 0; i < cplist.size(); i++) {
CPListElement elem= (CPListElement)cplist.get(i);
IResource resource= elem.getResource();
if (resource instanceof IContainer) {
res.add(resource);
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
return (IContainer[]) res.toArray(new IContainer[res.size()]);
}
private IFile[] getUsedJARFiles() {
List res= new ArrayList();
List cplist= fLibrariesList.getElements();
for (int i= 0; i < cplist.size(); i++) {
CPListElement elem= (CPListElement)cplist.get(i);
IResource resource= elem.getResource();
if (resource instanceof IFile) {
res.add(resource);
}
}
return (IFile[]) res.toArray(new IFile[res.size()]);
}
private CPListElement newCPLibraryElement(IResource res) {
return new CPListElement(IClasspathEntry.CPE_LIBRARY, res.getFullPath(), res);
};
private CPListElement[] chooseExtJarFiles() {
String lastUsedPath= fDialogSettings.get(IUIConstants.DIALOGSTORE_LASTEXTJAR);
if (lastUsedPath == null) {
lastUsedPath= "";
}
FileDialog dialog= new FileDialog(getShell(), SWT.MULTI);
dialog.setText(NewWizardMessages.getString("LibrariesWorkbookPage.ExtJARArchiveDialog.title"));
dialog.setFilterExtensions(new String[] {"*.jar;*.zip"});
dialog.setFilterPath(lastUsedPath);
String res= dialog.open();
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
if (res == null) {
return null;
}
String[] fileNames= dialog.getFileNames();
int nChosen= fileNames.length;
IPath filterPath= new Path(dialog.getFilterPath());
CPListElement[] elems= new CPListElement[nChosen];
for (int i= 0; i < nChosen; i++) {
IPath path= filterPath.append(fileNames[i]).makeAbsolute();
elems[i]= new CPListElement(IClasspathEntry.CPE_LIBRARY, path, null);
}
fDialogSettings.put(IUIConstants.DIALOGSTORE_LASTEXTJAR, filterPath.toOSString());
return elems;
}
private CPListElement[] chooseVariableEntries() {
ArrayList existingPaths= new ArrayList();
for (int i= 0; i < fLibrariesList.getSize(); i++) {
CPListElement elem= (CPListElement) fLibrariesList.getElement(i);
if (elem.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
existingPaths.add(elem.getPath());
}
}
VariableSelectionDialog dialog= new VariableSelectionDialog(getShell(), existingPaths);
if (dialog.open() == dialog.OK) {
IPath path= dialog.getVariable();
CPListElement elem= new CPListElement(IClasspathEntry.CPE_VARIABLE, path, null);
IPath resolvedPath= JavaCore.getResolvedVariablePath(path);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
elem.setIsMissing((resolvedPath == null) || !resolvedPath.toFile().isFile());
return new CPListElement[] { elem };
}
return null;
}
private void addAttachmentsFromExistingLibs(CPListElement elem) {
try {
IJavaModel jmodel= fCurrJProject.getJavaModel();
IJavaProject[] jprojects= jmodel.getJavaProjects();
for (int i= 0; i < jprojects.length; i++) {
IJavaProject curr= jprojects[i];
if (!curr.equals(fCurrJProject)) {
IClasspathEntry[] entries= curr.getRawClasspath();
for (int k= 0; k < entries.length; k++) {
IClasspathEntry entry= entries[k];
if (entry.getEntryKind() == elem.getEntryKind()
&& entry.getPath().equals(elem.getPath())) {
IPath attachPath= entry.getSourceAttachmentPath();
if (attachPath != null && !attachPath.isEmpty()) {
elem.setSourceAttachment(attachPath, entry.getSourceAttachmentRootPath());
return;
}
}
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
}
}
private class VariableSelectionDialog extends StatusDialog implements IStatusChangeListener {
private VariableSelectionBlock fVariableSelectionBlock;
public VariableSelectionDialog(Shell parent, List existingPaths) {
super(parent);
setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.VariableSelectionDialog.title"));
String initVar= fDialogSettings.get(IUIConstants.DIALOGSTORE_LASTVARIABLE);
fVariableSelectionBlock= new VariableSelectionBlock(this, existingPaths, null, initVar, false);
}
/*
* @see Windows#configureShell
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
WorkbenchHelp.setHelp(newShell, IJavaHelpContextIds.VARIABLE_SELECTION_DIALOG);
}
/*
* @see StatusDialog#createDialogArea()
*/
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
Label message= new Label(composite, SWT.WRAP);
message.setText(NewWizardMessages.getString("LibrariesWorkbookPage.VariableSelectionDialog.message"));
message.setLayoutData(new GridData());
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
Control inner= fVariableSelectionBlock.createControl(composite);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
/*
* @see Dialog#okPressed()
*/
protected void okPressed() {
fDialogSettings.put(IUIConstants.DIALOGSTORE_LASTVARIABLE, getVariable().segment(0));
super.okPressed();
}
/*
* @see IStatusChangeListener#statusChanged()
*/
public void statusChanged(IStatus status) {
updateStatus(status);
}
public IPath getVariable() {
return fVariableSelectionBlock.getVariablePath();
}
}
private class SourceAttachmentDialog extends StatusDialog implements IStatusChangeListener {
private SourceAttachmentBlock fSourceAttachmentBlock;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
public SourceAttachmentDialog(Shell parent, IClasspathEntry entry) {
super(parent);
setTitle(NewWizardMessages.getFormattedString("LibrariesWorkbookPage.SourceAttachmentDialog.title", entry.getPath().toString()));
fSourceAttachmentBlock= new SourceAttachmentBlock(fWorkspaceRoot, this, entry);
}
/*
* @see Windows#configureShell
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
WorkbenchHelp.setHelp(newShell, IJavaHelpContextIds.SOURCE_ATTACHMENT_DIALOG);
}
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
Control inner= fSourceAttachmentBlock.createControl(composite);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
public void statusChanged(IStatus status) {
updateStatus(status);
}
public IPath getSourceAttachmentPath() {
return fSourceAttachmentBlock.getSourceAttachmentPath();
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
public IPath getSourceAttachmentRootPath() {
return fSourceAttachmentBlock.getSourceAttachmentRootPath();
}
public URL getJavadocLocation() {
return fSourceAttachmentBlock.getJavadocLocation();
}
}
/*
* @see BuildPathBasePage#getSelection
*/
public List getSelection() {
return fLibrariesList.getSelectedElements();
}
/*
* @see BuildPathBasePage#setSelection
*/
public void setSelection(List selElements) {
for (int i= selElements.size()-1; i >= 0; i--) {
CPListElement curr= (CPListElement) selElements.get(i);
int kind= curr.getEntryKind();
if (kind != IClasspathEntry.CPE_LIBRARY && kind != IClasspathEntry.CPE_VARIABLE) {
selElements.remove(i);
}
}
fLibrariesList.selectElements(new StructuredSelection(selElements));
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.PixelConverter;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
public class VariableBlock {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
private ListDialogField fVariablesList;
private StatusInfo fSelectionStatus;
private IStatusChangeListener fContext;
private boolean fUseAsSelectionDialog;
private boolean fRemovingSelection= false;
private String fSelectedVariable;
private Control fControl;
/**
* Constructor for VariableBlock
*/
public VariableBlock(IStatusChangeListener context, boolean useAsSelectionDialog, String initSelection) {
fContext= context;
fUseAsSelectionDialog= useAsSelectionDialog;
fSelectionStatus= new StatusInfo();
String[] buttonLabels= new String[] {
NewWizardMessages.getString("VariableBlock.vars.add.button"),
NewWizardMessages.getString("VariableBlock.vars.edit.button"),
null,
NewWizardMessages.getString("VariableBlock.vars.remove.button")
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
};
VariablesAdapter adapter= new VariablesAdapter();
CPVariableElementLabelProvider labelProvider= new CPVariableElementLabelProvider(useAsSelectionDialog);
fVariablesList= new ListDialogField(adapter, buttonLabels, labelProvider);
fVariablesList.setDialogFieldListener(adapter);
fVariablesList.setLabelText(NewWizardMessages.getString("VariableBlock.vars.label"));
fVariablesList.setRemoveButtonIndex(3);
fVariablesList.enableButton(1, false);
fVariablesList.setViewerSorter(new ViewerSorter() {
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof CPVariableElement && e2 instanceof CPVariableElement) {
return ((CPVariableElement)e1).getName().compareTo(((CPVariableElement)e2).getName());
}
return super.compare(viewer, e1, e2);
}
});
CPVariableElement initSelectedElement= null;
String[] reservedName= getReservedVariableNames();
ArrayList reserved= new ArrayList(reservedName.length);
addAll(reservedName, reserved);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
String[] entries= JavaCore.getClasspathVariableNames();
ArrayList elements= new ArrayList(entries.length);
for (int i= 0; i < entries.length; i++) {
String name= entries[i];
CPVariableElement elem;
IPath entryPath= JavaCore.getClasspathVariable(name);
elem= new CPVariableElement(name, entryPath, reserved.contains(name));
elements.add(elem);
if (name.equals(initSelection)) {
initSelectedElement= elem;
}
}
fVariablesList.setElements(elements);
if (initSelectedElement != null) {
ISelection sel= new StructuredSelection(initSelectedElement);
fVariablesList.selectElements(sel);
} else {
fVariablesList.selectFirstElement();
}
}
private String[] getReservedVariableNames() {
return new String[] {
JavaRuntime.JRELIB_VARIABLE,
JavaRuntime.JRESRC_VARIABLE,
JavaRuntime.JRESRCROOT_VARIABLE,
};
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public Control createContents(Composite parent) {
PixelConverter converter= new PixelConverter(parent);
Composite composite= new Composite(parent, SWT.NONE);
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fVariablesList }, true, 0, 0);
LayoutUtil.setHorizontalGrabbing(fVariablesList.getListControl(null));
fControl= composite;
return composite;
}
public void addDoubleClickListener(IDoubleClickListener listener) {
fVariablesList.getTableViewer().addDoubleClickListener(listener);
}
private Shell getShell() {
if (fControl != null) {
return fControl.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
public String getSelectedVariable() {
return fSelectedVariable;
}
private class VariablesAdapter implements IDialogFieldListener, IListAdapter {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public void customButtonPressed(DialogField field, int index) {
switch (index) {
case 0:
editEntries(null);
break;
case 1:
List selected= fVariablesList.getSelectedElements();
editEntries((CPVariableElement)selected.get(0));
break;
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public void selectionChanged(DialogField field) {
doSelectionChanged(field);
}
public void dialogFieldChanged(DialogField field) {
}
}
private boolean containsReserved(List selected) {
for (int i= selected.size()-1; i >= 0; i--) {
if (((CPVariableElement)selected.get(i)).isReserved()) {
return true;
}
}
return false;
}
private static void addAll(Object[] objs, Collection dest) {
for (int i= 0; i < objs.length; i++) {
dest.add(objs[i]);
}
}
private void doSelectionChanged(DialogField field) {
List selected= fVariablesList.getSelectedElements();
boolean isSingleSelected= selected.size() == 1;
boolean containsReserved= containsReserved(selected);
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
fVariablesList.enableButton(1, isSingleSelected && !containsReserved);
fVariablesList.enableButton(3, !containsReserved);
fSelectedVariable= null;
if (fUseAsSelectionDialog) {
if (isSingleSelected) {
fSelectionStatus.setOK();
fSelectedVariable= ((CPVariableElement)selected.get(0)).getName();
} else {
fSelectionStatus.setError("");
}
fContext.statusChanged(fSelectionStatus);
}
}
private void editEntries(CPVariableElement entry) {
List existingEntries= fVariablesList.getElements();
VariableCreationDialog dialog= new VariableCreationDialog(getShell(), entry, existingEntries);
if (dialog.open() != dialog.OK) {
return;
}
CPVariableElement newEntry= dialog.getClasspathElement();
if (entry == null) {
fVariablesList.addElement(newEntry);
entry= newEntry;
} else {
entry.setName(newEntry.getName());
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
entry.setPath(newEntry.getPath());
fVariablesList.refresh();
}
fVariablesList.selectElements(new StructuredSelection(entry));
}
public void performDefaults() {
fVariablesList.removeAllElements();
String[] reservedName= getReservedVariableNames();
for (int i= 0; i < reservedName.length; i++) {
CPVariableElement elem= new CPVariableElement(reservedName[i], null, true);
elem.setReserved(true);
fVariablesList.addElement(elem);
}
}
public boolean performOk() {
List toRemove= new ArrayList();
toRemove.addAll(Arrays.asList(JavaCore.getClasspathVariableNames()));
List elements= fVariablesList.getElements();
for (int i= elements.size()-1; i >= 0; i--) {
CPVariableElement curr= (CPVariableElement) elements.get(i);
if (curr.isReserved()) {
elements.remove(curr);
} else {
IPath path= curr.getPath();
IPath prevPath= JavaCore.getClasspathVariable(curr.getName());
if (prevPath != null && prevPath.equals(path)) {
elements.remove(curr);
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
}
toRemove.remove(curr.getName());
}
int steps= elements.size() + toRemove.size();
if (steps > 0) {
IRunnableWithProgress runnable= new VariableBlockRunnable(toRemove, elements);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, runnable);
} catch (InvocationTargetException e) {
ExceptionHandler.handle(e, getShell(), NewWizardMessages.getString("VariableBlock.operation_errror.title"), NewWizardMessages.getString("VariableBlock.operation_errror.message"));
return false;
} catch (InterruptedException e) {
return true;
}
}
return true;
}
private class VariableBlockRunnable implements IRunnableWithProgress {
private List fToRemove;
private List fToChange;
public VariableBlockRunnable(List toRemove, List toChange) {
fToRemove= toRemove;
fToChange= toChange;
}
/*
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
* @see IRunnableWithProgress#run(IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
int steps= fToChange.size() + fToRemove.size();
monitor.beginTask(NewWizardMessages.getString("VariableBlock.operation_desc"), steps);
try {
for (int i= 0; i < fToChange.size(); i++) {
CPVariableElement curr= (CPVariableElement) fToChange.get(i);
SubProgressMonitor subMonitor= new SubProgressMonitor(monitor, 1);
JavaCore.setClasspathVariable(curr.getName(), curr.getPath(), subMonitor);
if (monitor.isCanceled()) {
return;
}
}
for (int i= 0; i < fToRemove.size(); i++) {
SubProgressMonitor subMonitor= new SubProgressMonitor(monitor, 1);
JavaCore.removeClasspathVariable((String) fToRemove.get(i), subMonitor);
if (monitor.isCanceled()) {
return;
}
}
} catch (JavaModelException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariablePathDialogField.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
public class VariablePathDialogField extends StringButtonDialogField {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariablePathDialogField.java
|
private Button fBrowseVariableButton;
private String fVariableButtonLabel;
public VariablePathDialogField(IStringButtonAdapter adapter) {
super(adapter);
}
public void setVariableButtonLabel(String label) {
fVariableButtonLabel= label;
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariablePathDialogField.java
|
public Control[] doFillIntoGrid(Composite parent, int nColumns) {
assertEnoughColumns(nColumns);
Label label= getLabelControl(parent);
label.setLayoutData(gridDataForLabel(1));
Text text= getTextControl(parent);
text.setLayoutData(gridDataForText(nColumns - 3));
Button variableButton= getBrowseVariableControl(parent);
variableButton.setLayoutData(gridDataForButton(variableButton, 1));
Button browseButton= getChangeControl(parent);
browseButton.setLayoutData(gridDataForButton(browseButton, 1));
return new Control[] { label, text, variableButton, browseButton };
}
public int getNumberOfControls() {
return 4;
}
public Button getBrowseVariableControl(Composite parent) {
if (fBrowseVariableButton == null) {
assertCompositeNotNull(parent);
fBrowseVariableButton= new Button(parent, SWT.PUSH);
fBrowseVariableButton.setText(fVariableButtonLabel);
fBrowseVariableButton.setEnabled(isEnabled());
fBrowseVariableButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
chooseVariablePressed();
}
public void widgetSelected(SelectionEvent e) {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariablePathDialogField.java
|
chooseVariablePressed();
}
});
}
return fBrowseVariableButton;
}
public IPath getPath() {
return new Path(getText());
}
public String getVariable() {
IPath path= getPath();
if (!path.isEmpty()) {
return path.segment(0);
}
return null;
}
public IPath getPathExtension() {
return new Path(getText()).removeFirstSegments(1).setDevice(null);
}
public IPath getResolvedPath() {
String variable= getVariable();
if (variable != null) {
IPath path= JavaCore.getClasspathVariable(variable);
if (path != null) {
return path.append(getPathExtension());
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariablePathDialogField.java
|
}
}
return null;
}
private Shell getShell() {
if (fBrowseVariableButton != null) {
return fBrowseVariableButton.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
private void chooseVariablePressed() {
String variable= getVariable();
ChooseVariableDialog dialog= new ChooseVariableDialog(getShell(), variable);
if (dialog.open() == dialog.OK) {
IPath newPath= new Path(dialog.getSelectedVariable()).append(getPathExtension());
setText(newPath.toString());
}
}
protected void updateEnableState() {
super.updateEnableState();
if (isOkToUse(fBrowseVariableButton)) {
fBrowseVariableButton.setEnabled(isEnabled());
}
}
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.PixelConverter;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
public class VariableSelectionBlock {
private List fExistingPaths;
private StringButtonDialogField fVariableField;
private StringButtonDialogField fExtensionField;
private CLabel fFullPath;
private IStatus fVariableStatus;
private IStatus fExistsStatus;
private IStatus fExtensionStatus;
private String fVariable;
private IStatusChangeListener fContext;
private boolean fIsEmptyAllowed;
private String fLastVariableSelection;
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
/**
* Constructor for VariableSelectionBlock
*/
public VariableSelectionBlock(IStatusChangeListener context, List existingPaths, IPath varPath, String lastVarSelection, boolean emptyAllowed) {
fContext= context;
fExistingPaths= existingPaths;
fIsEmptyAllowed= emptyAllowed;
fLastVariableSelection= lastVarSelection;
fVariableStatus= new StatusInfo();
fExistsStatus= new StatusInfo();
VariableSelectionAdapter adapter= new VariableSelectionAdapter();
fVariableField= new StringButtonDialogField(adapter);
fVariableField.setDialogFieldListener(adapter);
fVariableField.setLabelText(NewWizardMessages.getString("VariableSelectionBlock.variable.label"));
fVariableField.setButtonLabel(NewWizardMessages.getString("VariableSelectionBlock.variable.button"));
fExtensionField= new StringButtonDialogField(adapter);
fExtensionField.setDialogFieldListener(adapter);
fExtensionField.setLabelText(NewWizardMessages.getString("VariableSelectionBlock.extension.label"));
fExtensionField.setButtonLabel(NewWizardMessages.getString("VariableSelectionBlock.extension.button"));
if (varPath != null) {
fVariableField.setText(varPath.segment(0));
fExtensionField.setText(varPath.removeFirstSegments(1).toString());
} else {
fVariableField.setText("");
fExtensionField.setText("");
}
updateFullTextField();
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
}
public IPath getVariablePath() {
if (fVariable != null) {
return new Path(fVariable).append(fExtensionField.getText());
}
return null;
}
public IPath getResolvedPath() {
if (fVariable != null) {
IPath entryPath= JavaCore.getClasspathVariable(fVariable);
if (entryPath != null) {
return entryPath.append(fExtensionField.getText());
}
}
return null;
}
public void setFocus(Display display) {
fVariableField.postSetFocusOnDialogField(display);
}
public Control createControl(Composite parent) {
PixelConverter converter= new PixelConverter(parent);
int nColumns= 3;
Composite inner= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= nColumns;
inner.setLayout(layout);
int fieldWidthHint= converter.convertWidthInCharsToPixels(50);
fVariableField.doFillIntoGrid(inner, nColumns);
LayoutUtil.setWidthHint(fVariableField.getTextControl(null), fieldWidthHint);
LayoutUtil.setHorizontalGrabbing(fVariableField.getTextControl(null));
fExtensionField.doFillIntoGrid(inner, nColumns);
LayoutUtil.setWidthHint(fExtensionField.getTextControl(null), fieldWidthHint);
Label label= new Label(inner, SWT.LEFT);
label.setLayoutData(new GridData());
label.setText(NewWizardMessages.getString("VariableSelectionBlock.fullpath.label"));
fFullPath= new CLabel(inner, SWT.NONE);
fFullPath.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
DialogField.createEmptySpace(inner, nColumns - 2);
updateFullTextField();
setFocus(parent.getDisplay());
return inner;
}
private class VariableSelectionAdapter implements IDialogFieldListener, IStringButtonAdapter {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
public void dialogFieldChanged(DialogField field) {
doFieldUpdated(field);
}
public void changeControlPressed(DialogField field) {
doChangeControlPressed(field);
}
}
private void doChangeControlPressed(DialogField field) {
if (field == fVariableField) {
String variable= chooseVariable();
if (variable != null) {
fVariableField.setText(variable);
}
} else if (field == fExtensionField) {
IPath filePath= chooseExtJar();
if (filePath != null) {
fExtensionField.setText(filePath.toString());
}
}
}
private void doFieldUpdated(DialogField field) {
if (field == fVariableField) {
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
fVariableStatus= variableUpdated();
} else if (field == fExtensionField) {
fExtensionStatus= extensionUpdated();
}
fExistsStatus= getExistsStatus();
updateFullTextField();
fContext.statusChanged(StatusUtil.getMostSevere(new IStatus[] { fVariableStatus, fExtensionStatus, fExistsStatus }));
}
private IStatus variableUpdated() {
fVariable= null;
StatusInfo status= new StatusInfo();
String name= fVariableField.getText();
if (name.length() == 0) {
if (!fIsEmptyAllowed) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.entername"));
} else {
fVariable= "";
}
} else if (JavaCore.getClasspathVariable(name) == null) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.namenotexists"));
} else {
fVariable= name;
}
fExtensionField.enableButton(fVariable != null);
return status;
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
private IStatus extensionUpdated() {
StatusInfo status= new StatusInfo();
String extension= fExtensionField.getText();
if (extension.length() > 0 && !Path.ROOT.isValidPath(extension)) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.invalidextension"));
}
return status;
}
private IStatus getExistsStatus() {
StatusInfo status= new StatusInfo();
IPath path= getResolvedPath();
if (path != null) {
if (findPath(path)) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.pathexists"));
} else if (!path.toFile().isFile()) {
status.setWarning(NewWizardMessages.getString("VariableSelectionBlock.warning.pathnotexists"));
}
} else {
status.setWarning(NewWizardMessages.getString("VariableSelectionBlock.warning.pathnotexists"));
}
return status;
}
private boolean findPath(IPath path) {
for (int i= fExistingPaths.size() -1; i >=0; i--) {
IPath curr= (IPath) fExistingPaths.get(i);
if (curr.equals(path)) {
return true;
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
}
return false;
}
private void updateFullTextField() {
if (fFullPath != null && !fFullPath.isDisposed()) {
IPath resolvedPath= getResolvedPath();
if (resolvedPath != null) {
fFullPath.setText(resolvedPath.toOSString());
} else {
fFullPath.setText("");
}
}
}
private Shell getShell() {
if (fFullPath != null) {
return fFullPath.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
private IPath chooseExtJar() {
String lastUsedPath= "";
IPath entryPath= getResolvedPath();
if (entryPath != null) {
if (ArchiveFileFilter.isArchivePath(entryPath)) {
lastUsedPath= entryPath.removeLastSegments(1).toOSString();
} else {
lastUsedPath= entryPath.toOSString();
}
|
10,654 |
Bug 10654 Allow all jars in a folder to be added to build path
| null |
resolved fixed
|
0de9fba
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:40:25Z | 2002-03-04T02:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
}
FileDialog dialog= new FileDialog(getShell(), SWT.SINGLE);
dialog.setFilterExtensions(new String[] {"*.jar;*.zip"});
dialog.setFilterPath(lastUsedPath);
dialog.setText(NewWizardMessages.getString("VariableSelectionBlock.ExtJarDialog.title"));
String res= dialog.open();
if (res == null) {
return null;
}
IPath resPath= new Path(res).makeAbsolute();
IPath varPath= JavaCore.getClasspathVariable(fVariable);
if (!varPath.isPrefixOf(resPath)) {
return new Path(resPath.lastSegment());
} else {
return resPath.removeFirstSegments(varPath.segmentCount()).setDevice(null);
}
}
private String chooseVariable() {
ChooseVariableDialog dialog= new ChooseVariableDialog(getShell(), fVariable);
if (dialog.open() == dialog.OK) {
return dialog.getSelectedVariable();
}
return null;
}
}
|
12,611 |
Bug 12611 'move..' is always disabled in the outline context menu
|
'move..' is always disabled in the outline context menu this comes from ReorgGroup which includes 'move' as well (maybe it shouldn't) maybe this should be adressed together with Dirk's menu restructuring
|
resolved fixed
|
dcdc2c8
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:45:27Z | 2002-04-02T15:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgGroup.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.reorg;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GroupContext;
import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider;
import org.eclipse.jdt.internal.ui.refactoring.actions.IRefactoringAction;
public class ReorgGroup extends ContextMenuGroup {
|
12,611 |
Bug 12611 'move..' is always disabled in the outline context menu
|
'move..' is always disabled in the outline context menu this comes from ReorgGroup which includes 'move' as well (maybe it shouldn't) maybe this should be adressed together with Dirk's menu restructuring
|
resolved fixed
|
dcdc2c8
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:45:27Z | 2002-04-02T15:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgGroup.java
|
private static final String GROUP_NAME= IContextMenuConstants.GROUP_REORGANIZE;
private IRefactoringAction[] fActions;
public void fill(IMenuManager manager, GroupContext context) {
createActions(context.getSelectionProvider());
for (int i= 0; i < fActions.length; i++) {
fActions[i].update();
manager.appendToGroup(GROUP_NAME, fActions[i]);
}
}
private void createActions(ISelectionProvider p) {
StructuredSelectionProvider provider= StructuredSelectionProvider.createFrom(p);
if (fActions != null)
return;
fActions= new IRefactoringAction[] {
createCutAction(p),
createCopyAction(p),
createPasteAction(p),
createDeleteAction(p),
new JdtMoveAction(provider),
new RenameAction(p)
};
|
12,611 |
Bug 12611 'move..' is always disabled in the outline context menu
|
'move..' is always disabled in the outline context menu this comes from ReorgGroup which includes 'move' as well (maybe it shouldn't) maybe this should be adressed together with Dirk's menu restructuring
|
resolved fixed
|
dcdc2c8
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:45:27Z | 2002-04-02T15:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgGroup.java
|
}
public static void addGlobalReorgActions(IActionBars actionBars, ISelectionProvider provider) {
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, createCopyAction(provider));
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, createCutAction(provider));
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PASTE, createPasteAction(provider));
}
private static IRefactoringAction createCutAction(ISelectionProvider p){
return new CutSourceReferencesToClipboardAction(p);
}
public static IRefactoringAction createCopyAction(ISelectionProvider p){
IRefactoringAction copyResources= new CopyResourcesToClipboardAction(p);
IRefactoringAction copySourceReferences= new CopySourceReferencesToClipboardAction(p);
return new DualReorgAction(p, ReorgMessages.getString("ReorgGroup.copy"), ReorgMessages.getString("copyAction.description"), copyResources, copySourceReferences);
}
public static IRefactoringAction createPasteAction(ISelectionProvider p){
IRefactoringAction pasteResources= new PasteResourcesFromClipboardAction(p);
IRefactoringAction pasteSourceReferences= new PasteSourceReferencesFromClipboardAction(p);
return new DualReorgAction(p, ReorgMessages.getString("ReorgGroup.paste"), ReorgMessages.getString("ReorgGroup.pasteAction.description"), pasteResources, pasteSourceReferences);
}
public static IRefactoringAction createDeleteAction(ISelectionProvider p){
IRefactoringAction deleteResources= new DeleteResourcesAction(p);
IRefactoringAction deleteSourceReferences= new DeleteSourceReferencesAction(p);
return new DualReorgAction(p, ReorgMessages.getString("ReorgGroup.delete"), ReorgMessages.getString("deleteAction.description"), deleteResources, deleteSourceReferences);
}
}
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.reorg;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.swt.SWT;
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.ui.actions.MoveProjectAction;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaElementContentProvider;
import org.eclipse.jdt.internal.corext.refactoring.reorg.MoveRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider;
import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
public class JdtMoveAction extends ReorgDestinationAction {
private boolean fShowPreview= false;
public JdtMoveAction(String name, StructuredSelectionProvider provider) {
super(name, provider);
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
setDescription(ReorgMessages.getString("moveAction.description"));
}
public JdtMoveAction(StructuredSelectionProvider provider) {
super(ReorgMessages.getString("moveAction.label"), provider);
}
/* non java-doc
* see @ReorgDestinationAction#isOkToProceed
*/
String getActionName() {
return ReorgMessages.getString("moveAction.name");
}
/* non java-doc
* see @ReorgDestinationAction#getDestinationDialogMessage
*/
String getDestinationDialogMessage() {
return ReorgMessages.getString("moveAction.destination.label");
}
/* non java-doc
* see @ReorgDestinationAction#createRefactoring
*/
ReorgRefactoring createRefactoring(List elements){
return new MoveRefactoring(elements, JavaPreferencesSettings.getCodeGenerationSettings());
}
ElementTreeSelectionDialog createDestinationSelectionDialog(Shell parent, ILabelProvider labelProvider, JavaElementContentProvider cp, ReorgRefactoring refactoring){
return new MoveDestinationDialog(parent, labelProvider, cp, (MoveRefactoring)refactoring);
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
}
/* non java-doc
* see @ReorgDestinationAction#isOkToProceed
*/
protected boolean isOkToProceed(ReorgRefactoring refactoring) throws JavaModelException{
return (isOkToMoveReadOnly(refactoring));
}
/*
* @see ReorgDestinationAction#getExcluded(ReorgRefactoring)
*/
Set getExcluded(ReorgRefactoring refactoring) throws JavaModelException{
Set elements= refactoring.getElementsThatExistInTarget();
Set result= new HashSet();
for (Iterator iter= elements.iterator(); iter.hasNext(); ){
Object o= iter.next();
int action= askIfOverwrite(ReorgUtils.getName(o));
if (action == IDialogConstants.CANCEL_ID)
return null;
if (action == IDialogConstants.YES_TO_ALL_ID)
return new HashSet(0);
if (action == IDialogConstants.NO_ID)
result.add(o);
}
return result;
}
private static int askIfOverwrite(String elementName){
Shell shell= JavaPlugin.getActiveWorkbenchShell().getShell();
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
String title= ReorgMessages.getString("JdtMoveAction.move");
String question= "Element '" + elementName + "' already exists. Would you like to overwrite?";
String[] labels= new String[] {IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL,
IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL };
final MessageDialog dialog = new MessageDialog(shell, title, null, question, MessageDialog.QUESTION, labels, 0);
shell.getDisplay().syncExec(new Runnable() {
public void run() {
dialog.open();
}
});
int result = dialog.getReturnCode();
if (result == 0)
return IDialogConstants.YES_ID;
if (result == 1)
return IDialogConstants.YES_TO_ALL_ID;
if (result == 2)
return IDialogConstants.NO_ID;
return IDialogConstants.CANCEL_ID;
}
protected void setShowPreview(boolean showPreview) {
fShowPreview = showPreview;
}
private static boolean isOkToMoveReadOnly(ReorgRefactoring refactoring){
if (! hasReadOnlyElements(refactoring))
return true;
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
return MessageDialog.openQuestion(
JavaPlugin.getActiveWorkbenchShell(),
ReorgMessages.getString("moveAction.checkMove"),
ReorgMessages.getString("moveAction.error.readOnly"));
}
private static boolean hasReadOnlyElements(ReorgRefactoring refactoring){
for (Iterator iter= refactoring.getElementsToReorg().iterator(); iter.hasNext(); ){
if (ReorgUtils.shouldConfirmReadOnly(iter.next()))
return true;
}
return false;
}
/* non java-doc
* @see IRefactoringAction#canOperateOn(IStructuredSelection)
*/
public boolean canOperateOn(IStructuredSelection selection) {
if (hasOnlyProjects())
return selection.size() == 1;
else
return super.canOperateOn(selection);
}
/*
* @see Action#run()
*/
public void run() {
if (hasOnlyProjects()){
moveProject();
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
} else {
super.run();
}
}
/* non java-doc
* @see ReorgDestinationAction#doReorg(ReorgRefactoring)
*/
void doReorg(ReorgRefactoring refactoring) throws JavaModelException{
if (!fShowPreview){
super.doReorg(refactoring);
return;
}
RefactoringWizard wizard= new RefactoringWizard(refactoring, ReorgMessages.getString("JdtMoveAction.move"), IJavaHelpContextIds.MOVE_CU_ERROR_WIZARD_PAGE);
new RefactoringWizardDialog(JavaPlugin.getActiveWorkbenchShell(), wizard).open();
}
private void moveProject(){
MoveProjectAction action= new MoveProjectAction(JavaPlugin.getActiveWorkbenchShell());
action.selectionChanged(getStructuredSelection());
action.run();
}
private class MoveDestinationDialog extends ElementTreeSelectionDialog {
private static final int PREVIEW_ID= IDialogConstants.CLIENT_ID + 1;
private MoveRefactoring fRefactoring;
private Button fCheckbox;
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
private Button fPreview;
MoveDestinationDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, MoveRefactoring refactoring){
super(parent, labelProvider, contentProvider);
fRefactoring= refactoring;
fShowPreview= false;
}
protected Control createDialogArea(Composite parent) {
Composite result= (Composite)super.createDialogArea(parent);
fCheckbox= new Button(result, SWT.CHECK);
fCheckbox.setText(ReorgMessages.getString("JdtMoveAction.update_references"));
fCheckbox.setEnabled(canUpdateReferences());
fCheckbox.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
updatePreviewButton();
fRefactoring.setUpdateReferences(fCheckbox.getEnabled() && fCheckbox.getSelection());
}
});
fCheckbox.setSelection(canUpdateReferences());
return result;
}
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
fPreview= createButton(parent, PREVIEW_ID, ReorgMessages.getString("JdtMoveAction.preview"), false);
}
protected void updateOKStatus() {
super.updateOKStatus();
|
12,775 |
Bug 12775 [Dialogs] double click behaviour in move dialog (package view)
|
I double-clicked on a project, but instead of expanding the project and showing the children (source folders), it accepted the project as the target and commited OK. I think it's more natural that double clicking on projects, packages, etc. would expand/unexpand the node.
|
resolved fixed
|
78f4cb0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-15T16:47:29Z | 2002-04-04T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/JdtMoveAction.java
|
try{
fRefactoring.setDestination(getFirstResult());
fCheckbox.setEnabled(getOkButton().getEnabled() && canUpdateReferences());
updatePreviewButton();
} catch (JavaModelException e){
ExceptionHandler.handle(e, ReorgMessages.getString("JdtMoveAction.move"), ReorgMessages.getString("JdtMoveAction.exception"));
}
}
protected void buttonPressed(int buttonId) {
fShowPreview= (buttonId == PREVIEW_ID);
super.buttonPressed(buttonId);
if (buttonId == PREVIEW_ID)
close();
}
private void updatePreviewButton(){
fPreview.setEnabled(fCheckbox.getEnabled() && fCheckbox.getSelection());
}
private boolean canUpdateReferences(){
try{
return fRefactoring.canUpdateReferences();
} catch (JavaModelException e){
return false;
}
}
}
}
|
13,620 |
Bug 13620 The Java Source Attachment Preference Page has text with large amount of white space
| null |
resolved fixed
|
6c31768
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T09:32:45Z | 2002-04-12T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
|
13,620 |
Bug 13620 The Java Source Attachment Preference Page has text with large amount of white space
| null |
resolved fixed
|
6c31768
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T09:32:45Z | 2002-04-12T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java
|
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock;
/**
* Property page to configure a archive's JARs source attachment
*/
public class SourceAttachmentPropertyPage extends PropertyPage implements IStatusChangeListener {
private SourceAttachmentBlock fSourceAttachmentBlock;
private IPackageFragmentRoot fJarRoot;
public SourceAttachmentPropertyPage() {
}
/*
* @see PreferencePage#createContents
*/
|
13,620 |
Bug 13620 The Java Source Attachment Preference Page has text with large amount of white space
| null |
resolved fixed
|
6c31768
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T09:32:45Z | 2002-04-12T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java
|
protected Control createContents(Composite composite) {
fJarRoot= getJARPackageFragmentRoot();
if (fJarRoot != null) {
try {
IClasspathEntry entry= JavaModelUtil.getRawClasspathEntry(fJarRoot);
if (entry == null) {
entry= JavaCore.newLibraryEntry(fJarRoot.getPath(), null, null);
}
IWorkspaceRoot wsroot= fJarRoot.getJavaModel().getWorkspace().getRoot();
fSourceAttachmentBlock= new SourceAttachmentBlock(wsroot, this, entry);
return fSourceAttachmentBlock.createControl(composite);
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
}
}
Label label= new Label(composite, SWT.LEFT + SWT.WRAP);
label.setText(JavaUIMessages.getString("SourceAttachmentPropertyPage.noarchive.message"));
label.setFont(composite.getFont());
WorkbenchHelp.setHelp(composite, IJavaHelpContextIds.SOURCE_ATTACHMENT_PROPERTY_PAGE);
return label;
}
/*
* @see IPreferencePage#performOk
*/
public boolean performOk() {
if (fSourceAttachmentBlock != null) {
try {
IRunnableWithProgress runnable= fSourceAttachmentBlock.getRunnable(fJarRoot.getJavaProject(), getShell());
|
13,620 |
Bug 13620 The Java Source Attachment Preference Page has text with large amount of white space
| null |
resolved fixed
|
6c31768
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T09:32:45Z | 2002-04-12T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java
|
new ProgressMonitorDialog(getShell()).run(true, true, runnable);
} catch (InvocationTargetException e) {
String title= JavaUIMessages.getString("SourceAttachmentPropertyPage.error.title");
String message= JavaUIMessages.getString("SourceAttachmentPropertyPage.error.message");
ExceptionHandler.handle(e, getShell(), title, message);
return false;
} catch (InterruptedException e) {
return false;
}
}
return true;
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
if (fSourceAttachmentBlock != null) {
fSourceAttachmentBlock.setDefaults();
}
super.performDefaults();
}
private IPackageFragmentRoot getJARPackageFragmentRoot() {
IAdaptable adaptable= getElement();
IJavaElement elem= (IJavaElement) adaptable.getAdapter(IJavaElement.class);
if (elem instanceof IPackageFragmentRoot) {
IPackageFragmentRoot root= (IPackageFragmentRoot) elem;
|
13,620 |
Bug 13620 The Java Source Attachment Preference Page has text with large amount of white space
| null |
resolved fixed
|
6c31768
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T09:32:45Z | 2002-04-12T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java
|
if (root.isArchive()) {
return root;
} else {
return null;
}
}
IResource resource= (IResource) adaptable.getAdapter(IResource.class);
if (resource instanceof IFile) {
IProject proj= resource.getProject();
try {
if (proj.hasNature(JavaCore.NATURE_ID)) {
IJavaProject jproject= JavaCore.create(proj);
return jproject.getPackageFragmentRoot(resource);
}
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
}
}
return null;
}
/*
* @see IStatusChangeListener#statusChanged
*/
public void statusChanged(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
}
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.jarpackager;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.Manifest;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaModelMarker;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.jarpackager.IJarDescriptionWriter;
import org.eclipse.jdt.ui.jarpackager.IJarExportRunnable;
import org.eclipse.jdt.ui.jarpackager.JarPackageData;
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
import org.eclipse.jdt.ui.jarpackager.JarWriter;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaStatusConstants;
import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
/**
* Operation for exporting a resource and its children to a new JAR file.
*/
public class JarFileExportOperation implements IJarExportRunnable {
private static final String COMPILER_SOURCE_FILE_ATTR = "org.eclipse.jdt.core.compiler.debug.sourceFile";
private JarWriter fJarWriter;
private JarPackageData fJarPackage;
private JarPackageData[] fJarPackages;
private IFile[] fDescriptionFiles;
private Shell fParentShell;
private Map fJavaNameToClassFilesMap;
private IContainer fClassFilesMapContainer;
private Set fExportedClassContainers;
private MultiStatus fProblems;
/**
* Creates an instance of this class.
*
* @param jarPackage the JAR package specification
* @param parent the parent for the dialog,
* or <code>null</code> if no dialog should be presented
*/
public JarFileExportOperation(JarPackageData jarPackage, Shell parent) {
this(new JarPackageData[] {jarPackage}, parent);
}
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
/**
* Creates an instance of this class.
*
* @param descriptions an array with JAR package descriptions
* @param parent the parent for the dialog,
* or <code>null</code> if no dialog should be presented
*/
public JarFileExportOperation(JarPackageData[] jarPackages, Shell parent) {
this(parent);
fJarPackages= jarPackages;
}
/**
* Adds a new warning to the list with the passed information.
* Normally the export operation continues after a warning.
* @param message the message
* @param exception the throwable that caused the warning, or <code>null</code>
*/
private JarFileExportOperation(Shell parent) {
fParentShell= parent;
fProblems= new MultiStatus(JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"), null);
}
protected void addWarning(String message, Throwable error) {
if (fJarPackage == null || fJarPackage.logWarnings())
fProblems.add(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error));
}
/**
* Adds a new error to the list with the passed information.
* Normally an error terminates the export operation.
* @param message the message
* @param exception the throwable that caused the error, or <code>null</code>
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
*/
protected void addError(String message, Throwable error) {
if (fJarPackage == null || fJarPackage.logErrors())
fProblems.add(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error));
}
/**
* Answers the number of file resources specified by the JAR package.
*
* @return int
*/
protected int countSelectedElements() {
int count= 0;
int n= fJarPackage.getElements().length;
for (int i= 0; i < n; i++) {
Object element= fJarPackage.getElements()[i];
IResource resource= null;
if (element instanceof IJavaElement) {
IJavaElement je= (IJavaElement)element;
try {
resource= je.getUnderlyingResource();
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex);
return count;
}
}
else
resource= (IResource)element;
if (resource.getType() == IResource.FILE)
count++;
else
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
count += getTotalChildCount((IContainer)resource);
}
return count;
}
private int getTotalChildCount(IContainer container) {
IResource[] members;
try {
members= container.members();
} catch (CoreException ex) {
return 0;
}
int count= 0;
for (int i= 0; i < members.length; i++) {
if (members[i].getType() == IResource.FILE)
count++;
else
count += getTotalChildCount((IContainer)members[i]);
}
return count;
}
/**
* Exports the passed resource to the JAR file
*
* @param element the resource or JavaElement to export
*/
protected void exportElement(Object element, IProgressMonitor progressMonitor) throws InterruptedException {
int leadSegmentsToRemove= 1;
IPackageFragmentRoot pkgRoot= null;
boolean isInJavaProject= false;
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
IResource resource= null;
IJavaProject jProject= null;
if (element instanceof IJavaElement) {
isInJavaProject= true;
IJavaElement je= (IJavaElement)element;
try {
resource= je.getUnderlyingResource();
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex);
return;
}
jProject= je.getJavaProject();
pkgRoot= JavaModelUtil.getPackageFragmentRoot(je);
}
else
resource= (IResource)element;
if (!resource.isAccessible()) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotFound", resource.getFullPath()), null);
return;
}
if (resource.getType() == IResource.FILE) {
if (!resource.isLocal(IResource.DEPTH_ZERO))
try {
resource.setLocal(true , IResource.DEPTH_ZERO, progressMonitor);
} catch (CoreException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotLocal", resource.getFullPath()), ex);
return;
}
if (!isInJavaProject) {
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
try {
isInJavaProject= resource.getProject().hasNature(JavaCore.NATURE_ID);
} catch (CoreException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.projectNatureNotDeterminable", resource.getFullPath()), ex);
return;
}
if (isInJavaProject) {
jProject= JavaCore.create(resource.getProject());
try {
IPackageFragment pkgFragment= jProject.findPackageFragment(resource.getFullPath().removeLastSegments(1));
if (pkgFragment != null)
pkgRoot= JavaModelUtil.getPackageFragmentRoot(pkgFragment);
else
pkgRoot= jProject.findPackageFragmentRoot(resource.getFullPath().removeLastSegments(1));
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex);
return;
}
}
}
if (pkgRoot != null) {
leadSegmentsToRemove= pkgRoot.getPath().segmentCount();
if (fJarPackage.useSourceFolderHierarchy()&& !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH))
leadSegmentsToRemove--;
}
IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove);
boolean isInOutputFolder= false;
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (isInJavaProject) {
try {
isInOutputFolder= jProject.getOutputLocation().isPrefixOf(resource.getFullPath());
} catch (JavaModelException ex) {
isInOutputFolder= false;
}
}
exportClassFiles(progressMonitor, pkgRoot, resource, jProject, destinationPath);
exportResource(progressMonitor, pkgRoot, isInJavaProject, resource, destinationPath, isInOutputFolder);
progressMonitor.worked(1);
ModalContext.checkCanceled(progressMonitor);
} else if (element instanceof IPackageFragment)
exportPackageFragment(progressMonitor, (IPackageFragment)element);
else
exportContainer(progressMonitor, (IContainer)resource);
}
private void exportPackageFragment(IProgressMonitor progressMonitor, IPackageFragment pkgFragment) throws java.lang.InterruptedException {
Object[] children;
try {
children= pkgFragment.getChildren();
for (int i= 0; i < children.length; i++)
exportElement(children[i], progressMonitor);
children= pkgFragment.getNonJavaResources();
for (int i= 0; i < children.length; i++)
exportElement(children[i], progressMonitor);
} catch (CoreException e) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", pkgFragment.toString()), e);
}
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
private void exportContainer(IProgressMonitor progressMonitor, IContainer container) throws java.lang.InterruptedException {
if (container.getType() == IResource.FOLDER && isOutputFolder((IFolder)container))
return;
IResource[] children= null;
try {
children= container.members();
} catch (CoreException e) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", container.getFullPath()), e);
}
for (int i= 0; i < children.length; i++)
exportElement(children[i], progressMonitor);
}
private void exportResource(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, boolean isInJavaProject, IResource resource, IPath destinationPath, boolean isInOutputFolder) {
boolean isNonJavaResource= !isInJavaProject || pkgRoot == null;
boolean isInClassFolder= false;
try {
isInClassFolder= pkgRoot != null && !pkgRoot.isArchive() && pkgRoot.getKind() == pkgRoot.K_BINARY;
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.cantGetRootKind", resource.getFullPath()), ex);
}
if ((fJarPackage.areClassFilesExported() &&
((isNonJavaResource || (pkgRoot != null && !isJavaFile(resource) && !isClassFile(resource)))
|| isInClassFolder && isClassFile(resource)))
|| (fJarPackage.areJavaFilesExported() && (isNonJavaResource || (pkgRoot != null && !isClassFile(resource))))) {
try {
progressMonitor.subTask(JarPackagerMessages.getFormattedString("JarFileExportOperation.exporting", destinationPath.toString()));
fJarWriter.write((IFile) resource, destinationPath);
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
} catch (IOException ex) {
String message= ex.getLocalizedMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath());
addWarning(message , ex);
} catch (CoreException ex) {
String message= ex.getLocalizedMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath());
addWarning(message, ex);
}
}
}
private boolean isOutputFolder(IFolder folder) {
try {
IJavaProject javaProject= JavaCore.create(folder.getProject());
IPath outputFolderPath= javaProject.getOutputLocation();
return folder.getFullPath().equals(outputFolderPath);
} catch (JavaModelException ex) {
return false;
}
}
private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) {
if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) {
try {
Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor);
IPath baseDestinationPath= destinationPath.removeLastSegments(1);
while (iter.hasNext()) {
IFile file= (IFile)iter.next();
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (!resource.isLocal(IResource.DEPTH_ZERO))
file.setLocal(true , IResource.DEPTH_ZERO, progressMonitor);
IPath classFilePath= baseDestinationPath.append(file.getName());
progressMonitor.subTask(JarPackagerMessages.getFormattedString("JarFileExportOperation.exporting", classFilePath.toString()));
fJarWriter.write(file, classFilePath);
}
} catch (IOException ex) {
String message= ex.getLocalizedMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath());
addWarning(message , ex);
} catch (CoreException ex) {
String message= ex.getLocalizedMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath());
addWarning(message, ex);
}
}
}
/**
* Exports the resources as specified by the JAR package.
*/
protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException {
fExportedClassContainers= new HashSet(10);
int n= fJarPackage.getElements().length;
for (int i= 0; i < n; i++)
exportElement(fJarPackage.getElements()[i], progressMonitor);
}
/**
* Returns an iterator on a list with files that correspond to the
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
* passed file and that are on the classpath of its project.
*
* @param file the file for which to find the corresponding classpath resources
* @param pathInJar the path that the file has in the JAR (i.e. project and source folder segments removed)
* @param javaProject the javaProject that contains the file
* @return the iterator over the corresponding classpath files for the given file
*/
protected Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor) throws CoreException {
IFile[] classFiles= fJarPackage.findClassfilesFor(file);
if (classFiles != null)
return Arrays.asList(classFiles).iterator();
if (!isJavaFile(file))
return Collections.EMPTY_LIST.iterator();
IPath outputPath= javaProject.getOutputLocation();
IContainer outputContainer;
if (javaProject.getProject().getFullPath().equals(outputPath))
outputContainer= javaProject.getProject();
else {
outputContainer= createFolderHandle(outputPath);
if (outputContainer == null || !outputContainer.isAccessible()) {
String msg= JarPackagerMessages.getString("JarFileExportOperation.outputContainerNotAccessible");
throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
}
}
boolean hasErrors= hasCompileErrors(file);
boolean hasWarnings= hasCompileWarnings(file);
boolean canBeExported= canBeExported(hasErrors, hasWarnings);
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (!canBeExported)
return Collections.EMPTY_LIST.iterator();
reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported);
IContainer classContainer= outputContainer;
if (pathInJar.segmentCount() > 1)
classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1));
if (fExportedClassContainers.contains(classContainer))
return Collections.EMPTY_LIST.iterator();
if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) {
fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer);
if (fJavaNameToClassFilesMap == null) {
String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.missingSourceFileAttributeExportedAll", classContainer.getLocation().toFile());
addWarning(msg, null);
fExportedClassContainers.add(classContainer);
return getClassesIn(classContainer);
}
fClassFilesMapContainer= classContainer;
}
ArrayList classFileList= (ArrayList)fJavaNameToClassFilesMap.get(file.getName());
if (classFileList == null || classFileList.isEmpty()) {
String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath());
throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
}
return classFileList.iterator();
}
private Iterator getClassesIn(IContainer classContainer) throws CoreException {
IResource[] resources= classContainer.members();
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
List files= new ArrayList(resources.length);
for (int i= 0; i < resources.length; i++)
if (resources[i].getType() == IResource.FILE && isClassFile(resources[i]))
files.add(resources[i]);
return files.iterator();
}
/**
* Answers whether the given resource is a Java file.
* The resource must be a file whose file name ends with ".java".
*
* @return a <code>true<code> if the given resource is a Java file
*/
boolean isJavaFile(IResource file) {
return file != null
&& file.getType() == IFile.FILE
&& file.getFileExtension() != null
&& file.getFileExtension().equalsIgnoreCase("java");
}
/**
* Answers whether the given resource is a class file.
* The resource must be a file whose file name ends with ".class".
*
* @return a <code>true<code> if the given resource is a class file
*/
boolean isClassFile(IResource file) {
return file != null
&& file.getType() == IFile.FILE
&& file.getFileExtension() != null
&& file.getFileExtension().equalsIgnoreCase("class");
}
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
/*
* Builds and returns a map that has the class files
* for each java file in a given directory
*/
private Map buildJavaToClassMap(IContainer container) throws CoreException {
if (!isCompilerGeneratingSourceFileAttribute())
return null;
if (container == null || !container.isAccessible())
return new HashMap(0);
/*
* XXX: Bug 6584: Need a way to get class files for a java file (or CU)
*/
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader cfReader;
IResource[] members= container.members();
Map map= new HashMap(members.length);
for (int i= 0; i < members.length; i++) {
if (isClassFile(members[i])) {
IFile classFile= (IFile)members[i];
try {
cfReader= org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(classFile.getLocation().toFile());
} catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.invalidClassFileFormat", classFile.getLocation().toFile()), ex);
continue;
} catch (IOException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringClassFileLookup", classFile.getLocation().toFile()), ex);
continue;
}
if (cfReader != null) {
if (cfReader.sourceFileName() == null) {
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
/*
* Can't fully build the map because one or more
* class file does not contain the name of its
* source file.
*/
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileWithoutSourceFileAttribute", classFile.getLocation().toFile()), null);
return null;
}
String javaName= new String(cfReader.sourceFileName());
Object classFiles= map.get(javaName);
if (classFiles == null) {
classFiles= new ArrayList(3);
map.put(javaName, classFiles);
}
((ArrayList)classFiles).add(classFile);
}
}
}
return map;
}
/**
* Creates a file resource handle for the file with the given workspace path.
* This method does not create the file resource; this is the responsibility
* of <code>createFile</code>.
*
* @param filePath the path of the file resource to create a handle for
* @return the new file resource handle
* @see #createFile
*/
protected IFile createFileHandle(IPath filePath) {
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (filePath.isValidPath(filePath.toString()) && filePath.segmentCount() >= 2)
return JavaPlugin.getWorkspace().getRoot().getFile(filePath);
else
return null;
}
/**
* Creates a folder resource handle for the folder with the given workspace path.
*
* @param folderPath the path of the folder to create a handle for
* @return the new folder resource handle
*/
protected IFolder createFolderHandle(IPath folderPath) {
if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2)
return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath);
else
return null;
}
/**
* Returns the status of this operation.
* If there were any errors, the result is a status object containing
* individual status objects for each error.
* If there were no errors, the result is a status object with error code <code>OK</code>.
*
* @return the status of this operation
*/
public IStatus getStatus() {
if (fProblems.getSeverity() == IStatus.ERROR) {
String message= null;
if (fDescriptionFiles != null && fDescriptionFiles.length > 1)
message= JarPackagerMessages.getString("JarFileExportOperation.creationOfSomeJARsFailed");
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
else
message= JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailed");
return new MultiStatus(JavaPlugin.getPluginId(), 0, fProblems.getChildren(), message, null);
}
return fProblems;
}
/**
* Answer a boolean indicating whether the passed child is a descendant
* of one or more members of the passed resources collection
*
* @param resources a List contain potential parents
* @param child the resource to test
* @return a <code>boolean</code> indicating if the child is a descendant
*/
protected boolean isDescendant(List resources, IResource child) {
if (child.getType() == IResource.PROJECT)
return false;
IResource parent= child.getParent();
if (resources.contains(parent))
return true;
return isDescendant(resources, parent);
}
protected boolean canBeExported(boolean hasErrors, boolean hasWarnings) throws CoreException {
return (!hasErrors && !hasWarnings)
|| (hasErrors && fJarPackage.areErrorsExported())
|| (hasWarnings && fJarPackage.exportWarnings());
}
protected void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported) {
if (hasErrors) {
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (canBeExported)
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileErrors", file.getFullPath()), null);
else
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileErrors", file.getFullPath()), null);
}
if (hasWarnings) {
if (canBeExported)
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileWarnings", file.getFullPath()), null);
else
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileWarnings", file.getFullPath()), null);
}
}
/**
* Exports the resources as specified by the JAR package.
*
* @param progressMonitor the progress monitor that displays the progress
* @see #getStatus()
*/
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
int count= fJarPackages.length;
progressMonitor.beginTask("", count);
try {
for (int i= 0; i < count; i++) {
SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, 1);
fJarPackage= fJarPackages[i];
if (fJarPackage != null)
singleRun(subProgressMonitor);
}
} finally {
progressMonitor.done();
|
13,744 |
Bug 13744 jar export wizard: wrong path to resource folders
|
Ther jar export wizard creates since last integration build 20020412 a wrong path to the resource path of eg. images. The wizard adds a "src/" below the image or resource path. I have my sources in "src/" and the binaries in "bin/".
|
resolved fixed
|
a30f3ea
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-16T13:10:55Z | 2002-04-13T17:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
}
public void singleRun(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
try {
if (!preconditionsOK())
throw new InvocationTargetException(null, JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailedSeeDetails"));
int totalWork= countSelectedElements();
if (!isAutoBuilding() && fJarPackage.isBuildingIfNeeded()) {
int subMonitorTicks= totalWork/10;
totalWork += subMonitorTicks;
progressMonitor.beginTask("", totalWork);
SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, subMonitorTicks, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
buildProjects(subProgressMonitor);
} else
progressMonitor.beginTask("", totalWork);
fJarWriter= fJarPackage.createJarWriter(fParentShell);
exportSelectedElements(progressMonitor);
if (getStatus().getSeverity() != IStatus.ERROR) {
progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles"));
saveFiles();
}
} catch (IOException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFle", ex.getLocalizedMessage());
addError(message, ex);
throw new InvocationTargetException(ex, message);
} catch (CoreException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFileDueToInvalidManifest", ex.getLocalizedMessage());
addError(message, ex);
throw new InvocationTargetException(ex, message);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.