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

Allow to set placeholder for hostname in connection profile #13396

Merged
merged 3 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions core/src/main/java/ch/cyberduck/core/AbstractProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ public boolean isUTCTimezone() {
return true;
}

@Override
public String getHostnamePlaceholder() {
return this.getDefaultHostname();
}

@Override
public String getUsernamePlaceholder() {
return LocaleFactory.localizedString("Username", "Credentials");
Expand Down
9 changes: 9 additions & 0 deletions core/src/main/java/ch/cyberduck/core/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ public Type getType() {
return parent.getType();
}

@Override
public String getHostnamePlaceholder() {
final String v = this.value("Hostname Placeholder");
if(StringUtils.isBlank(v)) {
return parent.getHostnamePlaceholder();
}
return v;
}

@Override
public String getUsernamePlaceholder() {
final String v = this.value("Username Placeholder");
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/ch/cyberduck/core/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ public interface Protocol extends Comparable<Protocol>, Serializable {

String favicon();

/**
* @return Host label
*/
String getHostnamePlaceholder();

/**
* @return Username label
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void setHostField(final NSTextField field) {
public void change(final Host bookmark) {
updateField(hostField, bookmark.getHostname());
hostField.setEnabled(bookmark.getProtocol().isHostnameConfigurable());
hostField.cell().setPlaceholderString(bookmark.getProtocol().getDefaultHostname());
hostField.cell().setPlaceholderString(bookmark.getProtocol().getHostnamePlaceholder());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-chuncheon-1</string>
<key>Description</key>
<string>Oracle Cloud Infrastructure (ap-chuncheon-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-chuncheon-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-hyderabad-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-hyderabad-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-hyderabad-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-melbourne-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-melbourne-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-melbourne-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-mumbai-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-mumbai-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-mumbai-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-osaka-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-osaka-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-osaka-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-seoul-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-seoul-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-seoul-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-singapore-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-singapore-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-singapore-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-sydney-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-sydney-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-sydney-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ap-tokyo-1</string>
<key>Description</key>
<string>OCI Object Storage (ap-tokyo-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ap-tokyo-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ca-montreal-1</string>
<key>Description</key>
<string>OCI Object Storage (ca-montreal-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ca-montreal-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-ca-toronto-1</string>
<key>Description</key>
<string>OCI Object Storage (ca-toronto-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.ca-toronto-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-amsterdam-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-amsterdam-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-amsterdam-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-frankfurt-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-frankfurt-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-frankfurt-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-marseille-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-marseille-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-marseille-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-milan-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-milan-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-milan-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-stockholm-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-stockholm-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-stockholm-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-eu-zurich-1</string>
<key>Description</key>
<string>OCI Object Storage (eu-zurich-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.eu-zurich-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-il-jerusalem-1</string>
<key>Description</key>
<string>OCI Object Storage (il-jerusalem-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.il-jerusalem-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-me-abudhabi-1</string>
<key>Description</key>
<string>OCI Object Storage (me-abudhabi-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.me-abudhabi-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-me-dubai-1</string>
<key>Description</key>
<string>OCI Object Storage (me-dubai-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.me-dubai-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-me-jeddah-1</string>
<key>Description</key>
<string>OCI Object Storage (me-jeddah-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.me-jeddah-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-sa-santiago-1</string>
<key>Description</key>
<string>OCI Object Storage (sa-santiago-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.sa-santiago-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-sa-saopaulo-1</string>
<key>Description</key>
<string>OCI Object Storage (sa-saopaulo-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.sa-saopaulo-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-sa-vinhedo-1</string>
<key>Description</key>
<string>OCI Object Storage (sa-vinhedo-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.sa-vinhedo-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-uk-cardiff-1</string>
<key>Description</key>
<string>OCI Object Storage (uk-cardiff-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.uk-cardiff-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-uk-london-1</string>
<key>Description</key>
<string>OCI Object Storage (uk-london-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.uk-london-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-us-ashburn-1</string>
<key>Description</key>
<string>OCI Object Storage (us-ashburn-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.us-ashburn-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-us-phoenix-1</string>
<key>Description</key>
<string>OCI Object Storage (us-phoenix-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.us-phoenix-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>oracle-us-sanjose-1</string>
<key>Description</key>
<string>OCI Object Storage (us-sanjose-1)</string>
<key>Default Hostname</key>
<key>Hostname Placeholder</key>
<string>&lt;namespace&gt;.compat.objectstorage.us-sanjose-1.oraclecloud.com</string>
<key>Hostname Configurable</key>
<true/>
Expand Down