Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Code 9 Corporation - on going enhancements and maintenance
* Daniel Kruegler - #2031 - PDE should not warn if resource URI of unknown scheme cannot be found
*******************************************************************************/
package org.eclipse.pde.internal.core.builders;

Expand Down Expand Up @@ -55,6 +56,7 @@ public class CompilerFlags {
public static final String P_UNKNOWN_ATTRIBUTE = "compilers.p.unknown-attribute"; //$NON-NLS-1$
public static final String P_UNKNOWN_CLASS = "compilers.p.unknown-class"; //$NON-NLS-1$
public static final String P_UNKNOWN_RESOURCE = "compilers.p.unknown-resource"; //$NON-NLS-1$
public static final String P_IGNORED_RESOURCE_PROTOCOLS = "compilers.p.ignored-resource-protocols"; //$NON-NLS-1$
public static final String P_UNKNOWN_IDENTIFIER = "compilers.p.unknown-identifier"; //$NON-NLS-1$
public static final String P_DISCOURAGED_CLASS = "compilers.p.discouraged-class"; //$NON-NLS-1$
public static final String P_NO_REQUIRED_ATT = "compilers.p.no-required-att"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Martin Karpisek <[email protected]> - Bug 526283
* Daniel Kruegler - #2031 - PDE should not warn if resource URI of unknown scheme cannot be found
*******************************************************************************/
package org.eclipse.pde.internal.core.builders;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
Expand Down Expand Up @@ -597,7 +599,13 @@ private boolean resourceExists(String location) {
}
}

return false;
return isIgnoredResourceUri(location);
}

private boolean isIgnoredResourceUri(String location) {
final var ignoredProtocols = CompilerFlags.getString(fProject, CompilerFlags.P_IGNORED_RESOURCE_PROTOCOLS);
return Arrays.stream(ignoredProtocols.split(",")).map(p -> p.trim() + ":"). //$NON-NLS-1$ //$NON-NLS-2$
anyMatch(s -> location.regionMatches(true, 0, s, 0, s.length()));
}

