Skip to content

Commit d6e264a

Browse files
committed
Cleanup Terminal from deprecated code and extension interfaces
As we now have a new namespace we can use the opportunity to remove any deprecated code and squash previous extension interfaces into one.
1 parent f38c5a8 commit d6e264a

File tree

27 files changed

+76
-446
lines changed

27 files changed

+76
-446
lines changed

.github/workflows/doCleanCode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
author: Eclipse Platform Bot <[email protected]>
1515
do-quickfix: false
1616
do-cleanups: true
17-
bundle-folders: ant/*/ debug/*/ resources/bundles/*/ runtime/bundles/*/ team/bundles/*/ ua/*/ update/*/ platform/*/
17+
bundle-folders: ant/*/ debug/*/ resources/bundles/*/ runtime/bundles/*/ team/bundles/*/ ua/*/ update/*/ platform/*/ terminal/plugins/*/
1818
secrets:
1919
token: ${{ secrets.PLATFORM_BOT_PAT }}

debug/org.eclipse.debug.terminal/src/org/eclipse/debug/terminal/ui/ConsoleTerminalListener.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ public void setState(TerminalState state) {
2424
}
2525

2626
@Override
27-
public void setTerminalTitle(String title) {
28-
// TODO redirect to the console?
27+
public void setTerminalSelectionChanged() {
28+
29+
}
30+
31+
@Override
32+
public void setTerminalTitle(String title, TerminalTitleRequestor requestor) {
33+
2934
}
3035

3136
}

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalListener.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*******************************************************************************/
1414
package org.eclipse.terminal.internal.control;
1515

16-
import org.eclipse.terminal.internal.control.ITerminalListener3.TerminalTitleRequestor;
1716
import org.eclipse.terminal.internal.provisional.api.TerminalState;
1817

1918
/**
@@ -29,10 +28,31 @@ public interface ITerminalListener {
2928
void setState(TerminalState state);
3029

3130
/**
32-
* @deprecated Migrate to implementing {@link ITerminalListener3} and
33-
* override {@link ITerminalListener3#setTerminalTitle(String, TerminalTitleRequestor)}
34-
* @param title
31+
* selection has been changed internally e.g. select all
32+
* clients might want to react on that
33+
* NOTE: this does not include mouse selections
34+
* those are handled in separate MouseListeners
35+
* TODO should be unified
3536
*/
36-
@Deprecated(forRemoval = true)
37-
void setTerminalTitle(String title);
37+
void setTerminalSelectionChanged();
38+
39+
/**
40+
* Enum defines terminal title change requestors for
41+
* setTerminalTitle method.
42+
*
43+
* @since 5.5
44+
*/
45+
enum TerminalTitleRequestor {
46+
ANSI, // Terminal tab title change requested using ANSI command in terminal.
47+
MENU, // Terminal tab title change requested from menu.
48+
OTHER; // Terminal tab title change requested by other requestors.
49+
}
50+
51+
/**
52+
* Set the title of the terminal.
53+
*
54+
* @param title Terminal title.
55+
* @param requestor Item that requests terminal title update.
56+
*/
57+
void setTerminalTitle(String title, TerminalTitleRequestor requestor);
3858
}

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalListener2.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalListener3.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalMouseListener.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,42 @@
1919
* @see ITerminalMouseListener2
2020
*/
2121
public interface ITerminalMouseListener {
22+
2223
/**
2324
* Invoked when a double-click has happend inside the terminal control.<br>
2425
* <br>
2526
* <strong>Important:</strong> the event fires for every click, even outside the text region.
2627
* @param terminalText a read-only view of the current terminal text
2728
* @param button see {@link org.eclipse.swt.events.MouseEvent#button} for the meaning of the button values
29+
* @param stateMask see {@link org.eclipse.swt.events.MouseEvent#stateMask} for the meaning of the values
2830
*/
29-
void mouseDoubleClick(ITerminalTextDataReadOnly terminalText, int line, int column, int button);
31+
default void mouseDoubleClick(ITerminalTextDataReadOnly terminalText, int line, int column, int button,
32+
int stateMask) {
33+
// do nothing by default so that implementors only need to implement methods they care about
34+
}
3035

3136
/**
3237
* Invoked when a mouse button is pushed down inside the terminal control.<br>
3338
* <br>
3439
* <strong>Important:</strong> the event fires for every mouse down, even outside the text region.
3540
* @param terminalText a read-only view of the current terminal text
3641
* @param button see {@link org.eclipse.swt.events.MouseEvent#button} for the meaning of the button values
42+
* @param stateMask see {@link org.eclipse.swt.events.MouseEvent#stateMask} for the meaning of the values
3743
*/
38-
void mouseDown(ITerminalTextDataReadOnly terminalText, int line, int column, int button);
44+
default void mouseDown(ITerminalTextDataReadOnly terminalText, int line, int column, int button, int stateMask) {
45+
// do nothing by default so that implementors only need to implement methods they care about
46+
}
3947

4048
/**
4149
* Invoked when a mouse button is released inside the terminal control.<br>
4250
* <br>
4351
* <strong>Important:</strong> the event fires for every mouse up, even outside the text region.
4452
* @param terminalText a read-only view of the current terminal text
4553
* @param button see {@link org.eclipse.swt.events.MouseEvent#button} for the meaning of the button values
54+
* @param stateMask see {@link org.eclipse.swt.events.MouseEvent#stateMask} for the meaning of the values
4655
*/
47-
void mouseUp(ITerminalTextDataReadOnly terminalText, int line, int column, int button);
56+
default void mouseUp(ITerminalTextDataReadOnly terminalText, int line, int column, int button, int stateMask) {
57+
// do nothing by default so that implementors only need to implement methods they care about
58+
}
59+
4860
}

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalMouseListener2.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/ITerminalViewControl.java

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
******************************************************************************/
1717
package org.eclipse.terminal.internal.control;
1818

