Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
022d37ab
Commit
022d37ab
authored
8 years ago
by
Andreas Bayha
Browse files
Options
Downloads
Patches
Plain Diff
Improved Tooltip for ComponentEditParts.
refs 2571
parent
baf3e73c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/JavaUtils.java
+29
-1
29 additions, 1 deletion
...trunk/src/org/fortiss/tooling/kernel/utils/JavaUtils.java
with
29 additions
and
1 deletion
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/JavaUtils.java
+
29
−
1
View file @
022d37ab
...
...
@@ -20,13 +20,15 @@ package org.fortiss.tooling.kernel.utils;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang.WordUtils
;
/**
* Class containing mixed useful methods.
*
* @author doebber
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
0AEE36671E84E87EA4
BFDB
32EC21DAC4
* @ConQAT.Rating
YELLOW
Hash:
655690F20BC3825195BAE4B
BF
9
DB
E2FA
*/
public
class
JavaUtils
{
...
...
@@ -59,4 +61,30 @@ public class JavaUtils {
public
static
<
S
,
T
extends
S
>
List
<
T
>
convertList
(
Class
<
T
>
targetClass
,
List
<
S
>
sourceList
)
{
return
(
List
<
T
>)(
List
<?>)
sourceList
;
}
/**
* Wraps long lines in 'str' after 'lineWidth' characters.
* - Words (even long words) will NOT be wrapped.
* - Leading whitespace characters in a line are trimmed.
*
* @param str
* The {@link String} to be mapped.
* @param lineWidth
* The number of characters, after which to wrap the line.
*
* @return The line wrapped String.
*/
public
static
String
wrapLines
(
String
str
,
int
lineWidth
)
{
StringBuilder
buffer
=
new
StringBuilder
();
String
delim
=
""
;
for
(
String
line
:
str
.
trim
().
split
(
"\n"
))
{
buffer
.
append
(
delim
);
delim
=
"\n"
;
// WordUtils.wrap(...) wraps the single lines.
buffer
.
append
(
WordUtils
.
wrap
(
line
,
lineWidth
,
"\n"
,
true
));
}
return
buffer
.
toString
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment