Skip to content

Commit

Permalink
remove deprecated CSS element
Browse files Browse the repository at this point in the history
  • Loading branch information
elsazac authored and vogella committed Jan 25, 2024
1 parent d0e7dd9 commit ff4e256
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 271 deletions.
11 changes: 0 additions & 11 deletions bundles/org.eclipse.e4.ui.css.swt/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,6 @@
name="font-weight">
</property-name>
</handler>
<handler
adapter="org.eclipse.e4.ui.css.swt.dom.CTabItemElement"
composite="false"
handler="org.eclipse.e4.ui.css.swt.properties.custom.CSSPropertyShowCloseHandler">
<property-name
name="swt-show-close">
</property-name>
<property-name
name="show-close" deprecated="renamed as swt-show-close">
</property-name>
</handler>
<handler
adapter="org.eclipse.e4.ui.css.swt.dom.CTabFolderElement"
composite="false"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ void testRetrievePropertyNull() {
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-maximized", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-maximize-visible", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-minimize-visible", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "show-close", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-simple", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-single", null));
assertEquals(null, engine.retrieveCSSProperty(shell, "swt-unselected-close-visible", null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,115 +248,6 @@ void testSelectedFontMerged3() {
}
}

private void testShowClose(boolean showClose) {
CTabFolder folder = createTestTabFolder("CTabItem { show-close: " + showClose + " }");
for (CTabItem item : folder.getItems()) {
assertEquals(showClose, item.getShowClose());
assertEquals(Boolean.toString(showClose), engine.retrieveCSSProperty(item, "show-close", null));
}
}

@Test
void testShowCloseFalse() {
testShowClose(false);
}

@Test
void testShowCloseTrue() {
testShowClose(true);
}

@Test
void testShowClose() {
CTabFolder folder = createTestTabFolder("CTabItem { show-close: true }");
for (CTabItem item : folder.getItems()) {
assertTrue(item.getShowClose());
}

engine = createEngine("CTabItem { show-close: false }", folder.getDisplay());
engine.applyStyles(folder.getShell(), true);
for (CTabItem item : folder.getItems()) {
assertFalse(item.getShowClose());
}
}

@Test
void testShowClose2() {
CTabFolder folder = createTestTabFolder();
CTabFolder folder2 = createFolder(folder.getShell());
engine = createEngine("CTabItem { swt-show-close: true }", folder.getDisplay());
engine.applyStyles(folder.getShell(), true);

for (CTabItem item : folder.getItems()) {
assertTrue(item.getShowClose());
}
for (CTabItem item : folder2.getItems()) {
assertTrue(item.getShowClose());
}

engine = createEngine("CTabItem { show-close: false }", folder.getDisplay());
engine.applyStyles(folder.getShell(), true);
for (CTabItem item : folder.getItems()) {
assertFalse(item.getShowClose());
}
for (int i = 0; i < folder.getItemCount(); i++) {
assertFalse(folder2.getItem(i).getShowClose());
}
}

private void testSelectedShowClose(CTabFolder folder, int index) {
CTabItem[] items = folder.getItems();
folder.setSelection(index);
spinEventLoop();

for (int i = 0; i < items.length; i++) {
if (i == index) {
assertTrue(items[i].getShowClose());
assertEquals("true", engine.retrieveCSSProperty(items[i], "show-close", null));
} else {
assertFalse(items[i].getShowClose());
assertEquals("false", engine.retrieveCSSProperty(items[i], "show-close", null));
}
}
}

@Test
void testSelectedShowClose() {
CTabFolder folder = createTestTabFolder("CTabItem:selected { show-close: true }");
for (int i = 0; i < folder.getItemCount(); i++) {
testSelectedShowClose(folder, i);
}

engine = createEngine("CTabItem:selected { show-close: false }", folder.getDisplay());
engine.applyStyles(folder.getShell(), true);
for (CTabItem item : folder.getItems()) {
assertFalse(item.getShowClose());
}
}

@Test
void testSelectedShowClose2() {
CTabFolder folder = createTestTabFolder("CTabItem { show-close: false }\n"
+ "CTabItem:selected { show-close: true }");
for (int i = 0; i < folder.getItemCount(); i++) {
testSelectedShowClose(folder, i);
}
}

@Disabled("test was commented before bug 443094")
@Test
void testClassSelectedShowClose() {
CTabFolder folder = createTestTabFolder();
WidgetElement.setCSSClass(folder, "editorStack");

CSSEngine engine = createEngine("CTabFolder.editorStack CTabItem { show-close: true }", folder.getDisplay());
engine.applyStyles(folder.getShell(), true);

for (CTabItem item : folder.getItems()) {
assertTrue(item.getShowClose());
}
}

@Disabled("test was commented before bug 443094")
@Test
void testFontsEditorStackClass() {
Expand Down

0 comments on commit ff4e256

Please sign in to comment.