| Revision | 154 (tree) |
|---|---|
| Time | 2015-12-02 20:36:17 |
| Author | t_nakayama1971 |
clear warning
| @@ -101,8 +101,7 @@ | ||
| 101 | 101 | PREF_PAGE_HOME_LABEL, homeGroup); |
| 102 | 102 | |
| 103 | 103 | //blank |
| 104 | - Label lbl = new Label(composite, SWT.NULL); | |
| 105 | - lbl.setParent(composite); | |
| 104 | + insertBlank(composite); | |
| 106 | 105 | |
| 107 | 106 | Group modeGroup = new Group(composite, SWT.NONE); |
| 108 | 107 | modeGroup.setLayout(new GridLayout(1, false)); |
| @@ -118,8 +117,7 @@ | ||
| 118 | 117 | configGroup, false); |
| 119 | 118 | |
| 120 | 119 | //blank |
| 121 | - lbl = new Label(composite, SWT.NULL); | |
| 122 | - lbl.setParent(composite); | |
| 120 | + insertBlank(composite); | |
| 123 | 121 | |
| 124 | 122 | this.configLocationGroup = new Composite(modeGroup, SWT.NULL); |
| 125 | 123 | this.configFile = new TomcatFileFieldEditor( |
| @@ -135,36 +133,53 @@ | ||
| 135 | 133 | this.home.setPropertyChangeListener(this); |
| 136 | 134 | |
| 137 | 135 | //blank |
| 138 | - lbl = new Label(composite, SWT.NULL); | |
| 139 | - lbl.setParent(composite); | |
| 136 | + insertBlank(composite); | |
| 140 | 137 | |
| 141 | 138 | initLayoutAndData(homeGroup, 3); |
| 142 | 139 | initLayoutAndData(modeGroup, 1); |
| 143 | 140 | initLayoutAndData(this.configLocationGroup, 3); |
| 144 | 141 | |
| 145 | - this.initField(this.version); | |
| 142 | + initializeField(); | |
| 143 | + | |
| 144 | + return composite; | |
| 145 | + } | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * initialize Field | |
| 149 | + */ | |
| 150 | + private void initializeField() { | |
| 151 | + | |
| 152 | + initField(this.version); | |
| 146 | 153 | this.version.setPropertyChangeListener(this); |
| 147 | 154 | |
| 148 | - this.initField(this.home); | |
| 149 | - this.initField(this.configMode); | |
| 155 | + initField(this.home); | |
| 156 | + initField(this.configMode); | |
| 150 | 157 | modeChanged(this.configLocationGroup, |
| 151 | 158 | getPreferenceStore().getString(TomcatPluginResources.TOMCAT_PREF_CONFMODE_KEY)); |
| 152 | 159 | |
| 153 | 160 | this.configMode.setPropertyChangeListener(this); |
| 154 | 161 | |
| 155 | - this.initField(this.configFile); | |
| 162 | + initField(this.configFile); | |
| 156 | 163 | if (this.configFile.getStringValue().length() == 0) { |
| 157 | 164 | computeConfigFile(); |
| 158 | 165 | } |
| 159 | - this.initField(this.contextsDir); | |
| 166 | + initField(this.contextsDir); | |
| 160 | 167 | if (this.contextsDir.getStringValue().length() == 0) { |
| 161 | 168 | computeContextsDir(); |
| 162 | 169 | } |
| 163 | 170 | |
| 164 | - return composite; | |
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | /** |
| 174 | + * create blank | |
| 175 | + * @param composite Composite | |
| 176 | + */ | |
| 177 | + private void insertBlank(final Composite composite) { | |
| 178 | + Label lbl = new Label(composite, SWT.NULL); | |
| 179 | + lbl.setParent(composite); | |
| 180 | + } | |
| 181 | + | |
| 182 | + /** | |
| 168 | 183 | * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
| 169 | 184 | */ |
| 170 | 185 | @Override |