1212 * IBM Corporation - initial API and implementation
1313 * Code 9 Corporation - on going enhancements and maintenance
1414 * Johannes Ahlers <[email protected] > - bug 477677 15+ * Daniel Kruegler - #2031 - PDE should not warn if resource URI of unknown scheme cannot be found
1516 *******************************************************************************/
1617package org .eclipse .pde .internal .ui .preferences ;
1718
4546import org .eclipse .core .runtime .preferences .InstanceScope ;
4647import org .eclipse .jface .dialogs .IDialogSettings ;
4748import org .eclipse .jface .dialogs .MessageDialog ;
49+ import org .eclipse .jface .layout .GridDataFactory ;
50+ import org .eclipse .jface .layout .GridLayoutFactory ;
4851import org .eclipse .jface .resource .JFaceResources ;
4952import org .eclipse .jface .util .Util ;
5053import org .eclipse .jface .window .Window ;
@@ -227,6 +230,7 @@ protected final static Key getPDEPrefKey(String key) {
227230 private static final Key KEY_P_UNKNOWN_CLASS = getPDEPrefKey (CompilerFlags .P_UNKNOWN_CLASS );
228231 private static final Key KEY_P_UNKNOWN_RESOURCE = getPDEPrefKey (CompilerFlags .P_UNKNOWN_RESOURCE );
229232 private static final Key KEY_P_UNKNOWN_IDENTIFIER = getPDEPrefKey (CompilerFlags .P_UNKNOWN_IDENTIFIER );
233+ private static final Key KEY_P_IGNORED_RESOURCE_PROTOCOLS = getPDEPrefKey (CompilerFlags .P_IGNORED_RESOURCE_PROTOCOLS );
230234
231235 //general
232236 private static final Key KEY_P_DISCOURAGED_CLASS = getPDEPrefKey (CompilerFlags .P_DISCOURAGED_CLASS );
@@ -260,12 +264,20 @@ protected final static Key getPDEPrefKey(String key) {
260264 private static final Key KEY_S_DOC_FOLDER = getPDEPrefKey (CompilerFlags .S_DOC_FOLDER );
261265 private static final Key KEY_S_OPEN_TAGS = getPDEPrefKey (CompilerFlags .S_OPEN_TAGS );
262266
263- private static String [] SEVERITIES = {PDEUIMessages .PDECompilersConfigurationBlock_error ,
267+ private static final String [] SEVERITIES = { PDEUIMessages .PDECompilersConfigurationBlock_error ,
264268 PDEUIMessages .PDECompilersConfigurationBlock_warning , PDEUIMessages .PDECompilersConfigurationBlock_info ,
265- PDEUIMessages .PDECompilersConfigurationBlock_ignore
266- };
267-
268- 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 };
269+ PDEUIMessages .PDECompilersConfigurationBlock_ignore };
270+
271+ private static final Key [] fgAllKeys = { KEY_F_UNRESOLVED_FEATURES , KEY_F_UNRESOLVED_PLUGINS , KEY_P_BUILD ,
272+ KEY_P_BUILD_MISSING_OUTPUT , KEY_P_BUILD_SOURCE_LIBRARY , KEY_P_BUILD_OUTPUT_LIBRARY ,
273+ KEY_P_BUILD_SRC_INCLUDES , KEY_P_BUILD_BIN_INCLUDES , KEY_P_BUILD_JAVA_COMPLIANCE , KEY_P_BUILD_JAVA_COMPILER ,
274+ KEY_P_BUILD_ENCODINGS , KEY_P_INTERNAL , KEY_P_SERVICE_COMP_WITHOUT_LAZY , KEY_P_NO_AUTOMATIC_MODULE_NAME ,
275+ KEY_P_DEPRECATED , KEY_P_DISCOURAGED_CLASS , KEY_P_INCOMPATIBLE_ENV , KEY_P_MISSING_EXPORT_PKGS ,
276+ KEY_P_NO_REQUIRED_ATT , KEY_P_NOT_EXTERNALIZED , KEY_P_UNKNOWN_ATTRIBUTE , KEY_P_UNKNOWN_CLASS ,
277+ KEY_P_UNKNOWN_ELEMENT , KEY_P_UNKNOWN_IDENTIFIER , KEY_P_UNKNOWN_RESOURCE , KEY_P_IGNORED_RESOURCE_PROTOCOLS ,
278+ KEY_P_UNRESOLVED_EX_POINTS , KEY_P_UNRESOLVED_IMPORTS , KEY_P_VERSION_EXP_PKG , KEY_P_VERSION_IMP_PKG ,
279+ KEY_P_VERSION_REQ_BUNDLE , KEY_P_VERSION_EXEC_ENV_TOO_LOW , KEY_S_CREATE_DOCS , KEY_S_DOC_FOLDER ,
280+ KEY_S_OPEN_TAGS };
269281
270282 /**
271283 * Constant representing the {@link IDialogSettings} section for this block
@@ -564,6 +576,10 @@ private Composite createPage(int kind, Composite folder, String name, String des
564576 // References
565577 client = createExpansibleComposite (sbody , PDEUIMessages .PDECompilersConfigurationBlock_references );
566578 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 );
579+ Composite comp = createComposite (client , 2 , 2 , GridData .FILL_HORIZONTAL , 0 , 0 );
580+ Text ignoredProtocolsText = createTextControl (comp , PDEUIMessages .compilers_p_ignored_uri_protocols ,
581+ KEY_P_IGNORED_RESOURCE_PROTOCOLS , CompilerFlags .PLUGIN_FLAGS );
582+ ignoredProtocolsText .setToolTipText (PDEUIMessages .compilers_p_ignored_uri_protocols_details );
567583
568584 break ;
569585 }
@@ -592,6 +608,17 @@ private void initializeComboControls(Composite composite, String[] labels, Key[]
592608 }
593609 }
594610
611+ /**
612+ * Creates a composite without inheriting the font from its parent.
613+ */
614+ private static Composite createComposite (Composite parent , int columns , int hspan , int fill , int marginwidth ,
615+ int marginheight ) {
616+ Composite composite = new Composite (parent , SWT .NONE );
617+ GridLayoutFactory .swtDefaults ().numColumns (columns ).margins (marginwidth , marginheight ).applyTo (composite );
618+ GridDataFactory .swtDefaults ().align (SWT .FILL , SWT .CENTER ).grab (true , false ).span (hspan , 1 ).applyTo (composite );
619+ return composite ;
620+ }
621+
595622 /**
596623 * Creates a checkbox button control in the parent
597624 */
@@ -664,7 +691,7 @@ protected void createComboControl(Composite parent, String label, Key key, int t
664691 /**
665692 * Creates a new text control on the parent for the given pref key
666693 */
667- private void createTextControl (Composite parent , String label , Key key , int tabkind ) {
694+ private Text createTextControl (Composite parent , String label , Key key , int tabkind ) {
668695 SWTFactory .createLabel (parent , label , 1 );
669696 Text text = SWTFactory .createSingleText (parent , 1 );
670697 ControlData data = new ControlData (key , new String [0 ]);
@@ -681,6 +708,7 @@ private void createTextControl(Composite parent, String label, Key key, int tabk
681708 fControlMap .put (mapkey , controls );
682709 }
683710 controls .add (text );
711+ return text ;
684712 }
685713
686714 /**
0 commit comments