[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] compare two StyleRange[ ]'s

Hi...

i want to compare two StyleRange[],currently there is a method to do so,called
"similarTo". But it applies to StyleRange and not StyleRange[ ].


i have a code,which takes styleranges from styledtext into varaiables a,b.
"getStyleRanges" method takes three parameters
     1)start
     2)length
     3)includeRange

i take one character at a time,get the stylerange,then i want to compare whether they are equal.
but there is no method to do so.


I try to use "equals",but that gives the output as unequal,even when the values a and b are equal.

StyleRange[] a=new StyleRange[0];
StyleRange[] b=new StyleRange[0];


a=styledText.getStyleRanges(i, 1, true); //get stylerange of 1st charater
b=styledText.getStyleRanges(i+1, 1, true); //get stylerange of 2st charater



if(a.equals(b)) { System.out.println("equal"); } else{ System.out.println("unequal"); }

kindly help me solve this.
thanking you
Subin