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
unknown | report_datetime
unknown | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fComboBoxes;
private SelectionListener fSelectionListener;
public CompilerPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CompilerPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fCheckBoxes= new ArrayList();
fComboBoxes= new ArrayList();
fSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
controlChanged(e.widget);
}
};
}
/** |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | * @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/**
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
WorkbenchHelp.setHelp(getControl(), new DialogPageContextComputer(this, IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE));
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
TabFolder folder= new TabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
GridLayout layout= new GridLayout();
layout.numColumns= 2; |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | Composite warningsComposite= new Composite(folder, SWT.NULL);
warningsComposite.setLayout(layout);
String label= JavaUIMessages.getString("CompilerPreferencePage.pb_unreachable_code.label");
addComboBox(warningsComposite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_invalid_import.label");
addComboBox(warningsComposite, label, PREF_PB_INVALID_IMPORT, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_overriding_pkg_dflt.label");
addComboBox(warningsComposite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_method_naming.label");
addComboBox(warningsComposite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_deprecation.label");
addComboBox(warningsComposite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_hidden_catchblock.label");
addComboBox(warningsComposite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_local.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_parameter.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_synth_access_emul.label");
addComboBox(warningsComposite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_non_externalized_strings.label");
addComboBox(warningsComposite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_assert_as_identifier.label");
addComboBox(warningsComposite, label, PREF_PB_ASSERT_AS_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels); |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | String[] generateValues= new String[] { GENERATE, DO_NOT_GENERATE };
layout= new GridLayout();
layout.numColumns= 2;
Composite codeGenComposite= new Composite(folder, SWT.NULL);
codeGenComposite.setLayout(layout);
label= JavaUIMessages.getString("CompilerPreferencePage.variable_attr.label");
addCheckBox(codeGenComposite, label, PREF_LOCAL_VARIABLE_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.line_number_attr.label");
addCheckBox(codeGenComposite, label, PREF_LINE_NUMBER_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.source_file_attr.label");
addCheckBox(codeGenComposite, label, PREF_SOURCE_FILE_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_unused_local.label");
addCheckBox(codeGenComposite, label, PREF_CODEGEN_UNUSED_LOCAL, new String[] { PRESERVE, OPTIMIZE_OUT });
String[] values= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4 };
String[] valuesLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.jvm11"),
JavaUIMessages.getString("CompilerPreferencePage.jvm12"),
JavaUIMessages.getString("CompilerPreferencePage.jvm13"),
JavaUIMessages.getString("CompilerPreferencePage.jvm14")
};
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_targetplatform.label");
addComboBox(codeGenComposite, label, PREF_CODEGEN_TARGET_PLATFORM, values, valuesLabels);
values= new String[] { VERSION_1_3, VERSION_1_4 };
valuesLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version13"),
JavaUIMessages.getString("CompilerPreferencePage.version14")
}; |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | label= JavaUIMessages.getString("CompilerPreferencePage.source_compatibility.label");
addComboBox(codeGenComposite, label, PREF_SOURCE_COMPATIBILITY, values, valuesLabels);
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_REFACTORING_WARNING));
item.setControl(warningsComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.generation.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE));
item.setControl(codeGenComposite);
return folder;
}
private void addCheckBox(Composite parent, String label, String key, String[] values) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan= 2;
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0); |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | fCheckBoxes.add(checkBox);
}
private void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels) {
ControlData data= new ControlData(key, values);
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridData gd= new GridData();
gd.horizontalAlignment= GridData.END;
Combo comboBox= new Combo(parent, SWT.READ_ONLY);
comboBox.setItems(valueLabels);
comboBox.setData(data);
comboBox.setLayoutData(gd);
comboBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
comboBox.select(data.getSelection(currValue));
fComboBoxes.add(comboBox);
}
private void controlChanged(Widget widget) {
ControlData data= (ControlData) widget.getData();
String newValue= null;
if (widget instanceof Button) { |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | newValue= data.getValue(((Button)widget).getSelection());
} else if (widget instanceof Combo) {
newValue= data.getValue(((Combo)widget).getSelectionIndex());
} else {
return;
}
fWorkingValues.put(data.getKey(), newValue);
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
IPreferenceStore store= getPreferenceStore();
boolean hasChanges= false;
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
String oldVal= (String) actualOptions.get(key);
hasChanges= hasChanges | !val.equals(oldVal);
actualOptions.put(key, val);
store.putValue(key, val);
}
JavaCore.setOptions(actualOptions); |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | if (hasChanges) {
String title= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.message");
if (MessageDialog.openQuestion(getShell(), title, message)) {
doFullBuild();
}
}
return super.performOk();
}
private void doFullBuild() {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
});
} catch (InterruptedException e) {
} catch (InvocationTargetException e) {
String title= JavaUIMessages.getString("CompilerPreferencePage.builderror.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.builderror.message");
ExceptionHandler.handle(e, getShell(), title, message);
}
} |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java | /*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
updateControls();
super.performDefaults();
}
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
Combo curr= (Combo) fComboBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.select(data.getSelection(currValue));
}
}
} |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java | package org.eclipse.jdt.internal.ui.text.java;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;
import org.eclipse.jface.text.rules.WordRule;
import org.eclipse.jdt.ui.text.IColorManager;
import org.eclipse.jdt.ui.text.IJavaColorConstants;
import org.eclipse.jdt.internal.ui.text.AbstractJavaScanner;
import org.eclipse.jdt.internal.ui.text.JavaWhitespaceDetector;
import org.eclipse.jdt.internal.ui.text.JavaWordDetector;
/**
* A Java code scanner.
*/
public final class JavaCodeScanner extends AbstractJavaScanner { |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java | private static String[] fgKeywords= {
"abstract",
"break",
"case", "catch", "class", "const", "continue",
"default", "do",
"else", "extends",
"final", "finally", "for",
"goto",
"if", "implements", "import", "instanceof", "interface",
"native", "new",
"package", "private", "protected", "public",
"return",
"static", "super", "switch", "synchronized",
"this", "throw", "throws", "transient", "try",
"volatile",
"while"
};
private static String[] fgTypes= { "void", "boolean", "char", "byte", "short", "strictfp", "int", "long", "float", "double" }; |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java | private static String[] fgConstants= { "false", "null", "true" };
private String[] fgTokenProperties= {
IJavaColorConstants.JAVA_KEYWORD,
IJavaColorConstants.JAVA_TYPE,
IJavaColorConstants.JAVA_STRING,
IJavaColorConstants.JAVA_DEFAULT
};
/**
* Creates a Java code scanner
*/
public JavaCodeScanner(IColorManager manager, IPreferenceStore store) {
super(manager, store);
initialize();
}
/*
* @see AbstractJavaScanner#getTokenProperties()
*/
protected String[] getTokenProperties() {
return fgTokenProperties;
}
/*
* @see AbstractJavaScanner#createRules()
*/
protected List createRules() {
List rules= new ArrayList(); |
4,077 | Bug 4077 JDK1.4 - Assertions - text coloring should deal with 'assert' (1GHS3A3) | If the JavaCore option related to source mode is set in 1.4 mode, then 'assert' is a keyword which has to be coloured properly. Assertions are only supported in the 2.0 stream of jdtcore. Configurable options are also subject to improvements. NOTES: | verified fixed | 2a5b45c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:14Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java | Token token= getToken(IJavaColorConstants.JAVA_STRING);
rules.add(new SingleLineRule("\"", "\"", token, '\\'));
rules.add(new SingleLineRule("'", "'", token, '\\'));
rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
token= getToken(IJavaColorConstants.JAVA_DEFAULT);
WordRule wordRule= new WordRule(new JavaWordDetector(), token);
token= getToken(IJavaColorConstants.JAVA_KEYWORD);
for (int i=0; i<fgKeywords.length; i++)
wordRule.addWord(fgKeywords[i], token);
token= getToken(IJavaColorConstants.JAVA_TYPE);
for (int i=0; i<fgTypes.length; i++)
wordRule.addWord(fgTypes[i], token);
for (int i=0; i<fgConstants.length; i++)
wordRule.addWord(fgConstants[i], token);
rules.add(wordRule);
setDefaultReturnToken(getToken(IJavaColorConstants.JAVA_DEFAULT));
return rules;
}
} |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | /*
* (c) Copyright IBM Corp. 2000, 2001. |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | * All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.zip.ZipFile;
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.DirectoryDialog;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ViewerFilter; |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | 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.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.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
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.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.SelectionButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
/**
* UI to set the source attachment archive and root.
* Same implementation for both setting attachments for libraries from
* variable entries and for normal (internal or external) jar.
*/
public class SourceAttachmentBlock { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | private IStatusChangeListener fContext;
private StringButtonDialogField fFileNameField;
private SelectionButtonDialogField fInternalButtonField;
private StringButtonDialogField fPrefixField;
private StringButtonDialogField fJavaDocField;
private boolean fIsVariableEntry;
private IStatus fNameStatus;
private IStatus fPrefixStatus;
private IStatus fJavaDocStatus;
private IPath fJARPath;
/**
* The file to which the archive path points to.
* Only set when the file exists.
*/
private File fResolvedFile;
/**
* The path to which the archive variable points.
* Null if invalid path or not resolvable. Must not exist.
*/
private IPath fFileVariablePath;
private URL fJavaDocLocation; |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | private IWorkspaceRoot fRoot;
private Control fSWTWidget;
private CLabel fFullPathResolvedLabel;
private CLabel fPrefixResolvedLabel;
private IClasspathEntry fOldEntry;
public SourceAttachmentBlock(IWorkspaceRoot root, IStatusChangeListener context, IClasspathEntry oldEntry) {
fContext= context;
fRoot= root;
fOldEntry= oldEntry;
fIsVariableEntry= (oldEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE);
fNameStatus= new StatusInfo();
fPrefixStatus= new StatusInfo();
fJavaDocStatus= new StatusInfo();
fJARPath= (oldEntry != null) ? oldEntry.getPath() : Path.EMPTY;
SourceAttachmentAdapter adapter= new SourceAttachmentAdapter();
if (fIsVariableEntry) {
fFileNameField= new VariablePathDialogField(adapter);
fFileNameField.setDialogFieldListener(adapter); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | fFileNameField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.varlabel"));
fFileNameField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.external.varbutton"));
((VariablePathDialogField)fFileNameField).setVariableButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.variable.button"));
fPrefixField= new VariablePathDialogField(adapter);
fPrefixField.setDialogFieldListener(adapter);
fPrefixField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.varlabel"));
fPrefixField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.varbutton"));
((VariablePathDialogField)fPrefixField).setVariableButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.variable.button"));
} else {
fFileNameField= new StringButtonDialogField(adapter);
fFileNameField.setDialogFieldListener(adapter);
fFileNameField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.label"));
fFileNameField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.external.button"));
fInternalButtonField= new SelectionButtonDialogField(SWT.PUSH);
fInternalButtonField.setDialogFieldListener(adapter);
fInternalButtonField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.internal.button"));
fPrefixField= new StringButtonDialogField(adapter);
fPrefixField.setDialogFieldListener(adapter);
fPrefixField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.label"));
fPrefixField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.button"));
}
fJavaDocField= new StringButtonDialogField(adapter);
fJavaDocField.setDialogFieldListener(adapter);
fJavaDocField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.label")); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | fJavaDocField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.button"));
setDefaults();
}
public void setDefaults() {
if (fOldEntry != null && fOldEntry.getSourceAttachmentPath() != null) {
fFileNameField.setText(fOldEntry.getSourceAttachmentPath().toString());
} else {
fFileNameField.setText("");
}
if (fOldEntry != null && fOldEntry.getSourceAttachmentRootPath() != null) {
fPrefixField.setText(fOldEntry.getSourceAttachmentRootPath().toString());
} else {
fPrefixField.setText("");
}
}
/**
* Gets the source attachment path chosen by the user
*/
public IPath getSourceAttachmentPath() {
if (fFileNameField.getText().length() == 0) {
return null;
}
return new Path(fFileNameField.getText());
}
/** |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | * Gets the source attachment root chosen by the user
*/
public IPath getSourceAttachmentRootPath() {
if (getSourceAttachmentPath() == null) {
return null;
} else {
return new Path(fPrefixField.getText());
}
}
/**
* Creates the control
*/
public Control createControl(Composite parent) {
fSWTWidget= parent;
Composite composite= new Composite(parent, SWT.NONE);
MGridLayout layout= new MGridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, composite);
layout.numColumns= 4;
composite.setLayout(layout);
int widthHint= SWTUtil.convertWidthInCharsToPixels(fIsVariableEntry ? 50 : 60, composite);
MGridData gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 4; |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | Label message= new Label(composite, SWT.LEFT);
message.setLayoutData(gd);
message.setText(NewWizardMessages.getFormattedString("SourceAttachmentBlock.message", fJARPath.lastSegment()));
if (fIsVariableEntry) {
DialogField.createEmptySpace(composite, 1);
gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL);
gd.widthHint= widthHint;
Label desc= new Label(composite, SWT.LEFT + SWT.WRAP);
desc.setText(NewWizardMessages.getString("SourceAttachmentBlock.filename.description"));
desc.setLayoutData(gd);
DialogField.createEmptySpace(composite, 2);
}
fFileNameField.doFillIntoGrid(composite, 4);
gd= (MGridData)fFileNameField.getTextControl(null).getLayoutData();
gd.widthHint= widthHint;
if (!fIsVariableEntry) {
DialogField.createEmptySpace(composite, 3);
fInternalButtonField.doFillIntoGrid(composite, 1);
} else {
DialogField.createEmptySpace(composite, 1);
fFullPathResolvedLabel= new CLabel(composite, SWT.LEFT);
fFullPathResolvedLabel.setText(getResolvedLabelString(fFileNameField.getText(), true));
fFullPathResolvedLabel.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL));
DialogField.createEmptySpace(composite, 2); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | }
DialogField.createEmptySpace(composite, 1);
gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL);
gd.widthHint= widthHint;
Label desc= new Label(composite, SWT.LEFT + SWT.WRAP);
desc.setText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.description"));
desc.setLayoutData(gd);
DialogField.createEmptySpace(composite, 2);
fPrefixField.doFillIntoGrid(composite, 4);
gd= (MGridData)fPrefixField.getTextControl(null).getLayoutData();
gd.widthHint= widthHint;
if (fIsVariableEntry) {
DialogField.createEmptySpace(composite, 1);
fPrefixResolvedLabel= new CLabel(composite, SWT.LEFT);
fPrefixResolvedLabel.setText(getResolvedLabelString(fPrefixField.getText(), false));
fPrefixResolvedLabel.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL));
DialogField.createEmptySpace(composite, 2);
}
fFileNameField.postSetFocusOnDialogField(parent.getDisplay()); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | WorkbenchHelp.setHelp(composite, new Object[] { IJavaHelpContextIds.SOURCE_ATTACHMENT_BLOCK });
return composite;
}
private class SourceAttachmentAdapter implements IStringButtonAdapter, IDialogFieldListener {
public void changeControlPressed(DialogField field) {
attachmentChangeControlPressed(field);
}
public void dialogFieldChanged(DialogField field) {
attachmentDialogFieldChanged(field);
}
}
private void attachmentChangeControlPressed(DialogField field) {
if (field == fFileNameField) {
IPath jarFilePath= chooseExtJarFile();
if (jarFilePath != null) {
fFileNameField.setText(jarFilePath.toString());
}
} else if (field == fPrefixField) {
IPath prefixPath= choosePrefix(); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | if (prefixPath != null) {
fPrefixField.setText(prefixPath.toString());
}
} else if (field == fJavaDocField) {
URL jdocURL= chooseJavaDocLocation();
if (jdocURL != null) {
fJavaDocField.setText(jdocURL.toExternalForm());
}
}
}
private void attachmentDialogFieldChanged(DialogField field) {
if (field == fFileNameField) {
fNameStatus= updateFileNameStatus();
} else if (field == fInternalButtonField) {
IPath jarFilePath= chooseInternalJarFile(fFileNameField.getText());
if (jarFilePath != null) {
fFileNameField.setText(jarFilePath.toString());
}
return;
} else if (field == fPrefixField) {
fPrefixStatus= updatePrefixStatus();
} else if (field == fJavaDocField) {
fJavaDocStatus= updateJavaDocLocationStatus();
}
doStatusLineUpdate();
}
private void doStatusLineUpdate() { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | fPrefixField.enableButton(canBrowsePrefix());
fFileNameField.enableButton(canBrowseFileName());
if (fFullPathResolvedLabel != null) {
fFullPathResolvedLabel.setText(getResolvedLabelString(fFileNameField.getText(), true));
}
if (fPrefixResolvedLabel != null) {
fPrefixResolvedLabel.setText(getResolvedLabelString(fPrefixField.getText(), false));
}
IStatus status= StatusUtil.getMostSevere(new IStatus[] { fNameStatus, fPrefixStatus, fJavaDocStatus });
fContext.statusChanged(status);
}
private boolean canBrowseFileName() {
if (!fIsVariableEntry) {
return true;
}
if (fFileVariablePath != null) {
return fFileVariablePath.toFile().isDirectory();
}
return false;
}
private boolean canBrowsePrefix() {
if (fResolvedFile != null) { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | if (fIsVariableEntry) {
return fPrefixStatus.isOK();
}
return true;
}
return false;
}
private String getResolvedLabelString(String path, boolean osPath) {
IPath resolvedPath= getResolvedPath(new Path(path));
if (resolvedPath != null) {
if (osPath) {
return resolvedPath.toOSString();
} else {
return resolvedPath.toString();
}
}
return "";
}
private IPath getResolvedPath(IPath path) {
if (path != null) {
String varName= path.segment(0);
if (varName != null) {
IPath varPath= JavaCore.getClasspathVariable(varName);
if (varPath != null) {
return varPath.append(path.removeFirstSegments(1));
}
} |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | }
return null;
}
private IStatus updatePrefixStatus() {
StatusInfo status= new StatusInfo();
String prefix= fPrefixField.getText();
if (prefix.length() == 0) {
return status;
} else {
if (!Path.EMPTY.isValidPath(prefix)) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.notvalid"));
return status;
}
IPath path= new Path(prefix);
if (fIsVariableEntry) {
IPath resolvedPath= getResolvedPath(path);
if (resolvedPath == null) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.varnotexists"));
return status;
}
if (resolvedPath.getDevice() != null) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.deviceinvar"));
return status;
}
} else {
if (path.getDevice() != null) { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.deviceinpath"));
return status;
}
}
}
return status;
}
private IStatus updateFileNameStatus() {
StatusInfo status= new StatusInfo();
fResolvedFile= null;
fFileVariablePath= null;
String fileName= fFileNameField.getText();
if (fileName.length() == 0) {
return status;
} else {
if (!Path.EMPTY.isValidPath(fileName)) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.notvalid"));
return status;
}
IPath filePath= new Path(fileName);
IPath resolvedPath;
if (fIsVariableEntry) {
if (filePath.getDevice() != null) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.deviceinpath"));
return status;
}
String varName= filePath.segment(0); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | if (varName == null) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.notvalid"));
return status;
}
fFileVariablePath= JavaCore.getClasspathVariable(varName);
if (fFileVariablePath == null) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.varnotexists"));
return status;
}
resolvedPath= fFileVariablePath.append(filePath.removeFirstSegments(1));
if (resolvedPath.isEmpty()) {
status.setWarning(NewWizardMessages.getString("SourceAttachmentBlock.filename.warning.varempty"));
return status;
}
File file= resolvedPath.toFile();
if (!file.isFile()) {
String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.filename.error.filenotexists", resolvedPath.toOSString());
status.setWarning(message);
return status;
}
fResolvedFile= file;
} else {
File file= filePath.toFile();
IResource res= fRoot.findMember(filePath);
if (res != null) {
file= res.getLocation().toFile();
}
if (!file.isFile()) { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.filename.error.filenotexists", filePath.toString());
status.setError(message);
return status;
}
fResolvedFile= file;
}
}
return status;
}
private IStatus updateJavaDocLocationStatus() {
StatusInfo status= new StatusInfo();
fJavaDocLocation= null;
String jdocLocation= fJavaDocField.getText();
if (!"".equals(jdocLocation)) {
try {
URL url= new URL(jdocLocation);
if ("file".equals(url.getProtocol())) {
File dir= new File(url.getFile());
if (!dir.isDirectory()) {
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.error.notafolder"));
return status;
}
/*else {
File indexFile= new File(dir, "index.html");
File packagesFile= new File(dir, "package-list");
if (!packagesFile.exists() || !indexFile.exists()) {
fJavaDocStatusInfo.setWarning(NewWizardMessages.getString(ERR_JDOCLOCATION_IDXNOTFOUND));
// only a warning, go on |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | }
}*/
}
fJavaDocLocation= url;
} catch (MalformedURLException e) {
status.setError(NewWizardMessages.getFormattedString("SourceAttachmentBlock.javadoc.error.malformed", e.getLocalizedMessage()));
return status;
}
}
return status;
}
/*
* Opens a dialog to choose a jar from the file system.
*/
private IPath chooseExtJarFile() {
IPath currPath= new Path(fFileNameField.getText());
if (currPath.isEmpty()) {
currPath= fJARPath;
}
IPath resolvedPath= currPath;
if (fIsVariableEntry) {
resolvedPath= getResolvedPath(currPath);
if (resolvedPath == null) {
resolvedPath= Path.EMPTY;
}
}
if (ArchiveFileFilter.isArchivePath(resolvedPath)) {
resolvedPath= resolvedPath.removeLastSegments(1); |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | }
FileDialog dialog= new FileDialog(getShell());
dialog.setText(NewWizardMessages.getString("SourceAttachmentBlock.extjardialog.text"));
dialog.setFilterExtensions(new String[] {"*.jar;*.zip"});
dialog.setFilterPath(resolvedPath.toOSString());
String res= dialog.open();
if (res != null) {
IPath returnPath= new Path(res).makeAbsolute();
if (fIsVariableEntry) {
returnPath= modifyPath(returnPath, currPath.segment(0));
}
return returnPath;
}
return null;
}
/*
* Opens a dialog to choose an internal jar.
*/
private IPath chooseInternalJarFile(String initSelection) {
Class[] acceptedClasses= new Class[] { IFile.class };
ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false);
ViewerFilter filter= new ArchiveFileFilter(null);
ILabelProvider lp= new WorkbenchLabelProvider();
ITreeContentProvider cp= new WorkbenchContentProvider();
IResource initSel= fRoot.findMember(new Path(initSelection));
if (initSel == null) {
initSel= fRoot.findMember(fJARPath);
} |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
dialog.setAllowMultiple(false);
dialog.setValidator(validator);
dialog.addFilter(filter);
dialog.setTitle(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.title"));
dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.message"));
dialog.setInput(fRoot);
dialog.setInitialSelection(initSel);
if (dialog.open() == dialog.OK) {
IFile file= (IFile) dialog.getFirstResult();
return file.getFullPath();
}
return null;
}
/*
* Opens a dialog to choose path in a zip file.
*/
private IPath choosePrefix() {
if (fResolvedFile != null) {
IPath currPath= new Path(fPrefixField.getText());
String initSelection= null;
if (fIsVariableEntry) {
IPath resolvedPath= getResolvedPath(currPath);
if (resolvedPath != null) {
initSelection= resolvedPath.toString();
}
} else {
initSelection= currPath.toString();
} |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | try {
ZipFile zipFile= new ZipFile(fResolvedFile);
ZipContentProvider contentProvider= new ZipContentProvider();
contentProvider.setInitialInput(zipFile);
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), new ZipLabelProvider(), contentProvider);
dialog.setAllowMultiple(false);
dialog.setTitle(NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.title"));
dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.message"));
dialog.setInput(zipFile);
dialog.setInitialSelection(contentProvider.getSelectedNode(initSelection));
if (dialog.open() == dialog.OK) {
Object obj= dialog.getFirstResult();
IPath path= new Path(obj.toString());
if (fIsVariableEntry) {
path= modifyPath(path, currPath.segment(0));
}
return path;
}
} catch (IOException e) {
String title= NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.error.title");
String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.prefixdialog.error.message", fResolvedFile.getPath());
MessageDialog.openError(getShell(), title, message);
JavaPlugin.log(e);
}
}
return null;
}
/* |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | * Opens a dialog to choose a root in the file system.
*/
private URL chooseJavaDocLocation() {
String initPath= "";
if (fJavaDocLocation != null && "file".equals(fJavaDocLocation.getProtocol())) {
initPath= (new File(fJavaDocLocation.getFile())).getPath();
}
DirectoryDialog dialog= new DirectoryDialog(getShell());
dialog.setText(NewWizardMessages.getString("SourceAttachmentBlock.jdocdialog.text"));
dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.jdocdialog.message"));
dialog.setFilterPath(initPath);
String res= dialog.open();
if (res != null) {
try {
return (new File(res)).toURL();
} catch (MalformedURLException e) {
JavaPlugin.log(e);
}
}
return null;
}
private Shell getShell() {
if (fSWTWidget != null) {
return fSWTWidget.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
} |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | /**
* Takes a path and replaces the beginning with a variable name
* (if the beginning matches with the variables value)
*/
private IPath modifyPath(IPath path, String varName) {
if (varName == null || path == null) {
return null;
}
if (path.isEmpty()) {
return new Path(varName);
}
IPath varPath= JavaCore.getClasspathVariable(varName);
if (varPath != null) {
if (varPath.isPrefixOf(path)) {
path= path.removeFirstSegments(varPath.segmentCount());
} else {
path= new Path(path.lastSegment());
}
} else {
path= new Path(path.lastSegment());
}
return new Path(varName).append(path);
}
/**
* Creates a runnable that sets the source attachment by modifying the project's classpath.
*/ |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | public IRunnableWithProgress getRunnable(final IJavaProject jproject, final Shell shell) {
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
IClasspathEntry newEntry;
if (fIsVariableEntry) {
newEntry= JavaCore.newVariableEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false);
} else {
newEntry= JavaCore.newLibraryEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false);
}
IClasspathEntry[] entries= modifyClasspath(jproject, newEntry, shell);
if (entries != null) {
jproject.setRawClasspath(entries, monitor);
}
} catch (JavaModelException e) {
throw new InvocationTargetException(e);
}
}
};
}
private IClasspathEntry[] modifyClasspath(IJavaProject jproject, IClasspathEntry newEntry, Shell shell) throws JavaModelException{
IClasspathEntry[] oldClasspath= jproject.getRawClasspath();
int nEntries= oldClasspath.length;
ArrayList newEntries= new ArrayList(nEntries + 1);
int entryKind= newEntry.getEntryKind();
IPath jarPath= newEntry.getPath();
boolean found= false;
for (int i= 0; i < nEntries; i++) {
IClasspathEntry curr= oldClasspath[i];
if (curr.getEntryKind() == entryKind && curr.getPath().equals(jarPath)) { |
4,155 | Bug 4155 Source Attachment wizard for variable classpath entries not correct (1GJ6X9P) | (1) Create a directory containing a .jar file and a .zip source archive for the jar The .zip archive should have a non-null root path to the source. (2) create a classpath variable which points to this directory (3) place this .jar file in your classpath using the variable (4) use the Java Source Attachment wizard to set the source archive Attempt to use the "root variable path". The "browse..." button is inactive unless the text field is non-empty. If the text field is non-empty, pressing the browse... button shows the source archive no matter what is in the field. If you make a selection in the paths shown that are relative to the archive, any path that is deeper than the first is entered without the intervening path variables. For example, suppose the archive resolves to c:\blort\blort.zip. I can type "junk" in the root variable path field to activate the "browse..." button. Pressing "browse..." shows the structure of "c:\blort\blort.zip". If I select work/src/main as the source root directory in blort.zip for blort.jar and press OK the text field for "root variable path" now reads: junk/main. NOTES: | resolved fixed | ffa99aa | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-21T17:40:41Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java | newEntries.add(newEntry);
found= true;
} else {
newEntries.add(curr);
}
}
if (!found) {
if (newEntry.getSourceAttachmentPath() == null || !putJarOnClasspathDialog(shell)) {
return null;
}
newEntries.add(newEntry);
}
return (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]);
}
private boolean putJarOnClasspathDialog(Shell shell) {
final boolean[] result= new boolean[1];
shell.getDisplay().syncExec(new Runnable() {
public void run() {
String title= NewWizardMessages.getString("SourceAttachmentBlock.putoncpdialog.title");
String message= NewWizardMessages.getString("SourceAttachmentBlock.putoncpdialog.message");
result[0]= MessageDialog.openQuestion(JavaPlugin.getActiveWorkbenchShell(), title, message);
}
});
return result[0];
}
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/SelectionProviderMediator.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
/**
* A selection provider for viewparts with more that one viewer.
* Tracks the focus of the viewers to provide the correct selection.
*/
public class SelectionProviderMediator implements ISelectionProvider { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/SelectionProviderMediator.java | private class InternalListener implements ISelectionChangedListener, FocusListener {
/*
* @see ISelectionChangedListener#selectionChanged
*/
public void selectionChanged(SelectionChangedEvent event) {
doSelectionChanged(event);
}
/*
* @see FocusListener#focusGained
*/
public void focusGained(FocusEvent e) {
doFocusChanged(e.widget);
}
/*
* @see FocusListener#focusLost
*/
public void focusLost(FocusEvent e) {
propagateFocusChanged(null);
}
}
private Viewer[] fViewers;
private InternalListener fListener; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/SelectionProviderMediator.java | private Viewer fViewerInFocus;
private ListenerList fSelectionChangedListeners;
/**
* @param All viewers that can provide a selection
*/
public SelectionProviderMediator(Viewer[] viewers) {
Assert.isNotNull(viewers);
fViewers= viewers;
fListener= new InternalListener();
fSelectionChangedListeners= new ListenerList(4);
fViewerInFocus= null;
for (int i= 0; i < fViewers.length; i++) {
Viewer viewer= fViewers[i];
viewer.addSelectionChangedListener(fListener);
Control control= viewer.getControl();
control.addFocusListener(fListener);
}
}
private void doFocusChanged(Widget control) {
for (int i= 0; i < fViewers.length; i++) {
if (fViewers[i].getControl() == control) {
propagateFocusChanged(fViewers[i]);
return;
}
}
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/SelectionProviderMediator.java | private void doSelectionChanged(SelectionChangedEvent event) {
ISelectionProvider provider= event.getSelectionProvider();
if (provider == fViewerInFocus) {
fireSelectionChanged();
}
}
private void propagateFocusChanged(Viewer viewer) {
if (viewer != fViewerInFocus) {
fViewerInFocus= viewer;
fireSelectionChanged();
}
}
private void fireSelectionChanged() {
if (fSelectionChangedListeners != null) {
SelectionChangedEvent event= new SelectionChangedEvent(this, getSelection());
Object[] listeners= fSelectionChangedListeners.getListeners();
for (int i= 0; i < listeners.length; i++) {
ISelectionChangedListener listener= (ISelectionChangedListener) listeners[i];
listener.selectionChanged(event);
}
}
}
/*
* @see ISelectionProvider#addSelectionChangedListener
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/SelectionProviderMediator.java | fSelectionChangedListeners.add(listener);
}
/*
* @see ISelectionProvider#removeSelectionChangedListener
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.remove(listener);
}
/*
* @see ISelectionProvider#getSelection
*/
public ISelection getSelection() {
if (fViewerInFocus != null) {
return fViewerInFocus.getSelection();
} else {
return StructuredSelection.EMPTY;
}
}
/*
* @see ISelectionProvider#setSelection
*/
public void setSelection(ISelection selection) {
if (fViewerInFocus != null) {
fViewerInFocus.setSelection(selection);
}
}
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ViewForm;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.viewers.IInputSelectionProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.OpenWithMenu;
import org.eclipse.ui.help.ViewContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.ITypeHierarchyViewPart;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.AddMethodStubAction;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.compare.JavaReplaceWithEditionAction;
import org.eclipse.jdt.internal.ui.dnd.BasicSelectionTransferDragAdapter;
import org.eclipse.jdt.internal.ui.dnd.LocalSelectionTransfer;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.packageview.BuildGroup;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringGroup;
import org.eclipse.jdt.internal.ui.reorg.ReorgGroup;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
import org.eclipse.jdt.internal.ui.viewsupport.IProblemChangedListener;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
import org.eclipse.jdt.internal.ui.viewsupport.MarkerErrorTickProvider;
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater;
/**
* view showing the supertypes/subtypes of its input.
*/
public class TypeHierarchyViewPart extends ViewPart implements ITypeHierarchyViewPart { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | public static final int VIEW_ID_TYPE= 2;
public static final int VIEW_ID_SUPER= 0;
public static final int VIEW_ID_SUB= 1;
public static final int VIEW_ORIENTATION_VERTICAL= 0;
public static final int VIEW_ORIENTATION_HORIZONTAL= 1; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | public static final int VIEW_ORIENTATION_SINGLE= 2;
private static final String DIALOGSTORE_HIERARCHYVIEW= "TypeHierarchyViewPart.hierarchyview";
private static final String DIALOGSTORE_VIEWORIENTATION= "TypeHierarchyViewPart.orientation";
private static final String TAG_INPUT= "input";
private static final String TAG_VIEW= "view";
private static final String TAG_ORIENTATION= "orientation";
private static final String TAG_RATIO= "ratio";
private static final String TAG_SELECTION= "selection";
private static final String TAG_VERTICAL_SCROLL= "vertical_scroll";
private IType fSelectedType;
private IJavaElement fInputElement;
private ArrayList fInputHistory;
private IMemento fMemento;
private IProblemChangedListener fHierarchyProblemListener;
private TypeHierarchyLifeCycle fHierarchyLifeCycle;
private ITypeHierarchyLifeCycleListener fTypeHierarchyLifeCycleListener;
private MethodsViewer fMethodsViewer;
private int fCurrentViewerIndex;
private TypeHierarchyViewer[] fAllViewers; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | private boolean fIsEnableMemberFilter;
private SashForm fTypeMethodsSplitter;
private PageBook fViewerbook;
private PageBook fPagebook;
private Label fNoHierarchyShownLabel;
private Label fEmptyTypesViewer;
private ViewForm fTypeViewerViewForm;
private ViewForm fMethodViewerViewForm;
private CLabel fMethodViewerPaneLabel;
private JavaElementLabelProvider fPaneLabelProvider;
private IDialogSettings fDialogSettings;
private ToggleViewAction[] fViewActions;
private HistoryDropDownAction fHistoryDropDownAction;
private ToggleOrientationAction[] fToggleOrientationActions;
private int fCurrentOrientation;
private EnableMemberFilterAction fEnableMemberFilterAction;
private AddMethodStubAction fAddStubAction;
private FocusOnTypeAction fFocusOnTypeAction;
private FocusOnSelectionAction fFocusOnSelectionAction;
private IPartListener fPartListener; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | public TypeHierarchyViewPart() {
fSelectedType= null;
fInputElement= null;
fHierarchyLifeCycle= new TypeHierarchyLifeCycle();
fTypeHierarchyLifeCycleListener= new ITypeHierarchyLifeCycleListener() {
public void typeHierarchyChanged(TypeHierarchyLifeCycle typeHierarchy, IType[] changedTypes) {
doTypeHierarchyChanged(typeHierarchy, changedTypes);
}
};
fHierarchyLifeCycle.addChangedListener(fTypeHierarchyLifeCycleListener);
fHierarchyProblemListener= null;
fIsEnableMemberFilter= false;
fInputHistory= new ArrayList();
fAllViewers= null;
fViewActions= new ToggleViewAction[] {
new ToggleViewAction(this, VIEW_ID_TYPE),
new ToggleViewAction(this, VIEW_ID_SUPER),
new ToggleViewAction(this, VIEW_ID_SUB)
};
fDialogSettings= JavaPlugin.getDefault().getDialogSettings();
fHistoryDropDownAction= new HistoryDropDownAction(this); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | fToggleOrientationActions= new ToggleOrientationAction[] {
new ToggleOrientationAction(this, VIEW_ORIENTATION_VERTICAL),
new ToggleOrientationAction(this, VIEW_ORIENTATION_HORIZONTAL),
new ToggleOrientationAction(this, VIEW_ORIENTATION_SINGLE)
};
fEnableMemberFilterAction= new EnableMemberFilterAction(this, false);
fFocusOnTypeAction= new FocusOnTypeAction(this);
fPaneLabelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_BASICS);
fPaneLabelProvider.setErrorTickManager(new MarkerErrorTickProvider());
fAddStubAction= new AddMethodStubAction();
fFocusOnSelectionAction= new FocusOnSelectionAction(this);
fPartListener= new IPartListener() {
public void partActivated(IWorkbenchPart part) {
if (part instanceof IEditorPart)
editorActivated((IEditorPart) part);
}
public void partBroughtToTop(IWorkbenchPart part) {}
public void partClosed(IWorkbenchPart part) {}
public void partDeactivated(IWorkbenchPart part) {}
public void partOpened(IWorkbenchPart part) {}
};
}
/**
* Adds the entry if new. Inserted at the beginning of the history entries list. |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | */
private void addHistoryEntry(IJavaElement entry) {
if (fInputHistory.contains(entry)) {
fInputHistory.remove(entry);
}
fInputHistory.add(0, entry);
}
private void updateHistoryEntries() {
for (int i= fInputHistory.size() - 1; i >= 0; i--) {
IJavaElement type= (IJavaElement) fInputHistory.get(i);
if (!type.exists()) {
fInputHistory.remove(i);
}
}
}
/**
* Goes to the selected entry, without updating the order of history entries.
*/
public void gotoHistoryEntry(IJavaElement entry) {
if (fInputHistory.contains(entry)) {
updateInput(entry);
}
}
/**
* Gets all history entries.
*/
public IJavaElement[] getHistoryEntries() { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | updateHistoryEntries();
return (IJavaElement[]) fInputHistory.toArray(new IJavaElement[fInputHistory.size()]);
}
/**
* Sets the history entries
*/
public void setHistoryEntries(IJavaElement[] elems) {
fInputHistory.clear();
for (int i= 0; i < elems.length; i++) {
fInputHistory.add(elems[i]);
}
updateHistoryEntries();
}
/**
* Selects an member in the methods list
*/
public void selectMember(IMember member) {
ICompilationUnit cu= member.getCompilationUnit();
if (cu != null && cu.isWorkingCopy()) {
member= (IMember) cu.getOriginal(member);
if (member == null) {
return;
}
}
Control methodControl= fMethodsViewer.getControl();
if (methodControl != null && !methodControl.isDisposed()) {
fMethodsViewer.getControl().setFocus();
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | fMethodsViewer.setSelection(new StructuredSelection(member), true);
}
/**
* @deprecated
*/
public IType getInput() {
if (fInputElement instanceof IType) {
return (IType) fInputElement;
}
return null;
}
/**
* Sets the input to a new type
* @deprecated
*/
public void setInput(IType type) {
setInputElement(type);
}
/**
* Returns the input element of the type hierarchy.
* Can be of type <code>IType</code> or <code>IPackageFragment</code>
*/
public IJavaElement getInputElement() {
return fInputElement;
}
/**
* Sets the input to a new element. |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | */
public void setInputElement(IJavaElement element) {
if (element != null) {
if (element instanceof IMember) {
ICompilationUnit cu= ((IMember) element).getCompilationUnit();
if (cu != null && cu.isWorkingCopy()) {
element= cu.getOriginal(element);
}
if (element.getElementType() == IJavaElement.METHOD || element.getElementType() == IJavaElement.FIELD || element.getElementType() == IJavaElement.INITIALIZER) {
element= ((IMember) element).getDeclaringType();
}
}
}
if (element != null && !element.equals(fInputElement)) {
addHistoryEntry(element);
}
updateInput(element);
}
/**
* Changes the input to a new type
*/
private void updateInput(IJavaElement inputElement) {
IJavaElement prevInput= fInputElement;
fInputElement= inputElement;
if (fInputElement == null) {
clearInput(); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | } else {
enableMemberFilter(false);
try {
fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElement);
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
clearInput();
return;
}
fPagebook.showPage(fTypeMethodsSplitter);
if (inputElement.getElementType() != IJavaElement.TYPE) {
setView(VIEW_ID_TYPE);
}
if (!fInputElement.equals(prevInput)) {
updateHierarchyViewer();
}
updateSelection(fInputElement);
updateToolbarButtons();
updateTitle();
}
}
private void clearInput() {
fInputElement= null;
fHierarchyLifeCycle.freeHierarchy(); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | updateHierarchyViewer();
updateToolbarButtons();
}
/*
* @see IWorbenchPart#setFocus
*/
public void setFocus() {
fPagebook.setFocus();
}
/*
* @see IWorkbenchPart#dispose
*/
public void dispose() {
fHierarchyLifeCycle.freeHierarchy();
fHierarchyLifeCycle.removeChangedListener(fTypeHierarchyLifeCycleListener);
fPaneLabelProvider.dispose();
getSite().getPage().removePartListener(fPartListener);
if (fHierarchyProblemListener != null) {
JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fHierarchyProblemListener);
}
if (fMethodsViewer != null) {
JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fMethodsViewer);
}
super.dispose();
}
private Control createTypeViewerControl(Composite parent) {
fViewerbook= new PageBook(parent, SWT.NULL);
ISelectionChangedListener selectionChangedListener= new ISelectionChangedListener() { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | public void selectionChanged(SelectionChangedEvent event) {
typeSelectionChanged(event.getSelection());
}
};
KeyListener keyListener= createKeyListener();
HierarchyLabelProvider lprovider= new HierarchyLabelProvider(this, new MarkerErrorTickProvider());
TypeHierarchyViewer superTypesViewer= new SuperTypeHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
initializeTypesViewer(superTypesViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_SUPERTYPES_VIEW);
TypeHierarchyViewer subTypesViewer= new SubTypeHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
initializeTypesViewer(subTypesViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_SUBTYPES_VIEW);
TypeHierarchyViewer vajViewer= new TraditionalHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
initializeTypesViewer(vajViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_HIERARCHY_VIEW);
fAllViewers= new TypeHierarchyViewer[3];
fAllViewers[VIEW_ID_SUPER]= superTypesViewer;
fAllViewers[VIEW_ID_SUB]= subTypesViewer;
fAllViewers[VIEW_ID_TYPE]= vajViewer;
int currViewerIndex;
try {
currViewerIndex= fDialogSettings.getInt(DIALOGSTORE_HIERARCHYVIEW);
if (currViewerIndex < 0 || currViewerIndex > 2) {
currViewerIndex= VIEW_ID_TYPE;
}
} catch (NumberFormatException e) { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | currViewerIndex= VIEW_ID_TYPE;
}
fEmptyTypesViewer= new Label(fViewerbook, SWT.LEFT);
for (int i= 0; i < fAllViewers.length; i++) {
fAllViewers[i].setInput(fAllViewers[i]);
}
fCurrentViewerIndex= -1;
setView(currViewerIndex);
return fViewerbook;
}
private KeyListener createKeyListener() {
return new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.stateMask == 0) {
if (event.keyCode == SWT.F4) {
OpenTypeHierarchyUtil.open(getSite().getSelectionProvider().getSelection(), getSite().getWorkbenchWindow());
return;
} else if (event.keyCode == SWT.F5) {
updateHierarchyViewer();
return;
}
}
viewPartKeyShortcuts(event);
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | };
}
private void initializeTypesViewer(final TypeHierarchyViewer typesViewer, ISelectionChangedListener selectionChangedListener, KeyListener keyListener, String cotextHelpId) {
typesViewer.getControl().setVisible(false);
typesViewer.getControl().addKeyListener(keyListener);
typesViewer.initContextMenu(new IMenuListener() {
public void menuAboutToShow(IMenuManager menu) {
fillTypesViewerContextMenu(typesViewer, menu);
}
}, cotextHelpId, getSite());
typesViewer.addSelectionChangedListener(selectionChangedListener);
}
private Control createMethodViewerControl(Composite parent) {
fMethodsViewer= new MethodsViewer(parent, this);
fMethodsViewer.initContextMenu(new IMenuListener() {
public void menuAboutToShow(IMenuManager menu) {
fillMethodsViewerContextMenu(menu);
}
}, IContextMenuConstants.TARGET_ID_MEMBERS_VIEW, getSite());
fMethodsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
methodSelectionChanged(event.getSelection());
}
});
Control control= fMethodsViewer.getTable();
control.addKeyListener(createKeyListener());
JavaPlugin.getDefault().getProblemMarkerManager().addListener(fMethodsViewer); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | return control;
}
private void initDragAndDrop() {
Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance() };
int ops= DND.DROP_COPY;
DragSource source= new DragSource(fMethodsViewer.getControl(), ops);
source.setTransfer(transfers);
source.addDragListener(new BasicSelectionTransferDragAdapter(fMethodsViewer));
for (int i= 0; i < fAllViewers.length; i++) {
TypeHierarchyViewer curr= fAllViewers[i];
curr.addDropSupport(ops, transfers, new TypeHierarchyTransferDropAdapter(curr));
}
}
private void viewPartKeyShortcuts(KeyEvent event) {
if (event.stateMask == SWT.CTRL) {
if (event.character == '1') {
setView(VIEW_ID_TYPE);
} else if (event.character == '2') {
setView(VIEW_ID_SUPER);
} else if (event.character == '3') {
setView(VIEW_ID_SUB);
}
}
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | /**
* Returns the inner component in a workbench part.
* @see IWorkbenchPart#createPartControl
*/
public void createPartControl(Composite container) {
fPagebook= new PageBook(container, SWT.NONE);
fTypeMethodsSplitter= new SashForm(fPagebook, SWT.VERTICAL);
fTypeMethodsSplitter.setVisible(false);
fTypeViewerViewForm= new ViewForm(fTypeMethodsSplitter, SWT.NONE);
Control typeViewerControl= createTypeViewerControl(fTypeViewerViewForm);
fTypeViewerViewForm.setContent(typeViewerControl);
fMethodViewerViewForm= new ViewForm(fTypeMethodsSplitter, SWT.NONE);
fTypeMethodsSplitter.setWeights(new int[] {35, 65});
Control methodViewerPart= createMethodViewerControl(fMethodViewerViewForm);
fMethodViewerViewForm.setContent(methodViewerPart);
fMethodViewerPaneLabel= new CLabel(fMethodViewerViewForm, SWT.NONE);
fMethodViewerViewForm.setTopLeft(fMethodViewerPaneLabel);
initDragAndDrop();
ToolBar methodViewerToolBar= new ToolBar(fMethodViewerViewForm, SWT.FLAT | SWT.WRAP);
fMethodViewerViewForm.setTopCenter(methodViewerToolBar); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | fNoHierarchyShownLabel= new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
fNoHierarchyShownLabel.setText(TypeHierarchyMessages.getString("TypeHierarchyViewPart.empty"));
MenuManager menu= new MenuManager();
menu.add(fFocusOnTypeAction);
fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
fPagebook.showPage(fNoHierarchyShownLabel);
int orientation;
try {
orientation= fDialogSettings.getInt(DIALOGSTORE_VIEWORIENTATION);
if (orientation < 0 || orientation > 2) {
orientation= VIEW_ORIENTATION_VERTICAL;
}
} catch (NumberFormatException e) {
orientation= VIEW_ORIENTATION_VERTICAL;
}
fCurrentOrientation= -1;
setOrientation(orientation);
IActionBars actionBars= getViewSite().getActionBars();
IMenuManager viewMenu= actionBars.getMenuManager();
for (int i= 0; i < fToggleOrientationActions.length; i++) {
viewMenu.add(fToggleOrientationActions[i]);
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | ToolBarManager lowertbmanager= new ToolBarManager(methodViewerToolBar);
lowertbmanager.add(fEnableMemberFilterAction);
lowertbmanager.add(new Separator());
fMethodsViewer.contributeToToolBar(lowertbmanager);
lowertbmanager.update(true);
int nHierarchyViewers= fAllViewers.length;
Viewer[] trackedViewers= new Viewer[nHierarchyViewers + 1];
for (int i= 0; i < nHierarchyViewers; i++) {
trackedViewers[i]= fAllViewers[i];
}
trackedViewers[nHierarchyViewers]= fMethodsViewer;
ISelectionProvider selProvider= new SelectionProviderMediator(trackedViewers);
IStatusLineManager slManager= getViewSite().getActionBars().getStatusLineManager();
selProvider.addSelectionChangedListener(new StatusBarUpdater(slManager));
getSite().setSelectionProvider(selProvider);
getSite().getPage().addPartListener(fPartListener);
IJavaElement input= determineInputElement();
if (fMemento != null) {
restoreState(fMemento, input);
} else if (input != null) {
setInputElement(input);
} else {
setViewerVisibility(false);
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | WorkbenchHelp.setHelp(fPagebook, new ViewContextComputer(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW));
}
/**
* called from ToggleOrientationAction.
* @param orientation VIEW_ORIENTATION_SINGLE, VIEW_ORIENTATION_HORIZONTAL or VIEW_ORIENTATION_VERTICAL
*/
public void setOrientation(int orientation) {
if (fCurrentOrientation != orientation) {
boolean methodViewerNeedsUpdate= false;
if (fMethodViewerViewForm != null && !fMethodViewerViewForm.isDisposed()
&& fTypeMethodsSplitter != null && !fTypeMethodsSplitter.isDisposed()) {
if (orientation == VIEW_ORIENTATION_SINGLE) {
fMethodViewerViewForm.setVisible(false);
enableMemberFilter(false);
updateMethodViewer(null);
} else {
if (fCurrentOrientation == VIEW_ORIENTATION_SINGLE) {
fMethodViewerViewForm.setVisible(true);
methodViewerNeedsUpdate= true;
}
boolean horizontal= orientation == VIEW_ORIENTATION_HORIZONTAL;
fTypeMethodsSplitter.setOrientation(horizontal ? SWT.HORIZONTAL : SWT.VERTICAL);
updateMainToolbar(horizontal);
}
fTypeMethodsSplitter.layout();
}
for (int i= 0; i < fToggleOrientationActions.length; i++) {
fToggleOrientationActions[i].setChecked(orientation == fToggleOrientationActions[i].getOrientation()); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
fCurrentOrientation= orientation;
if (methodViewerNeedsUpdate) {
updateMethodViewer(fSelectedType);
}
fDialogSettings.put(DIALOGSTORE_VIEWORIENTATION, orientation);
}
}
private void updateMainToolbar(boolean horizontal) {
IActionBars actionBars= getViewSite().getActionBars();
IToolBarManager tbmanager= actionBars.getToolBarManager();
if (horizontal) {
clearMainToolBar(tbmanager);
ToolBar typeViewerToolBar= new ToolBar(fTypeViewerViewForm, SWT.FLAT | SWT.WRAP);
fillMainToolBar(new ToolBarManager(typeViewerToolBar));
fTypeViewerViewForm.setTopLeft(typeViewerToolBar);
} else {
fTypeViewerViewForm.setTopLeft(null);
fillMainToolBar(tbmanager);
}
}
private void fillMainToolBar(IToolBarManager tbmanager) {
tbmanager.removeAll();
tbmanager.add(fHistoryDropDownAction);
for (int i= 0; i < fViewActions.length; i++) {
tbmanager.add(fViewActions[i]); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
tbmanager.update(false);
}
private void clearMainToolBar(IToolBarManager tbmanager) {
tbmanager.removeAll();
tbmanager.update(false);
}
/**
* Creates the context menu for the hierarchy viewers
*/
private void fillTypesViewerContextMenu(TypeHierarchyViewer viewer, IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
viewer.contributeToContextMenu(menu);
IStructuredSelection selection= (IStructuredSelection)viewer.getSelection();
if (JavaBasePreferencePage.openTypeHierarchyInPerspective()) {
addOpenPerspectiveItem(menu, selection);
}
addOpenWithMenu(menu, selection);
menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fFocusOnTypeAction);
if (fFocusOnSelectionAction.canActionBeAdded())
menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fFocusOnSelectionAction);
addRefactoring(menu, viewer);
ContextMenuGroup.add(menu, new ContextMenuGroup[] { new BuildGroup(), new ReorgGroup() }, viewer);
}
/** |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | * Creates the context menu for the method viewer
*/
private void fillMethodsViewerContextMenu(IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
fMethodsViewer.contributeToContextMenu(menu);
if (fSelectedType != null && fAddStubAction.init(fSelectedType, fMethodsViewer.getSelection())) {
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fAddStubAction);
}
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new JavaReplaceWithEditionAction(fMethodsViewer));
addOpenWithMenu(menu, (IStructuredSelection)fMethodsViewer.getSelection());
addRefactoring(menu, fMethodsViewer);
ContextMenuGroup.add(menu, new ContextMenuGroup[] { new BuildGroup(), new ReorgGroup() }, fMethodsViewer);
}
private void addRefactoring(IMenuManager menu, IInputSelectionProvider viewer){
MenuManager refactoring= new MenuManager(TypeHierarchyMessages.getString("TypeHierarchyViewPart.menu.refactor"));
ContextMenuGroup.add(refactoring, new ContextMenuGroup[] { new RefactoringGroup() }, viewer);
if (!refactoring.isEmpty())
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, refactoring);
}
private void addOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
if (selection.size() != 1)
return;
Object element= selection.getFirstElement();
if (!(element instanceof IJavaElement))
return; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | IResource resource= null;
try {
resource= ((IJavaElement)element).getUnderlyingResource();
} catch(JavaModelException e) {
}
if (!(resource instanceof IFile))
return;
MenuManager submenu= new MenuManager(TypeHierarchyMessages.getString("TypeHierarchyViewPart.menu.open"));
submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource));
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
private void addOpenPerspectiveItem(IMenuManager menu, IStructuredSelection selection) {
OpenTypeHierarchyUtil.addToMenu(getSite().getWorkbenchWindow(), menu, selection);
}
/**
* Toggles between the empty viewer page and the hierarchy
*/
private void setViewerVisibility(boolean showHierarchy) {
if (showHierarchy) {
fViewerbook.showPage(getCurrentViewer().getControl());
} else {
fViewerbook.showPage(fEmptyTypesViewer);
}
}
/**
* Sets the member filter. <code>null</code> disables member filtering. |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | */
private void setMemberFilter(IMember[] memberFilter) {
Assert.isNotNull(fAllViewers);
for (int i= 0; i < fAllViewers.length; i++) {
fAllViewers[i].setMemberFilter(memberFilter);
}
updateHierarchyViewer();
updateTitle();
}
private void updateSelection(IJavaElement elem) {
ISelection sel= null;
if (elem.getElementType() != IJavaElement.TYPE) {
Object obj= getCurrentViewer().containsElements();
if (obj != null) {
sel= new StructuredSelection(obj);
} else {
sel= StructuredSelection.EMPTY;
}
} else {
sel= new StructuredSelection(elem);
}
getCurrentViewer().setSelection(sel);
}
/**
* When the input changed or the hierarchy pane becomes visible,
* <code>updateHierarchyViewer<code> brings up the correct view and refreshes
* the current tree
*/ |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | private void updateHierarchyViewer() {
if (fInputElement == null) {
fPagebook.showPage(fNoHierarchyShownLabel);
} else {
if (getCurrentViewer().containsElements() != null) {
Runnable runnable= new Runnable() {
public void run() {
getCurrentViewer().updateContent();
}
};
BusyIndicator.showWhile(getDisplay(), runnable);
if (!isChildVisible(fViewerbook, getCurrentViewer().getControl())) {
setViewerVisibility(true);
}
} else {
fEmptyTypesViewer.setText(TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.nodecl", fInputElement.getElementName()));
setViewerVisibility(false);
}
}
}
private void updateMethodViewer(IType input) {
if (input != fMethodsViewer.getInput() && !fIsEnableMemberFilter && fCurrentOrientation != VIEW_ORIENTATION_SINGLE) {
if (input != null) {
fMethodViewerPaneLabel.setText(fPaneLabelProvider.getText(input));
fMethodViewerPaneLabel.setImage(fPaneLabelProvider.getImage(input));
} else {
fMethodViewerPaneLabel.setText("");
fMethodViewerPaneLabel.setImage(null);
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | fMethodsViewer.setInput(input);
}
}
private void methodSelectionChanged(ISelection sel) {
if (sel instanceof IStructuredSelection) {
List selected= ((IStructuredSelection)sel).toList();
int nSelected= selected.size();
if (fIsEnableMemberFilter) {
IMember[] memberFilter= null;
if (nSelected > 0) {
memberFilter= new IMember[nSelected];
selected.toArray(memberFilter);
}
setMemberFilter(memberFilter);
}
if (nSelected == 1) {
revealElementInEditor(selected.get(0));
}
}
}
private void typeSelectionChanged(ISelection sel) {
if (sel instanceof IStructuredSelection) {
List selected= ((IStructuredSelection)sel).toList();
int nSelected= selected.size();
if (nSelected != 0) {
List types= new ArrayList(nSelected);
for (int i= nSelected-1; i >= 0; i--) {
Object elem= selected.get(i); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | if (elem instanceof IType && !types.contains(elem)) {
types.add(elem);
}
}
if (types.size() == 1) {
fSelectedType= (IType) types.get(0);
updateMethodViewer(fSelectedType);
} else if (types.size() == 0) {
}
if (nSelected == 1) {
revealElementInEditor(selected.get(0));
}
} else {
fSelectedType= null;
updateMethodViewer(null);
}
}
}
private void revealElementInEditor(Object elem) {
if (getSite().getPage().getActivePart() != this) {
return;
}
IEditorPart editorPart= EditorUtility.isOpenInEditor(elem);
if (editorPart != null && (elem instanceof IJavaElement)) {
try { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | getSite().getPage().removePartListener(fPartListener);
EditorUtility.openInEditor(elem, false);
EditorUtility.revealInEditor(editorPart, (IJavaElement) elem);
getSite().getPage().addPartListener(fPartListener);
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
}
private Display getDisplay() {
if (fPagebook != null && !fPagebook.isDisposed()) {
return fPagebook.getDisplay();
}
return null;
}
private boolean isChildVisible(Composite pb, Control child) {
Control[] children= pb.getChildren();
for (int i= 0; i < children.length; i++) {
if (children[i] == child && children[i].isVisible())
return true;
}
return false;
}
private void updateTitle() {
String viewerTitle= getCurrentViewer().getTitle();
String tooltip; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | String title;
if (fInputElement != null) {
String[] args= new String[] { viewerTitle, JavaElementLabels.getElementLabel(fInputElement, JavaElementLabels.ALL_DEFAULT) };
title= TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.title", args);
tooltip= TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.tooltip", args);
} else {
title= viewerTitle;
tooltip= viewerTitle;
}
setTitle(title);
setTitleToolTip(tooltip);
}
private void updateToolbarButtons() {
boolean isType= fInputElement instanceof IType;
for (int i= 0; i < fViewActions.length; i++) {
ToggleViewAction action= fViewActions[i];
if (action.getViewerIndex() == VIEW_ID_TYPE) {
action.setEnabled(fInputElement != null);
} else {
action.setEnabled(isType);
}
}
}
/**
* Sets the current view (see view id)
* called from ToggleViewAction. Must be called after creation of the viewpart.
*/
public void setView(int viewerIndex) { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | Assert.isNotNull(fAllViewers);
if (viewerIndex < fAllViewers.length && fCurrentViewerIndex != viewerIndex) {
fCurrentViewerIndex= viewerIndex;
updateHierarchyViewer();
if (fInputElement != null) {
ISelection currSelection= getCurrentViewer().getSelection();
if (currSelection == null || currSelection.isEmpty()) {
updateSelection(fInputElement);
}
if (!fIsEnableMemberFilter) {
typeSelectionChanged(getCurrentViewer().getSelection());
}
}
updateTitle();
if (fHierarchyProblemListener != null) {
JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fHierarchyProblemListener);
}
fHierarchyProblemListener= getCurrentViewer();
JavaPlugin.getDefault().getProblemMarkerManager().addListener(fHierarchyProblemListener);
fDialogSettings.put(DIALOGSTORE_HIERARCHYVIEW, viewerIndex);
getCurrentViewer().getTree().setFocus();
}
for (int i= 0; i < fViewActions.length; i++) {
ToggleViewAction action= fViewActions[i];
action.setChecked(fCurrentViewerIndex == action.getViewerIndex());
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
/**
* Gets the curret active view index.
*/
public int getViewIndex() {
return fCurrentViewerIndex;
}
private TypeHierarchyViewer getCurrentViewer() {
return fAllViewers[fCurrentViewerIndex];
}
/**
* called from EnableMemberFilterAction.
* Must be called after creation of the viewpart.
*/
public void enableMemberFilter(boolean on) {
if (on != fIsEnableMemberFilter) {
fIsEnableMemberFilter= on;
if (!on) {
Object methodViewerInput= fMethodsViewer.getInput();
setMemberFilter(null);
if (methodViewerInput != null && getCurrentViewer().isElementShown(methodViewerInput)) {
getCurrentViewer().setSelection(new StructuredSelection(methodViewerInput));
} else if (fSelectedType != null) {
getCurrentViewer().setSelection(new StructuredSelection(fSelectedType));
updateMethodViewer(fSelectedType);
}
} else { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | methodSelectionChanged(fMethodsViewer.getSelection());
}
}
fEnableMemberFilterAction.setChecked(on);
}
/**
* Called from ITypeHierarchyLifeCycleListener.
* Can be called from any thread
*/
private void doTypeHierarchyChanged(final TypeHierarchyLifeCycle typeHierarchy, final IType[] changedTypes) {
Display display= getDisplay();
if (display != null) {
display.asyncExec(new Runnable() {
public void run() {
doTypeHierarchyChangedOnViewers(changedTypes);
}
});
}
}
private void doTypeHierarchyChangedOnViewers(IType[] changedTypes) {
if (changedTypes == null) {
if (fHierarchyLifeCycle.getHierarchy() == null || !fHierarchyLifeCycle.getHierarchy().exists()) {
clearInput();
} else {
try {
fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElement);
} catch (JavaModelException e) { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | JavaPlugin.log(e.getStatus());
clearInput();
return;
}
updateHierarchyViewer();
}
} else {
if (getCurrentViewer().isMethodFiltering()) {
if (changedTypes.length == 1) {
getCurrentViewer().refresh(changedTypes[0]);
} else {
updateHierarchyViewer();
}
} else {
getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE } );
}
}
}
/**
* Determines the input element to be used initially .
*/
private IJavaElement determineInputElement() {
Object input= getSite().getPage().getInput();
if (input instanceof IJavaElement) {
return (IJavaElement) input;
}
return null; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
/*
* @see IViewPart#init
*/
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
fMemento= memento;
}
/*
* @see ViewPart#saveState(IMemento)
*/
public void saveState(IMemento memento) {
if (fPagebook == null) {
if (fMemento != null) {
memento.putMemento(fMemento);
}
return;
}
if (fInputElement != null) {
memento.putString(TAG_INPUT, fInputElement.getHandleIdentifier());
}
memento.putInteger(TAG_VIEW, getViewIndex());
memento.putInteger(TAG_ORIENTATION, fCurrentOrientation);
int weigths[]= fTypeMethodsSplitter.getWeights();
int ratio= (weigths[0] * 1000) / (weigths[0] + weigths[1]);
memento.putInteger(TAG_RATIO, ratio); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
int position= bar != null ? bar.getSelection() : 0;
memento.putInteger(TAG_VERTICAL_SCROLL, position);
IJavaElement selection= (IJavaElement)((IStructuredSelection) getCurrentViewer().getSelection()).getFirstElement();
if (selection != null) {
memento.putString(TAG_SELECTION, selection.getHandleIdentifier());
}
fMethodsViewer.saveState(memento);
}
/**
* Restores the type hierarchy settings from a memento.
*/
private void restoreState(IMemento memento, IJavaElement defaultInput) {
IJavaElement input= defaultInput;
String elementId= memento.getString(TAG_INPUT);
if (elementId != null) {
input= JavaCore.create(elementId);
if (!input.exists()) {
input= null;
}
}
setInputElement(input);
Integer viewerIndex= memento.getInteger(TAG_VIEW);
if (viewerIndex != null) {
setView(viewerIndex.intValue());
}
Integer orientation= memento.getInteger(TAG_ORIENTATION);
if (orientation != null) { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | setOrientation(orientation.intValue());
}
Integer ratio= memento.getInteger(TAG_RATIO);
if (ratio != null) {
fTypeMethodsSplitter.setWeights(new int[] { ratio.intValue(), 1000 - ratio.intValue() });
}
ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
if (bar != null) {
Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL);
if (vScroll != null) {
bar.setSelection(vScroll.intValue());
}
}
String selectionId= memento.getString(TAG_SELECTION);
if (selectionId != null) {
IJavaElement elem= JavaCore.create(selectionId);
if (getCurrentViewer().isElementShown(elem)) {
getCurrentViewer().setSelection(new StructuredSelection(elem));
}
}
fMethodsViewer.restoreState(memento);
}
/**
* Link selection to active editor.
*/
private void editorActivated(IEditorPart editor) {
if (!JavaBasePreferencePage.linkTypeHierarchySelectionToEditor()) {
return; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
if (fInputElement == null) {
return;
}
IJavaElement elem= (IJavaElement)editor.getEditorInput().getAdapter(IJavaElement.class);
try {
TypeHierarchyViewer currentViewer= getCurrentViewer();
if (elem instanceof IClassFile) {
IType type= ((IClassFile)elem).getType();
if (currentViewer.isElementShown(type)) {
currentViewer.setSelection(new StructuredSelection(type));
}
} else if (elem instanceof ICompilationUnit) {
IType[] allTypes= ((ICompilationUnit)elem).getAllTypes();
for (int i= 0; i < allTypes.length; i++) {
if (currentViewer.isElementShown(allTypes[i])) {
currentViewer.setSelection(new StructuredSelection(allTypes[i]));
return;
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite; |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GenerateGroup;
import org.eclipse.jdt.internal.ui.actions.OpenJavaElementAction;
import org.eclipse.jdt.internal.ui.actions.ShowInPackageViewAction;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.ui.viewsupport.IProblemChangedListener;
import org.eclipse.jdt.internal.ui.viewsupport.MarkerErrorTickProvider;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer;
import org.eclipse.jdt.internal.ui.wizards.NewGroup;
public abstract class TypeHierarchyViewer extends ProblemTreeViewer implements IProblemChangedListener { |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | private OpenJavaElementAction fOpen;
private ShowInPackageViewAction fShowInPackageViewAction;
private ContextMenuGroup[] fStandardGroups;
public TypeHierarchyViewer(Composite parent, IContentProvider contentProvider, ILabelProvider lprovider, IWorkbenchPart part) {
super(new Tree(parent, SWT.SINGLE));
setContentProvider(contentProvider);
setLabelProvider(lprovider);
setSorter(new ViewerSorter() {
public boolean isSorterProperty(Object element, Object property) {
return true;
}
public int category(Object element) {
if (element instanceof IType) {
try {
return (((IType)element).isInterface()) ? 2 : 1;
} catch (JavaModelException e) {
}
} else if (element instanceof IMember) {
return 0;
}
return 3;
}
});
fOpen= new OpenJavaElementAction(this); |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
fOpen.run();
}
});
fShowInPackageViewAction= new ShowInPackageViewAction();
fStandardGroups= new ContextMenuGroup[] {
new JavaSearchGroup(), new NewGroup(), new GenerateGroup()
};
}
/**
* Attaches a contextmenu listener to the tree
*/
public void initContextMenu(IMenuListener menuListener, String popupId, IWorkbenchPartSite viewSite) {
MenuManager menuMgr= new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(menuListener);
Menu menu= menuMgr.createContextMenu(getTree());
getTree().setMenu(menu);
viewSite.registerContextMenu(popupId, menuMgr, this);
}
/**
* Fills up the context menu with items for the hierarchy viewer
* Should be called by the creator of the context menu
*/
public void contributeToContextMenu(IMenuManager menu) {
if (fOpen.canActionBeAdded()) {
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpen);
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fShowInPackageViewAction);
ContextMenuGroup.add(menu, fStandardGroups, this);
}
/**
* Set the member filter
*/
public void setMemberFilter(IMember[] memberFilter) {
getHierarchyContentProvider().setMemberFilter(memberFilter);
}
/**
* Returns if method filtering is enabled.
*/
public boolean isMethodFiltering() {
return getHierarchyContentProvider().getMemberFilter() != null;
}
/**
* Returns true if the hierarchy contains elements. Returns one of them
* With member filtering it is possible that no elements are visible
*/
public Object containsElements() {
Object[] elements= ((IStructuredContentProvider)getContentProvider()).getElements(null);
if (elements.length > 0) {
return elements[0];
}
return null;
} |
5,475 | Bug 5475 F4 causes loss of context when called from a method view | 1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again. | resolved fixed | 798e9a2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T10:51:58Z" | "2001-11-02T16:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java | /**
* Returns true if the hierarchy contains element the element.
*/
public boolean isElementShown(Object element) {
return findItem(element) != null;
}
/**
* Updates the content of this viewer: refresh and expanding the tree in the way wanted.
*/
public abstract void updateContent();
/**
* Returns the title for the current view
*/
public abstract String getTitle();
/*
* @see StructuredViewer#setContentProvider
* Content provider must be of type TypeHierarchyContentProvider
*/
public void setContentProvider(IContentProvider cp) {
Assert.isTrue(cp instanceof TypeHierarchyContentProvider);
super.setContentProvider(cp);
}
protected TypeHierarchyContentProvider getHierarchyContentProvider() {
return (TypeHierarchyContentProvider)getContentProvider();
}
} |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
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.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp; |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
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.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
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.StringDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
public class NewPackageCreationWizardPage extends ContainerPage {
private static final String PAGE_NAME= "NewPackageCreationWizardPage";
protected static final String PACKAGE= "NewPackageCreationWizardPage.package";
private StringDialogField fPackageDialogField;
/**
* Status of last validation of the package field
*/
protected IStatus fPackageStatus;
private IPackageFragment fCreatedPackageFragment; |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | public NewPackageCreationWizardPage(IWorkspaceRoot root) {
super(PAGE_NAME, root);
setTitle(NewWizardMessages.getString("NewPackageCreationWizardPage.title"));
setDescription(NewWizardMessages.getString("NewPackageCreationWizardPage.description"));
fCreatedPackageFragment= null;
PackageFieldAdapter adapter= new PackageFieldAdapter();
fPackageDialogField= new StringDialogField();
fPackageDialogField.setDialogFieldListener(adapter);
fPackageDialogField.setLabelText(NewWizardMessages.getString("NewPackageCreationWizardPage.package.label"));
fPackageStatus= new StatusInfo();
}
/**
* Should be called from the wizard with the input element.
*/
public void init(IStructuredSelection selection) {
IJavaElement jelem= getInitialJavaElement(selection);
initContainerPage(jelem);
setPackageText("");
updateStatus(findMostSevereStatus());
}
/** |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | * @see WizardPage#createControl
*/
public void createControl(Composite parent) {
Composite composite= new Composite(parent, SWT.NONE);
int nColumns= 3;
MGridLayout layout= new MGridLayout();
layout.marginWidth= 0;
layout.marginHeight= 0;
layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, composite);
layout.minimumHeight= SWTUtil.convertHeightInCharsToPixels(20, composite);
layout.numColumns= 3;
composite.setLayout(layout);
createContainerControls(composite, nColumns);
createPackageControls(composite, nColumns);
fPackageDialogField.setFocus();
setControl(composite);
WorkbenchHelp.setHelp(composite, new DialogPageContextComputer(this, IJavaHelpContextIds.NEW_PACKAGE_WIZARD_PAGE));
}
protected void createPackageControls(Composite composite, int nColumns) {
fPackageDialogField.doFillIntoGrid(composite, nColumns - 1);
DialogField.createEmptySpace(composite);
}
private class PackageFieldAdapter implements IDialogFieldListener { |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | public void dialogFieldChanged(DialogField field) {
fPackageStatus= packageChanged();
handleFieldChanged(PACKAGE);
}
}
/**
* Called when a dialog field on this page changed
* @see ContainerPage#fieldUpdated
*/
protected void handleFieldChanged(String fieldName) {
super.handleFieldChanged(fieldName);
if (fieldName == CONTAINER) {
fPackageStatus= packageChanged();
}
updateStatus(findMostSevereStatus());
}
/**
* Finds the most severe error (if there is one)
*/
protected IStatus findMostSevereStatus() { |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | return StatusUtil.getMoreSevere(fContainerStatus, fPackageStatus);
}
/**
* Verify the input for the package field
*/
private IStatus packageChanged() {
StatusInfo status= new StatusInfo();
String packName= fPackageDialogField.getText();
if (!"".equals(packName)) {
IStatus val= JavaConventions.validatePackageName(packName);
if (val.getSeverity() == IStatus.ERROR) {
status.setError(NewWizardMessages.getFormattedString("NewPackageCreationWizardPage.error.InvalidPackageName", val.getMessage()));
return status;
} else if (val.getSeverity() == IStatus.WARNING) {
status.setWarning(NewWizardMessages.getFormattedString("NewPackageCreationWizardPage.warning.DiscouragedPackageName", val.getMessage()));
}
} else {
status.setError(NewWizardMessages.getString("NewPackageCreationWizardPage.error.DefaultPackageExists"));
return status;
}
IPackageFragmentRoot root= getPackageFragmentRoot();
if (root != null) {
IPackageFragment pack= root.getPackageFragment(packName);
try {
IPath rootPath= root.getPath();
IPath outputPath= root.getJavaProject().getOutputLocation();
if (rootPath.isPrefixOf(outputPath) && !rootPath.equals(outputPath)) { |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | IPath packagePath= pack.getUnderlyingResource().getFullPath();
if (outputPath.isPrefixOf(packagePath)) {
status.setError(NewWizardMessages.getString("NewPackageCreationWizardPage.error.IsOutputFolder"));
return status;
}
}
if (pack.exists()) {
if (pack.containsJavaResources() || !pack.hasSubpackages()) {
status.setError(NewWizardMessages.getString("NewPackageCreationWizardPage.error.PackageExists"));
} else {
status.setWarning(NewWizardMessages.getString("NewPackageCreationWizardPage.warning.PackageNotShown"));
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
return status;
}
protected String getPackageText() {
return fPackageDialogField.getText();
}
protected void setPackageText(String str) {
fPackageDialogField.setText(str);
} |
3,622 | Bug 3622 New Package Wizard has confusing message (1GD0L9O) | 1. Create a new Java Project 2. Select the project. 3. Invoke New Java Package. Result: Before you type anything the following message appears at the top: "A folder corresponding to the package name already exists". At this point my package name field is empty. What does this message mean? Is this an error? If so, should it be displayed in red with the error icon? NOTES: EG (5/1/2001 5:53:41 AM) there should be no error message when the package name field is empty and finish should be disabled. MA (5/2/01 9:34:00 AM) It is a warning. I will remove the message EG (5/2/01 9:43:44 AM) issue how to create a default package? It can't be created by the user since it always there. | verified fixed | 0870c24 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T11:05:19Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewPackageCreationWizardPage.java | /**
* @see NewElementWizardPage#getRunnable
*/
public IRunnableWithProgress getRunnable() {
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
createPackage(monitor);
} catch (JavaModelException e) {
throw new InvocationTargetException(e);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
};
}
public IPackageFragment getNewPackageFragment() {
return fCreatedPackageFragment;
}
protected void createPackage(IProgressMonitor monitor) throws JavaModelException, CoreException, InterruptedException {
IPackageFragmentRoot root= getPackageFragmentRoot();
String packName= getPackageText();
fCreatedPackageFragment= root.createPackageFragment(packName, true, monitor);
}
} |
5,449 | Bug 5449 TVT Text Expansion/Truncations in new java class dialog | null | resolved fixed | 24c773c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T14:06:41Z" | "2001-11-02T00:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/HistoryListAction.java | package org.eclipse.jdt.internal.ui.typehierarchy;
import java.util.Arrays;
import java.util.List;
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.core.runtime.IStatus;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
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 HistoryListAction extends Action { |
5,449 | Bug 5449 TVT Text Expansion/Truncations in new java class dialog | null | resolved fixed | 24c773c | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-11-22T14:06:41Z" | "2001-11-02T00:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/HistoryListAction.java | private class HistoryListDialog extends StatusDialog {
private ListDialogField fHistoryList;
private IStatus fHistoryStatus;
private IJavaElement fResult;
private HistoryListDialog(Shell shell, IJavaElement[] elements) {
super(shell);
setTitle(TypeHierarchyMessages.getString("HistoryListDialog.title"));
String[] buttonLabels= new String[] {
TypeHierarchyMessages.getString("HistoryListDialog.remove.button") |