Skip to content

Commit 8c0220c

Browse files
author
mgricken
committed
Infrastructure for file associations.
git-svn-id: file:///tmp/test-svn/trunk@4955 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 77b08b2 commit 8c0220c

File tree

20 files changed

+1012
-112
lines changed

20 files changed

+1012
-112
lines changed

drjava/lib/platform.jar

9.07 KB
Binary file not shown.

drjava/src/edu/rice/cs/drjava/config/OptionConstants.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ public static ArrayList<String> evaluate() {
14031403
/** The request URL that the user generated the last time the DrJava survey was taken. */
14041404
public static final StringOption LAST_DRJAVA_SURVEY_RESULT = new StringOption("drjava.survey.result.last", "");
14051405

1406-
/** . */
1406+
/** Delete class files for language-level classes. */
14071407
public static final ArrayList<String> DELETE_LL_CLASS_FILES_CHOICES =
14081408
DeleteLLClassFileChoices.evaluate();
14091409
static class DeleteLLClassFileChoices {
@@ -1419,4 +1419,27 @@ public static ArrayList<String> evaluate() {
14191419
/** Whether to delete language level class files. */
14201420
public static final ForcedChoiceOption DELETE_LL_CLASS_FILES =
14211421
new ForcedChoiceOption("delete.ll.class.files", DELETE_LL_CLASS_FILES_CHOICES.get(2), DELETE_LL_CLASS_FILES_CHOICES);
1422+
1423+
/** File extension registration choices. */
1424+
public static final ArrayList<String> FILE_EXT_REGISTRATION_CHOICES =
1425+
FileExtRegistrationChoices.evaluate();
1426+
static class FileExtRegistrationChoices{
1427+
public static ArrayList<String> evaluate() {
1428+
ArrayList<String> aList = new ArrayList<String>(4);
1429+
aList.add("never");
1430+
aList.add("ask me at startup");
1431+
aList.add("always");
1432+
return aList;
1433+
}
1434+
}
1435+
1436+
/** File extension registration for .java files. */
1437+
public static final ForcedChoiceOption JAVA_FILE_EXT_REGISTRATION =
1438+
new ForcedChoiceOption("file.ext.registration.java", FILE_EXT_REGISTRATION_CHOICES .get(1),
1439+
FILE_EXT_REGISTRATION_CHOICES);
1440+
1441+
/** File extension registration for .drjava files. */
1442+
public static final ForcedChoiceOption PROJECT_FILE_EXT_REGISTRATION =
1443+
new ForcedChoiceOption("file.ext.registration.project", FILE_EXT_REGISTRATION_CHOICES .get(1),
1444+
FILE_EXT_REGISTRATION_CHOICES);
14221445
}

drjava/src/edu/rice/cs/drjava/platform/DefaultPlatform.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,29 @@ public void setMnemonicAt(javax.swing.JTabbedPane obj, int tabIndex, int mnemoni
233233
// by default just set the object's mnemonic
234234
obj.setMnemonicAt(tabIndex, mnemonic);
235235
}
236+
237+
/** @return true if file extensions can be registered and unregistered. */
238+
public boolean canRegisterFileExtensions() { return false; }
239+
240+
/** Register .drjava file extension.
241+
* @return true if registering succeeded */
242+
public boolean registerProjectFileExtension() { return false; }
243+
244+
/** Unregister .drjava file extension.
245+
* @return true if unregistering succeeded */
246+
public boolean unregisterProjectFileExtension() { return false; }
247+
248+
/** @return true if .drjava file extension is registered. */
249+
public boolean isProjectFileExtensionRegistered() { return false; }
250+
251+
/** Register .java file extension.
252+
* @return true if registering succeeded */
253+
public boolean registerJavaFileExtension() { return false; }
254+
255+
/** Unregister .java file extension.
256+
* @return true if unregistering succeeded */
257+
public boolean unregisterJavaFileExtension() { return false; }
258+
259+
/** @return true if .java file extension is registered. */
260+
public boolean isJavaFileExtensionRegistered() { return false; }
236261
}

drjava/src/edu/rice/cs/drjava/platform/PlatformSupport.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,29 @@ public interface PlatformSupport {
119119
* @see javax.swing.JTabbedPane#setMnemonicAt(int,int)
120120
* @see java.awt.event.KeyEvent */
121121
public void setMnemonicAt(javax.swing.JTabbedPane obj, int tabIndex, int mnemonic);
122+
123+
/** @return true if file extensions can be registered and unregistered. */
124+
public boolean canRegisterFileExtensions();
125+
126+
/** Register .drjava file extension.
127+
* @return true if registering succeeded */
128+
public boolean registerProjectFileExtension();
129+
130+
/** Unregister .drjava file extension.
131+
* @return true if unregistering succeeded */
132+
public boolean unregisterProjectFileExtension();
133+
134+
/** @return true if .drjava file extension is registered. */
135+
public boolean isProjectFileExtensionRegistered();
136+
137+
/** Register .java file extension.
138+
* @return true if registering succeeded */
139+
public boolean registerJavaFileExtension();
140+
141+
/** Unregister .java file extension.
142+
* @return true if unregistering succeeded */
143+
public boolean unregisterJavaFileExtension();
144+
145+
/** @return true if .java file extension is registered. */
146+
public boolean isJavaFileExtensionRegistered();
122147
}

drjava/src/edu/rice/cs/drjava/ui/config/ConfigFrame.java

Lines changed: 206 additions & 102 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)