19-
import java.io.UnsupportedEncodingException;
2019
import java.nio.charset.Charset;
2120

2221
import org.eclipse.swt.dnd.Clipboard;
2322
import org.eclipse.swt.graphics.Font;
2423
import org.eclipse.swt.widgets.Control;
25-
import org.eclipse.terminal.internal.control.ITerminalListener3.TerminalTitleRequestor;
24+
import org.eclipse.terminal.internal.control.ITerminalListener.TerminalTitleRequestor;
2625
import org.eclipse.terminal.internal.provisional.api.ITerminalConnector;
2726
import org.eclipse.terminal.internal.provisional.api.ITerminalControl;
2827
import org.eclipse.terminal.internal.provisional.api.TerminalState;
@@ -34,15 +33,6 @@
3433
* @noimplement This interface is not intended to be implemented by clients.
3534
*/
3635
public interface ITerminalViewControl {
37-
/**
38-
* Set the encoding that the Terminal uses to decode byte streams into
39-
* characters.
40-
*
41-
* @see ITerminalControl#setEncoding(String)
42-
* @deprecated Use {@link #setCharset(Charset)} and do the error handling in the UI code.
43-
*/
44-
@Deprecated
45-
void setEncoding(String encoding) throws UnsupportedEncodingException;
4636

4737
/**
4838
* Set the charset that the Terminal uses to decode byte streams into
@@ -53,16 +43,6 @@ public interface ITerminalViewControl {
5343
*/
5444
void setCharset(Charset charset);
5545

56-
/**
57-
* Get the Terminal's current encoding.
58-
*
59-
* @return the current Encoding of the Terminal.
60-
* @see ITerminalControl#getEncoding()
61-
* @deprecated Use {@link #getCharset()} and call {@link Charset#name()} on the result
62-
*/
63-
@Deprecated
64-
String getEncoding();
65-
6646
/**
6747
* @return the non-<code>null</code> current Charset of the Terminal.
6848
* @see ITerminalControl#getCharset()
@@ -72,14 +52,6 @@ public interface ITerminalViewControl {
7252

7353
boolean isEmpty();
7454

75-
/**
76-
* Sets the Terminal font
77-
* @deprecated use {@link #setFont(String)} in order to support bold and italic variants of the given font
78-
* @param font
79-
*/
80-
@Deprecated
81-
void setFont(Font font);
82-
8355
/**
8456
* Sets the font for the Terminal, using a JFace symbolic font name, such
8557
* that bold and italic variants can be leveraged.
@@ -190,13 +162,6 @@ public interface ITerminalViewControl {
190162
*/
191163
void removeMouseListener(ITerminalMouseListener listener);
192164

193-
/**
194-
* @since 5.1
195-
* @deprecated call {@link #setTerminalTitle(String, TerminalTitleRequestor)} instead
196-
*/
197-
@Deprecated(forRemoval = true)
198-
void setTerminalTitle(String newTitle);
199-
200165
/**
201166
* Set the title of the terminal.
202167
* @param newTitle

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/control/impl/ITerminalControlForText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import java.io.OutputStream;
1616

17-
import org.eclipse.terminal.internal.control.ITerminalListener3.TerminalTitleRequestor;
17+
import org.eclipse.terminal.internal.control.ITerminalListener.TerminalTitleRequestor;
1818
import org.eclipse.terminal.internal.provisional.api.ITerminalConnector;
1919
import org.eclipse.terminal.internal.provisional.api.TerminalState;
2020

terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/terminal/internal/emulator/VT100Emulator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import org.eclipse.swt.events.ControlEvent;
4646
import org.eclipse.swt.events.ControlListener;
4747
import org.eclipse.swt.graphics.RGB;
48-
import org.eclipse.terminal.internal.control.ITerminalListener3.TerminalTitleRequestor;
48+
import org.eclipse.terminal.internal.control.ITerminalListener.TerminalTitleRequestor;
4949
import org.eclipse.terminal.internal.control.impl.ITerminalControlForText;
5050
import org.eclipse.terminal.internal.control.impl.TerminalPlugin;
5151
import org.eclipse.terminal.internal.provisional.api.ITerminalConnector;

0 commit comments

Comments
 (0)