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

JBIDE-21069 Application wizard: long project display names mess up project selection #948

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

scabanovich
Copy link
Contributor

Length of label text returned by OpenShiftExplorerLabelProvider is limited.
This provider is used not only in explorer but in many viewers in wizards.
It is not user friendly to display the entire value if its length is unreasonably large.
In this solution, ellipses are applied if length exceeds 120 symbols.

@@ -144,6 +144,16 @@ public void getStyledTextForADeploymentConfig(){
}

@Test
public void getStyledTextForADeploymentConfigWithLongNames(){
IDeploymentConfig config = givenAResource(IDeploymentConfig.class, ResourceKind.DEPLOYMENT_CONFIG);
Map<String, String> selector = new HashMap<String, String>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new HashMap<>(2)

@fbricon
Copy link
Member

fbricon commented Feb 4, 2016

It works but still not really practical http://screencast.com/t/bbN3kyRE

Maybe limit to 60 chars?

@scabanovich
Copy link
Contributor Author

@fbricon , I can set different limits for explorer and viewers in wizards/editors. Explorer can show it longer. To compare, Package Explorer and Outline for Java classes shows as long names as I tried. So may it be good 120 for explorer and 60 elsewhere?
(Making it 120, I remembered that some German words are intimidatingly long.

@scabanovich scabanovich force-pushed the jbide-21069 branch 3 times, most recently from f506496 to b6cc0be Compare February 4, 2016 22:25
@scabanovich
Copy link
Contributor Author

Limited by default by 60 chars and added method

public void setLabelLimit(int limit)

@adietish
Copy link
Member

adietish commented Feb 5, 2016

org.jboss.tools.openshift.common.core.utils.StringUtils.shorten(string, maxlength) already has a similiar method that shortens a given label to a given maximum length.
The strategy is different though: it will display the beginning and the end of the given string, using half of the available characters for the begininng, the other half for the end.
I have a slight preference for this since in general terms I'd consider the beginning and the end as the parts that matter (ex. filepath).
If you still believe that the strategy suggested in this PR is superios I'd still move your approach to StringUtils.

@scabanovich
Copy link
Contributor Author

@adietish , I agree that each part of the label should be shortened with StringUtils.shorten(), and I still think that shortening is better to distribute between parts so that user could see some of main part and some of qualifier. Do you think method shorten(String[] parts) may be added to StringUtils?

…oject selection

Limited length of label text returned by OpenShiftExplorerLabelProvider.
This provider is used not only in explorer but in many viewers in wisards.
It is not user friendly to display the entire value if its length is unreasonably large.
In this solution, ellipses are applied if length exceeds 120 symbols.
@fbricon fbricon merged commit 5810834 into jbosstools:master Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants