Bug 227559 - Need API to process StyledString
Summary: Need API to process StyledString
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2008-04-17 10:30 EDT by Dani Megert CLA
Modified: 2008-10-29 06:53 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2008-04-17 10:30:46 EDT
I20080415-0800.

In order to support BIDI we need to be able to run the string through the TextProcessor and adjust the styles.

Simplest would be to get proccessText(*) methods that do the same as TextProcessor.process(*).
Comment 1 Boris Bokowski CLA 2008-04-18 17:09:40 EDT
Is there no workaround?
Comment 2 Dani Megert CLA 2008-04-19 06:31:47 EDT
Nope, as we cannot retrieve the style info.
Comment 3 Boris Bokowski CLA 2008-04-19 11:24:56 EDT
Could you attach a patch with the required API?
Comment 4 Dani Megert CLA 2008-04-21 03:02:10 EDT
Sorry, I am overbooked.
Comment 5 Dani Megert CLA 2008-04-21 08:10:50 EDT
Martin might help out here.
Comment 6 Martin Aeschlimann CLA 2008-04-21 08:22:56 EDT
What we would need is new API to insert a String at a given offset in a StyleString (similar to StringBuffer.insert) and an API find out what styler is set a given offset.

I think we should look at this in 3.5. But if the majority thinks we should have it for 3.4 and is willing to ask the PMC to allow new API: I'm willing to provide a patch.
Comment 7 Dani Megert CLA 2008-04-21 09:01:27 EDT
I'm fine with shifting this to 3.5. For now we simply don't style the string. The string itself looks OK.
Comment 8 Boris Bokowski CLA 2008-04-21 10:29:11 EDT
3.5 it is.
Comment 9 Mike Wilson CLA 2008-09-11 15:56:06 EDT
How important is this to properly support bidi in places like the package explorer? Boris owns it, but doesn't understand the bidi aspects. Martin to discuss with Boris.
Comment 10 Martin Aeschlimann CLA 2008-09-12 03:53:23 EDT
Adding Dani. There's not much to do here, just a new API StyledString.insert(string, index).

If we have that, then we can do this in our code:
- We have a styled string that needs to be LTR marked
- We take the bare string and send it through TextProcessor.process
- We compare the output with the original string. We know that all TextProcessor.process does is adding control characters. Sowe can locate these places and use StyleString.insert to update the styled string.
Comment 11 Dani Megert CLA 2008-09-24 08:08:42 EDT
I'll take that bug.
Comment 12 Dani Megert CLA 2008-09-25 04:44:50 EDT
Fixed in HEAD.
Available in builds > N20080924-2050.
Comment 13 Dani Megert CLA 2008-10-29 06:53:11 EDT
Verified in code from I20081029-0100.