split.setRightComponent ( editorsContainer );
}
private Component createSingleXmlEditor ( final Theme theme, final String xml, final ResourceFile xmlFile )
{
final WebSyntaxArea xmlEditor = new WebSyntaxArea ( xml, SyntaxPreset.xml );
xmlEditor.applyPresets ( SyntaxPreset.base );
xmlEditor.applyPresets ( SyntaxPreset.margin );
xmlEditor.applyPresets ( SyntaxPreset.size );
xmlEditor.applyPresets ( SyntaxPreset.historyLimit );
xmlEditor.setCaretPosition ( 0 );
xmlEditor.setHyperlinksEnabled ( true );
xmlEditor.setLinkGenerator ( new CodeLinkGenerator ( xmlEditor ) );
HotkeyManager.registerHotkey ( xmlEditor, xmlEditor, Hotkey.CTRL_SHIFT_Z, new HotkeyRunnable ()
{
@Override
public void run ( final KeyEvent e )
{
xmlEditor.undoLastAction ();
}
} );
// Creating editor scroll with preferred settings
final WebSyntaxScrollPane xmlEditorScroll = new WebSyntaxScrollPane ( xmlEditor, false );
// Applying editor theme after scroll creation
theme.apply ( xmlEditor );
// Start listening edits
xmlEditor.onChange ( new DocumentEventRunnable ()
{
private final WebTimer updateTimer = new WebTimer ( updateDelay, new ActionListener ()
{
@Override
public void actionPerformed ( final ActionEvent e )
{
TimeUtils.pinTime ();
SkinInfoConverter.addCustomResource ( xmlFile.getClassName (), xmlFile.getSource (), xmlEditor.getText () );
applySkin ();
TimeUtils.showPassedTime ( "Time to apply skin: " );
}
} ).setRepeats ( false );