Skip to content

Commit

Permalink
Merge pull request #13396 from iterate-ch/feature/GH-13376-placeholder
Browse files Browse the repository at this point in the history
Allow to set placeholder for hostname in connection profile
  • Loading branch information
dkocher authored May 20, 2022
2 parents 996742d + 919a04d commit d362b55
Show file tree
Hide file tree
Showing 33 changed files with 49 additions and 30 deletions.
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (ap-mumbai-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (ap-osaka-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (ap-seoul-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (ap-sydney-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (ap-tokyo-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (eu-milan-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (eu-zurich-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (me-dubai-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (me-jeddah-1).cyberduckprofile
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
2 changes: 1 addition & 1 deletion profiles/OCI Object Storage (uk-london-1).cyberduckprofile
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

0 comments on commit d362b55

Please sign in to comment.