Each field editor knows how to save and restore public void createFieldEditors() ĪddField(new ComboFieldEditor(PreferenceConstants.P_SHOWN_LINES_COUNT,"Preview lines",getArrayOfPairs(lineValues),getFieldEditorParent())) ĪddBoolField(PreferenceConstants.P_SHOW_MATCH_COUNT,"Show number of matches") ĪddBoolField(PreferenceConstants.P_SHOW_FULL_PATH,"Show full file path in results") ĪddBoolField(PreferenceConstants.P_DIALOG_ON_SHORTCUT,"Open search dialog with shortcut key (Ctrl+Alt+I)") Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. You can simple paste these classes into your project.AddField(new BooleanFieldEditor(PreferenceConstants.EDITOR_MATCHING_BRACKETS,Messages.ClojurePreferencePage_highlight_matching_brackets,getFieldEditorParent())) ĪddField(new IntegerFieldEditor(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH,Messages.ClojurePreferencePage_displayed_tab_width,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_TO_NS_ON_REPL_STARTUP,Messages.ClojurePreferencePage_switch_to_ns_on_repl_startup,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_STRICT_STRUCTURAL_EDITING_MODE_BY_DEFAULT,Messages.ClojurePreferencePage_use_strict_structural_editing_mode_by_default,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_RAINBOW_PARENS_BY_DEFAULT,Messages.ClojurePreferencePage_show_rainbow_parens_by_default,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_ESCAPE_ON_PASTE,Messages.ClojurePreferencePage_escape_on_paste,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_TAB_FOR_REINDENTING_LINE,Messages.ClojurePreferencePage_use_tab_for_reindenting_line,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_CODE_COMPLETION_AUTO_ACTIVATE,Messages.ClojurePreferencePage_code_completion_auto_activate,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(_DISPLAY_NAMESPACE_IN_TABS,Messages.ClojurePreferencePage_show_more_context_in_tabs,getFieldEditorParent())) ĪddField(new BooleanFieldEditor(PreferenceConstants.P_EMBED,plugin.getMessage("preference.embed"),getFieldEditorParent())) ĪddField(new BooleanFieldEditor(PreferenceConstants.P_TABBED,plugin.getMessage("preference.tabbed"),getFieldEditorParent())) ĪddField(new BooleanFieldEditor(PreferenceConstants.P_START_ECLIMD,plugin.getMessage(""),getFieldEditorParent())) ĪddField(new BooleanFieldEditor(PreferenceConstants.P_FOCUS_AUTO_CLICK,plugin.getMessage(""),getFieldEditorParent())) ĪddField(new StringFieldEditor(PreferenceConstants.P_PORT,plugin.getMessage("preference.port"),getFieldEditorParent())) ĪddField(new FileFieldEditor(PreferenceConstants.P_GVIM,plugin.getMessage("preference.gvim"),true,getFieldEditorParent())) ĪddField(new StringFieldEditor(PreferenceConstants.P_OPTS,plugin.getMessage(""),getFieldEditorParent()))
#HOW TO SET UP JFACE ECLIPSE ON MAC CODE#
Our model will be very simple: We will have a class Question that represents a quiz question, a class Answer that represents the answer of the user to that question, and an AnswerList class that represents the list of answers the user gave for a quiz.īelow is the code of these classes. Let’s modify this application in order to host our quiz results table.įirst let’s create our model objects upon which our TableViewer will act to display GUI elements. Humm, nice but not so interresting to our eyes. Go ahead and launch that sample application. In your Eclipse IDE create a new Rich Client Application plugin projet based on the « RCP application with a view » template that ships with Eclipse IDE (I assume you know how to do that!).
After a user takes a quiz their results will be displayed in a table like the one above. The application is meant to be a Quiz Taking engine. It represents part of a larger application that I am building. I am going to provide step by step instructions for building the following simple RCP application: Today, I’m gonna blog about using JFace TableViewer widget in an Eclipse RCP application.