当前位置: 首页>>代码示例>>Java>>正文


Java AceEditor.setMode方法代码示例

本文整理汇总了Java中org.vaadin.aceeditor.AceEditor.setMode方法的典型用法代码示例。如果您正苦于以下问题:Java AceEditor.setMode方法的具体用法?Java AceEditor.setMode怎么用?Java AceEditor.setMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.vaadin.aceeditor.AceEditor的用法示例。


在下文中一共展示了AceEditor.setMode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EditTemplateWindow

import org.vaadin.aceeditor.AceEditor; //导入方法依赖的package包/类
public EditTemplateWindow() {
    super("Edit XML Template");
    setWidth(800f, Unit.PIXELS);
    setHeight(600f, Unit.PIXELS);
    content.setMargin(true);

    editor = new AceEditor();
    editor.setImmediate(true);
    editor.setMode(AceMode.xml);
    editor.setSizeFull();
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);
    addComponent(editor);
    content.setExpandRatio(editor, 1.0f);

    Setting templateSetting = component.findSetting(XmlFormatter.XML_FORMATTER_TEMPLATE);
    editor.setValue(templateSetting.getValue());
    editor.setReadOnly(readOnly);

    addComponent(buildButtonFooter(buildCloseButton()));
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:22,代码来源:EditXmlFormatPanel.java

示例2: ImportXmlTemplateWindow

import org.vaadin.aceeditor.AceEditor; //导入方法依赖的package包/类
public ImportXmlTemplateWindow(ImportXmlListener listener, Component component, ApplicationContext context) {
    this.listener = listener;
    this.component = component;
    this.context = context;
    setCaption("Import XML Template");
    setWidth(600.0f, Unit.PIXELS);
    setHeight(500.0f, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    layout.addComponent(new Label("Import XML from either an XSD or WSDL source."));

    optionGroup = new OptionGroup("Select the location of the XSD or WSDL.");
    optionGroup.addItem(OPTION_TEXT);
    optionGroup.addItem(OPTION_FILE);
    optionGroup.addItem(OPTION_URL);
    optionGroup.addItem(OPTION_RESOURCE);
    optionGroup.setNullSelectionAllowed(false);
    optionGroup.setImmediate(true);
    optionGroup.select(OPTION_TEXT);
    optionGroup.addValueChangeListener(this);
    layout.addComponent(optionGroup);

    optionLayout = new VerticalLayout();
    optionLayout.setSizeFull();

    editor = new AceEditor();
    editor.setCaption("Enter the XML text:");
    editor.setMode(AceMode.xml);
    editor.setSizeFull();
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);

    Button importButton = new Button("Import");
    importButton.addClickListener(this);

    upload = new Upload(null, this);
    upload.addSucceededListener(this);
    upload.setButtonCaption(null);
    urlTextField = new TextField("Enter the URL:");
    urlTextField.setWidth(100.0f, Unit.PERCENTAGE);
    
    resourceComboBox = createResourceCB();
    
    layout.addComponent(optionLayout);
    layout.setExpandRatio(optionLayout, 1.0f);
    rebuildOptionLayout();

    addComponent(layout, 1);
    addComponent(buildButtonFooter(importButton, buildCloseButton()));

}
 
开发者ID:JumpMind,项目名称:metl,代码行数:56,代码来源:ImportXmlTemplateWindow.java

示例3: buildUI

import org.vaadin.aceeditor.AceEditor; //导入方法依赖的package包/类
protected void buildUI() {

        ButtonBar buttonBar = new ButtonBar();
        addComponent(buttonBar);

        if (!readOnly) {
          Button testButton = buttonBar.addButton("Test", FontAwesome.FILE_CODE_O);
          testButton.addClickListener(new TestClickListener());
        }

        filterField = buttonBar.addFilter();
        filterField.addTextChangeListener(this);
        
        HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
        splitPanel.setSizeFull();
        splitPanel.setSplitPosition(50, Unit.PERCENTAGE);

        VerticalLayout leftLayout = new VerticalLayout();
        editor = new AceEditor();
        editor.setMode(AceMode.xml);
        editor.setSizeFull();
        editor.setHighlightActiveLine(true);
        editor.setShowPrintMargin(false);
        editor.addTextChangeListener(new StylesheetChangeListener());
        editor.setValue(component.findSetting(XsltProcessor.XSLT_PROCESSOR_STYLESHEET).getValue());
        leftLayout.addComponent(new Label("XSLT Stylesheet"));
        leftLayout.addComponent(editor);
        leftLayout.setExpandRatio(editor, 1.0f);
        leftLayout.setSizeFull();
        splitPanel.setFirstComponent(leftLayout);
        
        VerticalLayout rightLayout = new VerticalLayout();
        rightLayout.setSizeFull();
        rightLayout.addComponent(new Label("Sample Input XML"));
        textArea = new TextArea();
        textArea.setEnabled(false);
        textArea.setSizeFull();
        textArea.setValue(getSampleXml());
        rightLayout.addComponent(textArea);
        rightLayout.setExpandRatio(textArea, 1.0f);
        splitPanel.setSecondComponent(rightLayout);

        addComponent(splitPanel);
        setExpandRatio(splitPanel, 1.0f);
        
        textArea.setReadOnly(readOnly);
        editor.setReadOnly(readOnly);

    }
 
