Project

General

Profile

« Previous | Next » 

Revision f901d8b7

Added by Katja Luther almost 7 years ago

disable content filter in ckEditor to avoid deleting of html tags

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RichTextWithLabelElement.java
134 134
        }
135 135

  
136 136
        text = formFactory.createRichTextEditor(layoutComposite, "", combinedStyle);
137
       // text.setTextLimit(textLimit!=null?textLimit:Text.LIMIT);
138
       
137
        String browsertype = text.getEditorConfiguration().getBrowser().getBrowserType();
138
          
139 139
      
140 140
        addControl(text);
141 141

  
142 142
        // text.setWO
143 143

  
144
        if (textHeight == null) {
145
            text.addKeyListener(new KeyAdapter() {
146
                @Override
147
                public void keyPressed(KeyEvent e) {
148
                    if (e.character == SWT.CR) {
149
                        // Don't accept carriage returns as input when in single
150
                        // line mode
151
                        e.doit = false;
152
                    } else if (e.character == SWT.TAB) {
153
                        // traverse is not working for wrapped text widgets so
154
                        // we reintroduce it here
155
                        e.doit = false;
156
                        text.traverse(SWT.TRAVERSE_TAB_NEXT);
157
                    }
158
                }
159
            });
160
        }
144
//        if (textHeight == null) {
145
//            text.addKeyListener(new KeyAdapter() {
146
//                @Override
147
//                public void keyPressed(KeyEvent e) {
148
//                    if (e.character == SWT.CR) {
149
//                        // Don't accept carriage returns as input when in single
150
//                        // line mode
151
//                        e.doit = false;
152
//                    } else if (e.character == SWT.TAB) {
153
//                        // traverse is not working for wrapped text widgets so
154
//                        // we reintroduce it here
155
//                        e.doit = false;
156
//                        text.traverse(SWT.TRAVERSE_TAB_NEXT);
157
//                    }
158
//                }
159
//            });
160
//        }
161 161

  
162 162
        TableWrapData layoutData;
163 163
        if(isMultiLine){
......
173 173
        text.setLayoutData(layoutData);
174 174

  
175 175
        text.addModifyListener(this);
176
        
176 177

  
177 178
        setText();
178 179
    }
......
297 298
        	}
298 299
    	}
299 300
    	
300
        Listener[] listeners = text.getListeners(SWT.Modify);
301

  
302
        text.removeModifyListener(this);
303
        text.addModifyListener(this);
301
//        Listener[] listeners = text.getListeners(SWT.Modify);
302
//
303
//        text.removeModifyListener(this);
304
//        text.addModifyListener(this);
304 305
//        for (Listener listener : listeners) {
305 306
//            text.removeListener(SWT.Modify, listener);
306 307
//        }
......
335 336
        		if (inref.getTarget() == null){
336 337
        			break;
337 338
        		}
339
        		
338 340
        		htmlString = findHtmlString(text.getText(), inref);
339 341
        		System.out.println("html"+htmlString);
340 342
        		if (htmlString != null){
341 343
        			innerText = findInText(htmlString, "(.+>)(.*)(</span>)");
342 344
        			inLineString = createCdmMarkUp(inref, innerText);
343
        			System.out.println("cdm mark up" + inLineString);
345
        			
344 346
        			convertedString = convertedString.replace(htmlString, inLineString);
345
        			System.out.println("cnvertedString" +convertedString);
347
        			
346 348
        		}else{
347 349
        			convertedString = text.getText();
348 350
        		}
......
439 441
    	}
440 442
    	return null;
441 443
    }
444
    
445
    
446
    
447
    
442 448
}
443 449
	
444 450
	

Also available in: Unified diff