Skip to content

Commit f4443e8

Browse files
vogellaclaude
andcommitted
Rename setDirtyIndicatorCloseStyle to setDirtyIndicatorStyle
"CloseStyle" leaks the implementation detail that the bullet occupies the close button area. The shorter name describes the feature, not the mechanism. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8986d13 commit f4443e8

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ public void setUnselectedCloseVisible(boolean visible) {
36893689
updateFolder(REDRAW);
36903690
}
36913691
/**
3692-
* Sets whether the dirty indicator uses the close button style. When enabled,
3692+
* Sets whether the dirty indicator style is enabled. When enabled,
36933693
* dirty items (marked via {@link CTabItem#setShowDirty(boolean)}) show a
36943694
* bullet dot at the close button location instead of the traditional
36953695
* <code>*</code> prefix. The bullet transforms into the close button on hover.
@@ -3698,8 +3698,7 @@ public void setUnselectedCloseVisible(boolean visible) {
36983698
* behavior).
36993699
* </p>
37003700
*
3701-
* @param useCloseButtonStyle <code>true</code> to use the bullet-on-close-button
3702-
* style for dirty indicators
3701+
* @param enabled <code>true</code> to enable the dirty indicator style
37033702
*
37043703
* @exception SWTException <ul>
37053704
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -3709,26 +3708,26 @@ public void setUnselectedCloseVisible(boolean visible) {
37093708
* @see CTabItem#setShowDirty(boolean)
37103709
* @since 3.134
37113710
*/
3712-
public void setDirtyIndicatorCloseStyle(boolean useCloseButtonStyle) {
3711+
public void setDirtyIndicatorStyle(boolean enabled) {
37133712
checkWidget();
3714-
if (dirtyIndicatorStyle == useCloseButtonStyle) return;
3715-
dirtyIndicatorStyle = useCloseButtonStyle;
3713+
if (dirtyIndicatorStyle == enabled) return;
3714+
dirtyIndicatorStyle = enabled;
37163715
updateFolder(REDRAW_TABS);
37173716
}
37183717
/**
3719-
* Returns whether the dirty indicator uses the close button style.
3718+
* Returns whether the dirty indicator style is enabled.
37203719
*
3721-
* @return <code>true</code> if the dirty indicator uses the close button style
3720+
* @return <code>true</code> if the dirty indicator style is enabled
37223721
*
37233722
* @exception SWTException <ul>
37243723
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
37253724
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
37263725
* </ul>
37273726
*
3728-
* @see #setDirtyIndicatorCloseStyle(boolean)
3727+
* @see #setDirtyIndicatorStyle(boolean)
37293728
* @since 3.134
37303729
*/
3731-
public boolean getDirtyIndicatorCloseStyle() {
3730+
public boolean getDirtyIndicatorStyle() {
37323731
checkWidget();
37333732
return dirtyIndicatorStyle;
37343733
}

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public boolean getShowClose() {
290290
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
291291
* </ul>
292292
*
293-
* @see CTabFolder#setDirtyIndicatorCloseStyle(boolean)
293+
* @see CTabFolder#setDirtyIndicatorStyle(boolean)
294294
* @since 3.134
295295
*/
296296
public boolean getShowDirty() {
@@ -514,7 +514,7 @@ public void setShowClose(boolean close) {
514514
/**
515515
* Marks this item as dirty (having unsaved changes). When the parent
516516
* folder's dirty indicator style is enabled via
517-
* {@link CTabFolder#setDirtyIndicatorCloseStyle(boolean)}, dirty items
517+
* {@link CTabFolder#setDirtyIndicatorStyle(boolean)}, dirty items
518518
* show a bullet dot at the close button location. The bullet transforms
519519
* into the close button on hover.
520520
*
@@ -525,7 +525,7 @@ public void setShowClose(boolean close) {
525525
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
526526
* </ul>
527527
*
528-
* @see CTabFolder#setDirtyIndicatorCloseStyle(boolean)
528+
* @see CTabFolder#setDirtyIndicatorStyle(boolean)
529529
* @since 3.134
530530
*/
531531
public void setShowDirty(boolean dirty) {

examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet393.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static void main(String[] args) {
3232

3333
CTabFolder folder = new CTabFolder(shell, SWT.CLOSE | SWT.BORDER);
3434
folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
35-
folder.setDirtyIndicatorCloseStyle(true);
35+
folder.setDirtyIndicatorStyle(true);
3636

3737
for (int i = 0; i < 4; i++) {
3838
CTabItem item = new CTabItem(folder, SWT.NONE);

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabItem.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public void test_setShowDirty() {
9090

9191
@Test
9292
public void test_dirtyIndicatorCloseStyle() {
93-
assertFalse(cTabFolder.getDirtyIndicatorCloseStyle());
94-
cTabFolder.setDirtyIndicatorCloseStyle(true);
95-
assertTrue(cTabFolder.getDirtyIndicatorCloseStyle());
96-
cTabFolder.setDirtyIndicatorCloseStyle(false);
97-
assertFalse(cTabFolder.getDirtyIndicatorCloseStyle());
93+
assertFalse(cTabFolder.getDirtyIndicatorStyle());
94+
cTabFolder.setDirtyIndicatorStyle(true);
95+
assertTrue(cTabFolder.getDirtyIndicatorStyle());
96+
cTabFolder.setDirtyIndicatorStyle(false);
97+
assertFalse(cTabFolder.getDirtyIndicatorStyle());
9898
}
9999
}

0 commit comments

Comments
 (0)