protected void validateJavaAttribute(Element element, Attr attr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,8 @@ public class PDEUIMessages extends NLS {
public static String compilers_s_doc_folder;
public static String compilers_s_open_tags;
public static String compilers_p_exec_env_too_low;
public static String compilers_p_ignored_uri_protocols;
public static String compilers_p_ignored_uri_protocols_details;

public static String compilers_p_exported_pkgs;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,8 @@ compilers_p_exported_pkgs = Unexported pac&kage:
compilers_p_missing_exp_pkg = Missing versions on exported packages:
compilers_p_missing_imp_pkg = Missing versions on imported packages:
compilers_p_missing_require_bundle = Missing versions on required bundles:
compilers_p_ignored_uri_protocols = Filtered resource protocols:
compilers_p_ignored_uri_protocols_details = Filtered protocols of unknown resource URIs are ignored. List is comma separated.

compilers_s_create_docs = &Generate reference documentation from schemas
compilers_s_doc_folder = Do&cumentation folder:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* IBM Corporation - initial API and implementation
* Code 9 Corporation - on going enhancements and maintenance
* Johannes Ahlers <[email protected]> - bug 477677
* Daniel Kruegler - #2031 - PDE should not warn if resource URI of unknown scheme cannot be found
*******************************************************************************/
package org.eclipse.pde.internal.ui.preferences;

Expand Down Expand Up @@ -45,6 +46,8 @@
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Util;
import org.eclipse.jface.window.Window;
Expand Down Expand Up @@ -227,6 +230,7 @@ protected final static Key getPDEPrefKey(String key) {
private static final Key KEY_P_UNKNOWN_CLASS = getPDEPrefKey(CompilerFlags.P_UNKNOWN_CLASS);
private static final Key KEY_P_UNKNOWN_RESOURCE = getPDEPrefKey(CompilerFlags.P_UNKNOWN_RESOURCE);
private static final Key KEY_P_UNKNOWN_IDENTIFIER = getPDEPrefKey(CompilerFlags.P_UNKNOWN_IDENTIFIER);
private static final Key KEY_P_IGNORED_RESOURCE_PROTOCOLS = getPDEPrefKey(CompilerFlags.P_IGNORED_RESOURCE_PROTOCOLS);

//general
private static final Key KEY_P_DISCOURAGED_CLASS = getPDEPrefKey(CompilerFlags.P_DISCOURAGED_CLASS);
Expand Down Expand Up @@ -260,12 +264,20 @@ protected final static Key getPDEPrefKey(String key) {
private static final Key KEY_S_DOC_FOLDER = getPDEPrefKey(CompilerFlags.S_DOC_FOLDER);
private static final Key KEY_S_OPEN_TAGS = getPDEPrefKey(CompilerFlags.S_OPEN_TAGS);

private static String[] SEVERITIES = {PDEUIMessages.PDECompilersConfigurationBlock_error,
private static final String[] SEVERITIES = { PDEUIMessages.PDECompilersConfigurationBlock_error,
PDEUIMessages.PDECompilersConfigurationBlock_warning, PDEUIMessages.PDECompilersConfigurationBlock_info,
PDEUIMessages.PDECompilersConfigurationBlock_ignore
};

private static Key[] fgAllKeys = {KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD, KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY, KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER, KEY_P_BUILD_ENCODINGS, KEY_P_INTERNAL, KEY_P_SERVICE_COMP_WITHOUT_LAZY, KEY_P_NO_AUTOMATIC_MODULE_NAME, KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS, KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG, KEY_P_VERSION_REQ_BUNDLE, KEY_P_VERSION_EXEC_ENV_TOO_LOW, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER, KEY_S_OPEN_TAGS };
PDEUIMessages.PDECompilersConfigurationBlock_ignore };

private static final Key[] fgAllKeys = { KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD,
KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY,
KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER,
KEY_P_BUILD_ENCODINGS, KEY_P_INTERNAL, KEY_P_SERVICE_COMP_WITHOUT_LAZY, KEY_P_NO_AUTOMATIC_MODULE_NAME,
KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS,
KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS,
KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_IGNORED_RESOURCE_PROTOCOLS,
KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG,
KEY_P_VERSION_REQ_BUNDLE, KEY_P_VERSION_EXEC_ENV_TOO_LOW, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER,
KEY_S_OPEN_TAGS };

/**
* Constant representing the {@link IDialogSettings} section for this block
Expand Down Expand Up @@ -564,6 +576,10 @@ private Composite createPage(int kind, Composite folder, String name, String des
// References
client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_references);
initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_unknown_element, PDEUIMessages.compilers_p_unknown_attribute, PDEUIMessages.compilers_p_unknown_class, PDEUIMessages.compilers_p_discouraged_class, PDEUIMessages.compilers_p_unknown_resource, PDEUIMessages.compilers_p_unknown_identifier}, new Key[] {KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_DISCOURAGED_CLASS, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNKNOWN_IDENTIFIER,}, CompilerFlags.PLUGIN_FLAGS);
Composite comp = createComposite(client, 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
createTextControl(comp, PDEUIMessages.compilers_p_ignored_uri_protocols,
KEY_P_IGNORED_RESOURCE_PROTOCOLS, CompilerFlags.PLUGIN_FLAGS);
SWTFactory.createLabel(comp, PDEUIMessages.compilers_p_ignored_uri_protocols_details, 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label should be a tool-tip of the text field instead.
Not having an extra description field makes the UI cleaner.

And it maybe makes the code even simpler as you can maybe even skip the extra container/Composite. But I'm not sure about the latter and it would have to be investigated/tried out.

You can get the text-field by returning it from the createTextControl() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label should be a tool-tip of the text field instead. Not having an extra description field makes the UI cleaner.

All existing comparable text fields in the Eclipse wizards providing comma-separated lists use an extra label to explain the usage. See for example:

grafik grafik

In the File Search dialog we have a comparable pattern:
grafik

In the rarer case were no such a label is provided the Eclipse UI does not show a tool tip. I would like to point these out before we change the design. So, given this additional information, do we still want to user your alternative approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label should be a tool-tip of the text field instead. Not having an extra description field makes the UI cleaner.

All existing comparable text fields in the Eclipse wizards providing comma-separated lists use an extra label to explain the usage. See for example:

grafik grafik

In the File Search dialog we have a comparable pattern:
grafik

In the rarer case were no such a label is provided the Eclipse UI does not show a tool tip. I would like to point these out before we change the design. So, given this additional information, do we still want to user your alternative approach?


break;
}
Expand Down Expand Up @@ -592,6 +608,17 @@ private void initializeComboControls(Composite composite, String[] labels, Key[]
}
}

/**
* Creates a composite without inheriting the font from its parent.
*/
private static Composite createComposite(Composite parent, int columns, int hspan, int fill, int marginwidth,
int marginheight) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayoutFactory.swtDefaults().numColumns(columns).margins(marginwidth, marginheight).applyTo(composite);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(hspan, 1).applyTo(composite);
return composite;
}

/**
* Creates a checkbox button control in the parent
*/
Expand Down
Loading