Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed duplicate button, and middle-align label #4534

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public IAction open() {
FormData fdlName = new FormData();
fdlName.left = new FormAttachment(0, 0);
fdlName.right = new FormAttachment(middle, -margin);
fdlName.top = new FormAttachment(0, margin);
wlName.setLayoutData(fdlName);
wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wName);
Expand All @@ -157,6 +156,7 @@ public IAction open() {
fdName.top = new FormAttachment(0, margin);
fdName.right = new FormAttachment(100, 0);
wName.setLayoutData(fdName);
fdlName.top = new FormAttachment(wName, 0, SWT.CENTER);

CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
Expand Down Expand Up @@ -196,7 +196,6 @@ public IAction open() {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
fdlPrevious.top = new FormAttachment(wName, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wFiles, SWT.CHECK);
Expand All @@ -207,6 +206,7 @@ public IAction open() {
fdPrevious.top = new FormAttachment(wlPrevious, 0, SWT.CENTER);
fdPrevious.right = new FormAttachment(100, 0);
wPrevious.setLayoutData(fdPrevious);
fdlPrevious.top = new FormAttachment(wPrevious, 0, SWT.CENTER);
wPrevious.addSelectionListener(
new SelectionAdapter() {
@Override
Expand All @@ -222,7 +222,6 @@ public void widgetSelected(SelectionEvent e) {
PropsUi.setLook(wlxmlFilename);
FormData fdlxmlFilename = new FormData();
fdlxmlFilename.left = new FormAttachment(0, 0);
fdlxmlFilename.top = new FormAttachment(wlPrevious, 2 * margin);
fdlxmlFilename.right = new FormAttachment(middle, -margin);
wlxmlFilename.setLayoutData(fdlxmlFilename);
wbxmlFilename = new Button(wFiles, SWT.PUSH | SWT.CENTER);
Expand All @@ -237,9 +236,10 @@ public void widgetSelected(SelectionEvent e) {
wxmlFilename.addModifyListener(lsMod);
FormData fdxmlFilename = new FormData();
fdxmlFilename.left = new FormAttachment(middle, 0);
fdxmlFilename.top = new FormAttachment(wlPrevious, 2 * margin);
fdxmlFilename.right = new FormAttachment(wbxmlFilename, -margin);
fdxmlFilename.top = new FormAttachment(wbxmlFilename, 0, SWT.CENTER);
fdxmlFilename.right = new FormAttachment(wbxmlFilename);
wxmlFilename.setLayoutData(fdxmlFilename);
fdlxmlFilename.top = new FormAttachment(wbxmlFilename, 0, SWT.CENTER);

// Whenever something changes, set the tooltip to the expanded version:
wxmlFilename.addModifyListener(
Expand All @@ -261,7 +261,6 @@ public void widgetSelected(SelectionEvent e) {
PropsUi.setLook(wlxslFilename);
FormData fdlxslFilename = new FormData();
fdlxslFilename.left = new FormAttachment(0, 0);
fdlxslFilename.top = new FormAttachment(wxmlFilename, margin);
fdlxslFilename.right = new FormAttachment(middle, -margin);
wlxslFilename.setLayoutData(fdlxslFilename);
wbxslFilename = new Button(wFiles, SWT.PUSH | SWT.CENTER);
Expand All @@ -276,9 +275,10 @@ public void widgetSelected(SelectionEvent e) {
wxslFilename.addModifyListener(lsMod);
FormData fdxslFilename = new FormData();
fdxslFilename.left = new FormAttachment(middle, 0);
fdxslFilename.top = new FormAttachment(wxmlFilename, margin);
fdxslFilename.right = new FormAttachment(wbxslFilename, -margin);
fdxslFilename.top = new FormAttachment(wbxslFilename, 0, SWT.CENTER);
fdxslFilename.right = new FormAttachment(wbxslFilename);
wxslFilename.setLayoutData(fdxslFilename);
fdlxslFilename.top = new FormAttachment(wbxslFilename, 0, SWT.CENTER);

// Whenever something changes, set the tooltip to the expanded version:
wxslFilename.addModifyListener(
Expand All @@ -294,24 +294,12 @@ public void widgetSelected(SelectionEvent e) {
FILETYPES_XSL,
true));

// Browse Source folders button ...
Button wbOutputDirectory = new Button(wFiles, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbOutputDirectory);
wbOutputDirectory.setText(BaseMessages.getString(PKG, CONST_SYSTEM_BUTTON_BROWSE));
FormData fdbOutputDirectory = new FormData();
fdbOutputDirectory.right = new FormAttachment(100, 0);
fdbOutputDirectory.top = new FormAttachment(wXSLTFactory, margin);
wbOutputDirectory.setLayoutData(fdbOutputDirectory);
wbOutputDirectory.addListener(
SWT.Selection, e -> BaseDialog.presentDirectoryDialog(shell, wOutputFilename, variables));

// OutputFilename
wlOutputFilename = new Label(wFiles, SWT.RIGHT);
wlOutputFilename.setText(BaseMessages.getString(PKG, "ActionXSLT.OutputFilename.Label"));
PropsUi.setLook(wlOutputFilename);
FormData fdlOutputFilename = new FormData();
fdlOutputFilename.left = new FormAttachment(0, 0);
fdlOutputFilename.top = new FormAttachment(wxslFilename, margin);
fdlOutputFilename.right = new FormAttachment(middle, -margin);
wlOutputFilename.setLayoutData(fdlOutputFilename);

Expand All @@ -325,14 +313,15 @@ public void widgetSelected(SelectionEvent e) {
wbMovetoDirectory.setLayoutData(fdbMovetoDirectory);
wbMovetoDirectory.addListener(
SWT.Selection, e -> BaseDialog.presentDirectoryDialog(shell, wOutputFilename, variables));
fdlOutputFilename.top = new FormAttachment(wbMovetoDirectory, 0, SWT.CENTER);

wOutputFilename = new TextVar(variables, wFiles, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wOutputFilename);
wOutputFilename.addModifyListener(lsMod);
FormData fdOutputFilename = new FormData();
fdOutputFilename.left = new FormAttachment(middle, 0);
fdOutputFilename.top = new FormAttachment(wxslFilename, margin);
fdOutputFilename.right = new FormAttachment(wbMovetoDirectory, -margin);
fdOutputFilename.top = new FormAttachment(wbMovetoDirectory, 0, SWT.CENTER);
fdOutputFilename.right = new FormAttachment(wbMovetoDirectory);
wOutputFilename.setLayoutData(fdOutputFilename);

// Whenever something changes, set the tooltip to the expanded version:
Expand Down Expand Up @@ -368,7 +357,6 @@ public void widgetSelected(SelectionEvent e) {
PropsUi.setLook(wlXSLTFactory);
FormData fdlXSLTFactory = new FormData();
fdlXSLTFactory.left = new FormAttachment(0, 0);
fdlXSLTFactory.top = new FormAttachment(wFiles, margin);
fdlXSLTFactory.right = new FormAttachment(middle, -margin);
wlXSLTFactory.setLayoutData(fdlXSLTFactory);
wXSLTFactory = new CCombo(wFileResult, SWT.BORDER | SWT.READ_ONLY);
Expand All @@ -382,6 +370,7 @@ public void widgetSelected(SelectionEvent e) {
wXSLTFactory.setLayoutData(fdXSLTFactory);
wXSLTFactory.add("JAXP");
wXSLTFactory.add("SAXON");
fdlXSLTFactory.top = new FormAttachment(wXSLTFactory, 0, SWT.CENTER);

// IF File Exists
Label wlIfFileExists = new Label(wFileResult, SWT.RIGHT);
Expand All @@ -390,13 +379,13 @@ public void widgetSelected(SelectionEvent e) {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, -margin);
fdlIfFileExists.top = new FormAttachment(wXSLTFactory, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wFileResult, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfFileExists.add(BaseMessages.getString(PKG, "ActionXSLT.Create_NewFile_IfFileExists.Label"));
wIfFileExists.add(BaseMessages.getString(PKG, "ActionXSLT.Do_Nothing_IfFileExists.Label"));
wIfFileExists.add(BaseMessages.getString(PKG, "ActionXSLT.Fail_IfFileExists.Label"));
wIfFileExists.select(1); // +1: starts at -1
fdlIfFileExists.top = new FormAttachment(wIfFileExists, 0, SWT.CENTER);

PropsUi.setLook(wIfFileExists);
FormData fdIfFileExists = new FormData();
Expand All @@ -417,7 +406,6 @@ public void widgetSelected(SelectionEvent e) {
PropsUi.setLook(wlAddFileToResult);
FormData fdlAddFileToResult = new FormData();
fdlAddFileToResult.left = new FormAttachment(0, 0);
fdlAddFileToResult.top = new FormAttachment(wIfFileExists, margin);
fdlAddFileToResult.right = new FormAttachment(middle, -margin);
wlAddFileToResult.setLayoutData(fdlAddFileToResult);
wAddFileToResult = new Button(wFileResult, SWT.CHECK);
Expand All @@ -426,7 +414,7 @@ public void widgetSelected(SelectionEvent e) {
BaseMessages.getString(PKG, "ActionXSLT.AddFileToResult.Tooltip"));
FormData fdAddFileToResult = new FormData();
fdAddFileToResult.left = new FormAttachment(middle, 0);
fdAddFileToResult.top = new FormAttachment(wlAddFileToResult, 0, SWT.CENTER);
fdAddFileToResult.top = new FormAttachment(wIfFileExists, margin);
fdAddFileToResult.right = new FormAttachment(100, 0);
wAddFileToResult.setLayoutData(fdAddFileToResult);
wAddFileToResult.addSelectionListener(
Expand All @@ -436,6 +424,7 @@ public void widgetSelected(SelectionEvent e) {
action.setChanged();
}
});
fdlAddFileToResult.top = new FormAttachment(wAddFileToResult, 0, SWT.CENTER);

FormData fdFileResult = new FormData();
fdFileResult.left = new FormAttachment(0, margin);
Expand Down
Loading