Fix gradle and add workflows
Build and Test j3270 / Build JAR & Run Tests (push) Failing after 2m24s

This commit is contained in:
2026-08-20 18:24:35 -04:00
parent 80166c477b
commit a1b1273022
68 changed files with 1102 additions and 153 deletions
+13 -1
View File
@@ -7,5 +7,17 @@ dependencies {
}
application {
mainClass = 'org.j3270.J3270App'
mainClass = 'org.pubvm.j3270.J3270App'
}
jar {
manifest {
attributes 'Main-Class': 'org.pubvm.j3270.J3270App',
'Implementation-Title': 'j3270',
'Implementation-Version': archiveVersion
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -194,19 +194,18 @@ public class FileTransfer implements FTCut.FTCutListener, FTDft.FTDftListener {
// ========== FTCutListener / FTDftListener Callbacks ==========
@Override
public void onTransferRunning() {
// Mode detection check
StackTraceElement[] st = Thread.currentThread().getStackTrace();
boolean isDft = false;
for (StackTraceElement elem : st) {
if (elem.getClassName().contains("FTDft")) {
isDft = true;
break;
}
}
public void onCutRunning() {
handleTransferRunning(FTMode.CUT);
}
@Override
public void onDftRunning() {
handleTransferRunning(FTMode.DFT);
}
private void handleTransferRunning(FTMode mode) {
if (activeMode == FTMode.UNKNOWN) {
activeMode = isDft ? FTMode.DFT : FTMode.CUT;
activeMode = mode;
log.info("FT mode established: " + activeMode);
try {
if (activeMode == FTMode.DFT) {
@@ -492,6 +492,14 @@ public class TerminalPanel extends JPanel {
// Clear
bindKeyToMap(im, "CLEAR", org.pubvm.j3270.config.Settings.getKeyBinding("CLEAR", "alt C"));
// Extended 3270 functions
bindKeyToMap(im, "ERASE_INPUT", org.pubvm.j3270.config.Settings.getKeyBinding("ERASE_INPUT", "alt E"));
bindKeyToMap(im, "NEWLINE", org.pubvm.j3270.config.Settings.getKeyBinding("NEWLINE", "shift ENTER"));
bindKeyToMap(im, "DUP", org.pubvm.j3270.config.Settings.getKeyBinding("DUP", "alt D"));
bindKeyToMap(im, "FIELD_MARK", org.pubvm.j3270.config.Settings.getKeyBinding("FIELD_MARK", "alt M"));
bindKeyToMap(im, "ATTN", org.pubvm.j3270.config.Settings.getKeyBinding("ATTN", "alt A"));
bindKeyToMap(im, "SYSREQ", org.pubvm.j3270.config.Settings.getKeyBinding("SYSREQ", "alt S"));
// Copy/Paste bindings — Cmd+C / Cmd+V (macOS) or Ctrl+C / Ctrl+V (others)
int shortcutMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, shortcutMask), "j3270-COPY");
@@ -514,6 +522,12 @@ public class TerminalPanel extends JPanel {
am.put("j3270-BACK_SPACE", createAction(this::handleBackspace));
am.put("j3270-INSERT", createAction(this::handleInsert));
am.put("j3270-CLEAR", createAction(this::handleClear));
am.put("j3270-ERASE_INPUT", createAction(this::handleEraseInput));
am.put("j3270-NEWLINE", createAction(this::handleNewline));
am.put("j3270-DUP", createAction(this::handleDup));
am.put("j3270-FIELD_MARK", createAction(this::handleFieldMark));
am.put("j3270-ATTN", createAction(this::handleAttn));
am.put("j3270-SYSREQ", createAction(this::handleSysReq));
// Copy/Paste actions
am.put("j3270-COPY", createAction(this::copySelection));
@@ -658,6 +672,47 @@ public class TerminalPanel extends JPanel {
}
}
private void handleEraseInput() {
if (client != null && client.getConnectionState().isFullSession()) {
client.eraseInput();
refreshScreen();
}
}
private void handleNewline() {
if (client != null && client.getConnectionState().isFullSession()) {
client.newline();
refreshScreen();
}
}
private void handleDup() {
if (client != null && client.getConnectionState().isFullSession()) {
client.dup();
refreshScreen();
}
}
private void handleFieldMark() {
if (client != null && client.getConnectionState().isFullSession()) {
client.fieldMark();
refreshScreen();
}
}
private void handleAttn() {
if (client != null && client.isConnected()) {
client.attn();
}
}
private void handleSysReq() {
if (client != null && client.isConnected()) {
client.sysReq();
refreshScreen();
}
}
private void refreshScreen() {
repaint();
// Notify parent to update status bar too