Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 92518 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.java (-2 / +13 lines)
Lines 120-133 public class DialogSettings implements IDialogSettings { Link Here
120
        return section;
120
        return section;
121
    }
121
    }
122
122
123
    /* (non-Javadoc)
123
	/* (non-Javadoc)
124
     * Method declared on IDialogSettings.
124
     * Method declared on IDialogSettings.
125
     */
125
     */
126
    public void addSection(IDialogSettings section) {
126
    public void addSection(IDialogSettings section) {
127
        sections.put(section.getName(), section);
127
        sections.put(section.getName(), section);
128
    }
128
    }
129
129
130
    /* (non-Javadoc)
130
    /**
131
	 * Remove a section in the receiver. If the given section does not exist, nothing is done.  
132
	 * 
133
	 * @param section
134
	 *            the section to be removed
135
	 */
136
	public void removeSection(IDialogSettings section) {
137
		sections.remove(section.getName());
138
	}
139
140
	/* (non-Javadoc)
131
     * Method declared on IDialogSettings.
141
     * Method declared on IDialogSettings.
132
     */
142
     */
133
    public String get(String key) {
143
    public String get(String key) {
Lines 591-594 public class DialogSettings implements IDialogSettings { Link Here
591
    		return null;
601
    		return null;
592
    	}
602
    	}
593
    }
603
    }
604
594
}
605
}
(-)a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java (-1 / +27 lines)
Lines 151-156 public class DialogSettingsTest extends TestCase { Link Here
151
			}
151
			}
152
		});
152
		});
153
	}
153
	}
154
	
155
	public void testRemoveSection() {
156
		DialogSettings dialogSettings = new DialogSettings(null);
157
		IDialogSettings section = dialogSettings.addNewSection("new-section");
158
159
		dialogSettings.removeSection(section);
160
161
		assertEquals(0, dialogSettings.getSections().length);
162
	}
163
164
	public void testRemoveNonExistingSection() {
165
		DialogSettings dialogSettings = new DialogSettings(null);
166
		IDialogSettings otherSection = new DialogSettings(null);
167
168
		dialogSettings.removeSection(otherSection);
169
170
		assertEquals(0, dialogSettings.getSections().length);
171
	}
172
	
173
	public void testRemoveSectionWithNullArgument() {
174
		DialogSettings dialogSettings = new DialogSettings(null);
175
176
		try {
177
			dialogSettings.removeSection(null);
178
		} catch (NullPointerException expected) {
179
		}
180
	}
154
181
155
	public void testKeys() throws IOException {
182
	public void testKeys() throws IOException {
156
		for (int i = 0; i < TEST_STRINGS.length; i++) {
183
		for (int i = 0; i < TEST_STRINGS.length; i++) {
157
- 

Return to bug 92518