开发者ID:JumpMind,项目名称:metl,代码行数:50,代码来源:EditXsltPanel.java

示例4: refreshSource

import org.vaadin.aceeditor.AceEditor; //导入方法依赖的package包/类
protected void refreshSource(final Trigger trigger) {
	VerticalLayout source = new VerticalLayout();
	source.setSizeFull();
	source.setSpacing(false);

	String sourceText = trigger.getSource();
	if (wrapSourceText) sourceText = wrapSource(sourceText);
	
	AceEditor editor = CommonUiUtils.createAceEditor();
	editor.setMode(AceMode.sql);
	editor.setValue(sourceText);
	editor.setSizeFull();
	source.addComponent(editor);
	source.setExpandRatio(editor, 1);
	
	HorizontalLayout bar = new HorizontalLayout();
	bar.setWidth(100, Unit.PERCENTAGE);
       bar.setMargin(new MarginInfo(false, true, false, true));
       
       MenuBar wrapSelect = new MenuBar();
       wrapSelect.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
       wrapSelect.addStyleName(ValoTheme.MENUBAR_SMALL);
       MenuItem wrapButton = wrapSelect.addItem("Wrap text", new Command() {
       	private static final long serialVersionUID = 1L;
           @Override
           public void menuSelected(MenuItem selectedItem) {
               wrapSourceText = !wrapSourceText;
               tabSheet.removeTab(tabSheet.getTab(1));
               refreshSource(trigger);                
           }
       });
       wrapButton.setIcon(FontAwesome.ALIGN_JUSTIFY);
       
       bar.addComponent(wrapSelect);
       bar.setComponentAlignment(wrapSelect, Alignment.TOP_RIGHT);
       bar.setHeight((float)(2.5), Unit.REM);
       source.addComponent(bar);
	
	tabSheet.addTab(source, "Source");
	tabSheet.setSelectedTab(source);
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:42,代码来源:TriggerInfoPanel.java

示例5: buildContentPanel

import org.vaadin.aceeditor.AceEditor; //导入方法依赖的package包/类
private Panel buildContentPanel() {
	Panel panel = new Panel();
	panel.setSizeFull();

	VerticalLayout mainLayout = new VerticalLayout();
	mainLayout.setSizeFull();
	panel.setContent(mainLayout);

	Panel controlPanel = new Panel();
	controlPanel.setHeight("50px");
	controlPanel.setWidth(100, Unit.PERCENTAGE);
	mainLayout.addComponent(controlPanel);

	Button showButton = new Button("Show");
	showButton.addClickListener(e -> showSlide());

	controlPanel.setContent(showButton);

	// VerticalSplitPanel splitPanel = new VerticalSplitPanel();
	// splitPanel.setSizeFull();
	// mainLayout.addComponent(splitPanel);
	// mainLayout.setExpandRatio(splitPanel, 1.0f);

	VerticalLayout verticalLayout = new VerticalLayout();
	verticalLayout.setSizeFull();
	mainLayout.addComponent(verticalLayout);
	mainLayout.setExpandRatio(verticalLayout, 1.0f);

	editor1 = new AceEditor();
	editor1.setSizeFull();
	editor1.setMode(AceMode.xml);
	// editor1.setTheme("ace/theme/eclipse");

	editor2 = new AceEditor();
	editor2.setSizeFull();
	editor2.setMode(AceMode.xml);

	// splitPanel.setFirstComponent(editor1);
	// splitPanel.setSecondComponent(editor2);

	verticalLayout.addComponent(editor1);
	// verticalLayout.setExpandRatio(editor1, 0.5f);

	verticalLayout.addComponent(editor2);
	// verticalLayout.setExpandRatio(editor2, 0.5f);

	return panel;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:49,代码来源:SlideManagementView.java


注:本文中的org.vaadin.aceeditor.AceEditor.setMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。