Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 166815 Details for
Bug 309045
C preprocessor activation should not be based on content type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
cppFileTypesPatch.txt (text/plain), 11.34 KB, created by
Kurt Hendle
on 2010-05-03 14:02:13 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Kurt Hendle
Created:
2010-05-03 14:02:13 EDT
Size:
11.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.photran.core >Index: preferences/org/eclipse/photran/internal/core/preferences/FortranPreferences.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.ptp/photran/org.eclipse.photran.core/preferences/org/eclipse/photran/internal/core/preferences/FortranPreferences.java,v >retrieving revision 1.15 >diff -u -r1.15 FortranPreferences.java >--- preferences/org/eclipse/photran/internal/core/preferences/FortranPreferences.java 26 Jan 2010 00:09:05 -0000 1.15 >+++ preferences/org/eclipse/photran/internal/core/preferences/FortranPreferences.java 3 May 2010 18:01:09 -0000 >@@ -50,6 +50,9 @@ > > public static final FortranIntegerPreference FIXED_FORM_COMMENT_COLUMN = new FortranIntegerPreference("fixedformcommentcolum", 72, FortranIntegerPreference.NO_LIMIT, 72); > >+ public static final FortranStringPreference CPP_FIXED_FORM_TYPES = new FortranStringPreference("fixedformcppfiletypes", "F77,fpp,F,FOR,FTN,FIX,FPP"); >+ public static final FortranStringPreference CPP_FREE_FORM_TYPES = new FortranStringPreference("freeformcppfiletypes", "F90,F95,F03,F08"); >+ > private FortranPreferences() {} > > /** Initializes/resets all Photran-specific preferences to their default values */ >#P org.eclipse.photran.core.vpg >Index: src/org/eclipse/photran/internal/core/properties/SearchPathProperties.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.ptp/photran/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/properties/SearchPathProperties.java,v >retrieving revision 1.10 >diff -u -r1.10 SearchPathProperties.java >--- src/org/eclipse/photran/internal/core/properties/SearchPathProperties.java 4 Aug 2009 19:30:39 -0000 1.10 >+++ src/org/eclipse/photran/internal/core/properties/SearchPathProperties.java 3 May 2010 18:01:09 -0000 >@@ -48,7 +48,8 @@ > public static final String ENABLE_HOVER_TIP_PROPERTY_NAME = "EnableHoverTip"; > public static final String MODULE_PATHS_PROPERTY_NAME = "FortranModulePaths"; > public static final String INCLUDE_PATHS_PROPERTY_NAME = "FortranIncludePaths"; >- >+ public static final String FIXED_FORM_CPP_TYPES_PROPERTY_NAME = "FixedFormCppTypes"; >+ public static final String FREE_FORM_CPP_TYPES_PROPERTY_NAME = "FreeFormCppTypes"; > > protected static ProjectScope pScope = null; > public static ScopedPreferenceStore scopedStore = null; >#P org.eclipse.photran.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.ptp/photran/org.eclipse.photran.ui/plugin.xml,v >retrieving revision 1.24 >diff -u -r1.24 plugin.xml >--- plugin.xml 13 Nov 2009 16:59:42 -0000 1.24 >+++ plugin.xml 3 May 2010 18:01:10 -0000 >@@ -227,6 +227,12 @@ > class="org.eclipse.photran.internal.ui.preferences.CDTFortranPreferencePage" > id="org.eclipse.photran.ui.CDTFortranPreferencePage"> > </page> >+ <page >+ name="CPP File Types" >+ category="org.eclipse.photran.ui.MainFortranPreferencePage" >+ class="org.eclipse.photran.internal.ui.preferences.CppFileTypesPreferencePage" >+ id="org.eclipse.photran.ui.CppFileTypesPreferencePage"> >+ </page> > </extension> > > <!--=========================================--> >Index: src/org/eclipse/photran/internal/ui/preferences/CppFileTypesPreferencePage.java >=================================================================== >RCS file: src/org/eclipse/photran/internal/ui/preferences/CppFileTypesPreferencePage.java >diff -N src/org/eclipse/photran/internal/ui/preferences/CppFileTypesPreferencePage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/photran/internal/ui/preferences/CppFileTypesPreferencePage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,43 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * UIUC - Initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.photran.internal.ui.preferences; >+ >+import org.eclipse.jface.preference.StringFieldEditor; >+import org.eclipse.photran.internal.core.preferences.FortranPreferences; >+ >+/** >+ * >+ * @author Kurt Hendle >+ */ >+public class CppFileTypesPreferencePage extends AbstractFortranPreferencePage >+{ >+ protected void setDescrption() >+ { >+ } >+ >+ protected void initializeDefaults() >+ { >+ FortranPreferences.CPP_FIXED_FORM_TYPES.setDefault(); >+ FortranPreferences.CPP_FREE_FORM_TYPES.setDefault(); >+ } >+ >+ protected void createFieldEditors() >+ { >+ addField(new StringFieldEditor(FortranPreferences.CPP_FIXED_FORM_TYPES.getName(), >+ "Fixed Form file types", >+ getFieldEditorParent())); >+ >+ addField(new StringFieldEditor(FortranPreferences.CPP_FREE_FORM_TYPES.getName(), >+ "Free Form file types", >+ getFieldEditorParent())); >+ } >+ >+} >#P org.eclipse.photran.ui.vpg >Index: src/org/eclipse/photran/internal/ui/properties/CPPFileTypeEditor.java >=================================================================== >RCS file: src/org/eclipse/photran/internal/ui/properties/CPPFileTypeEditor.java >diff -N src/org/eclipse/photran/internal/ui/properties/CPPFileTypeEditor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/photran/internal/ui/properties/CPPFileTypeEditor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,97 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.photran.internal.ui.properties; >+ >+import java.util.Arrays; >+ >+import org.eclipse.jface.preference.ListEditor; >+import org.eclipse.jface.viewers.ArrayContentProvider; >+import org.eclipse.jface.viewers.LabelProvider; >+import org.eclipse.photran.internal.core.properties.SearchPathProperties; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.dialogs.ListDialog; >+ >+/** >+ * A field editor to edit which file types to send to the C Preprocessor. >+ * >+ * @author Jeff Overbey, Kurt Hendle >+ */ >+public class CPPFileTypeEditor extends ListEditor >+{ >+ private String[] fileTypes; >+ /** >+ * The special label text for chooser, >+ * or <code>null</code> if none. >+ */ >+ private String fileTypeInputLabelText; >+ >+ /** >+ * Creates a new path field editor >+ */ >+ protected CPPFileTypeEditor() >+ { >+ } >+ >+ /** >+ * Creates a CPP file type chooser. >+ * >+ * @param name the name of the preference this field editor works on >+ * @param labelText the label text of the field editor >+ * @param fileTypes an array of file types to be available in the list >+ * @param typeChooserText the label text displayed for the directory chooser >+ * @param parent the parent of the field editor's control >+ */ >+ public CPPFileTypeEditor(String name, String labelText, String[] fileTypes, String typeChooserText, Composite parent) >+ { >+ parent = new Composite(parent, SWT.NONE); >+ init(name, labelText); >+ this.fileTypes = fileTypes; >+ this.fileTypeInputLabelText = typeChooserText; >+ createControl(parent); >+ } >+ >+ /* (non-Javadoc) >+ * Method declared on ListEditor. >+ * Creates a new path element by means of a directory dialog. >+ */ >+ protected String getNewInputObject() >+ { >+ //set up the list dialog box >+ ListDialog dialog = new ListDialog(getShell()); >+ dialog.setInput(fileTypes); >+ dialog.setContentProvider(new ArrayContentProvider()); >+ dialog.setLabelProvider(new LabelProvider()); >+ dialog.setMessage(fileTypeInputLabelText); >+ >+ if (dialog.open() == ListDialog.OK) >+ { >+ //result is returned as an object array, must convert it to string and return string >+ Object[] selection = dialog.getResult(); >+ String [] type = Arrays.asList(selection).toArray(new String[selection.length]); >+ return type[0]; >+ } >+ >+ return null; >+ } >+ >+ @Override >+ protected String createList(String[] items) >+ { >+ return SearchPathProperties.createList(items); >+ } >+ >+ @Override >+ protected String[] parseString(String stringList) >+ { >+ return SearchPathProperties.parseString(stringList); >+ } >+} >Index: src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.ptp/photran/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java,v >retrieving revision 1.9 >diff -u -r1.9 SearchPathsPropertyPage.java >--- src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java 3 Nov 2009 16:29:50 -0000 1.9 >+++ src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java 3 May 2010 18:01:10 -0000 >@@ -106,6 +106,7 @@ > > private FortranBooleanFieldEditor enableVPG, enableDeclView, enableContentAssist, enableHoverTip; > private WorkspacePathEditor modulePathEditor, includePathEditor; >+ private CPPFileTypeEditor fixedFormEditor, freeFormEditor; > > /** > * @see PreferencePage#createContents(Composite) >@@ -208,6 +209,31 @@ > includePathEditor.setPreferenceStore(scopedStore); > includePathEditor.load(); > >+ l = new Label(composite, SWT.WRAP); >+ l.setText("The following specify the types of fixed form and free form\n" + >+ "Fortran files you wish to be processed by the C preprocessor."); >+ l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); >+ >+ fixedFormEditor = new CPPFileTypeEditor(SearchPathProperties.FIXED_FORM_CPP_TYPES_PROPERTY_NAME, >+ "Fixed form file types to be C preprocessed", >+ new String[] { "F77","fpp","F","FOR","FTN","FIX","FPP" }, >+ "Please choose a fixed form file type", >+ parent); >+ >+ fixedFormEditor.setPreferenceStore(scopedStore); >+ fixedFormEditor.load(); >+ >+ freeFormEditor = new CPPFileTypeEditor(SearchPathProperties.FREE_FORM_CPP_TYPES_PROPERTY_NAME, >+ "Free form file types to be C preprocessed", >+ new String[] { "F90","F95","F03","F08" }, >+ "Please choose a free form file type", >+ parent); >+ >+ freeFormEditor.setPreferenceStore(scopedStore); >+ freeFormEditor.load(); >+ >+ >+ > return composite; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
g.watson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 309045
:
166813
| 166815