• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AceEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: prepareComponents

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
private void prepareComponents() {
    name.setIcon(FontAwesome.ARROW_RIGHT);
    name.setWidth(100, Unit.PERCENTAGE);

    ((AceEditor) valueEditor).setTheme(AceTheme.textmate);
    ((AceEditor) valueEditor).setShowGutter(true);
    ((AceEditor) valueEditor).setSizeFull();
    ((AceEditor) valueEditor).setHeight(150, Unit.PIXELS);
    if (Objects.equals(type, TYPE.INPUT)) {
        ((AceEditor) valueEditor).setMode(AceMode.groovy);
    } else {
        ((AceEditor) valueEditor).setMode(AceMode.json);
    }
    valueEditor.setWidth(100, Unit.PERCENTAGE);
    if (suggester != null) {
        SuggestionExtension extension = new SuggestionExtension(suggester);
        extension.setSuggestOnDot(false);
        extension.extend(valueEditor);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:21,代码来源:ParameterForm.java


示例2: 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


示例3: buildSqlEditor

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
protected AceEditor buildSqlEditor() {
    editor = CommonUiUtils.createAceEditor();
    editor.setMode(AceMode.sql);
    editor.addValueChangeListener(new com.vaadin.data.HasValue.ValueChangeListener<String>() {
        
        @Override
        public void valueChange(com.vaadin.data.HasValue.ValueChangeEvent<String> event) {
            if (!editor.getValue().equals("")) {
                executeAtCursorButtonValue = true;
                executeScriptButtonValue = true;
            } else {
                executeAtCursorButtonValue = false;
                executeScriptButtonValue = false;
            }
            setButtonsEnabled();
        }
    });

    boolean autoSuggestEnabled = settingsProvider.get().getProperties().is(SQL_EXPLORER_AUTO_COMPLETE);
    setAutoCompleteEnabled(autoSuggestEnabled);

    selectionChangeListener = new DummyChangeListener();
    return editor;
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:25,代码来源:QueryPanel.java


示例4: createExecuteSqlShortcutListener

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
protected ShortcutListener createExecuteSqlShortcutListener() {
    return new ShortcutListener("", KeyCode.ENTER, new int[] { ModifierKey.CTRL }) {

        private static final long serialVersionUID = 1L;

        @Override
        public void handleAction(Object sender, Object target) {
            if (target instanceof Table) {
                Table table = (Table) target;
                TabularResultLayout layout = (TabularResultLayout) table.getParent();
                reExecute(layout.getSql());
            } else if (target instanceof AceEditor) {
                if (executeAtCursorButtonValue) {
                    if (execute(false) && !settingsProvider.get().getProperties().is(SQL_EXPLORER_AUTO_COMMIT)) {
                        setButtonsEnabled();
                    }
                }
            }
        }
    };
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:22,代码来源:QueryPanel.java


示例5: createExecuteSqlScriptShortcutListener

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
protected ShortcutListener createExecuteSqlScriptShortcutListener(){
    return new ShortcutListener("", KeyCode.ENTER, new int[] {ModifierKey.CTRL, ModifierKey.SHIFT}){
        
        private static final long serialVersionUID = 1L;
        
        @Override
        public void handleAction(Object sender, Object target){
            if (target instanceof Table) {
                Table table = (Table) target;
                TabularResultLayout layout = (TabularResultLayout) table.getParent();
                reExecute(layout.getSql());
            }else if (target instanceof AceEditor){
                if(executeScriptButtonValue){
                    if(execute(true) && !settingsProvider.get().getProperties().is(SQL_EXPLORER_AUTO_COMMIT)){
                        setButtonsEnabled();
                    }
                }
            }
        }
    };
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:22,代码来源:QueryPanel.java


示例6: createAceEditor

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
public static AceEditor createAceEditor() {
    AceEditor editor = new AceEditor();
    editor.setSizeFull();
    ServletContext context = VaadinServlet.getCurrent().getServletContext();
    if (context.getRealPath("/VAADIN/ace") != null) {
        String acePath = context.getContextPath() + "/VAADIN/ace";
        editor.setThemePath(acePath);
        editor.setModePath(acePath);
        editor.setWorkerPath(acePath);
    } else {
        log.warn("Could not find a local version of the ace editor.  " + "You might want to consider installing the ace web artifacts at "
                + context.getRealPath(""));
    }
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);
    return editor;
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:18,代码来源:CommonUiUtils.java


示例7: MultiUserEditor

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
public MultiUserEditor(EditorUser user, MultiUserDoc mud) {
	super();
	this.user = user;
	this.mud = mud;
	editor = new AceEditor();
	
	editor.setSizeFull();
	
	VerticalLayout layout = new VerticalLayout();
	layout.setSizeFull();
	layout.addComponent(hBar);
	hBar.addComponent(titleLabel);
	layout.addComponent(editor);
	layout.setExpandRatio(editor, 1);
	setCompositionRoot(layout);
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:17,代码来源:MultiUserEditor.java


示例8: setDocNoFire

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
synchronized AceDoc setDocNoFire(final AceDoc doc) {
		if (this.doc.equals(doc)) {
			return null;
		}
		
		// XXX
//		try {
//			Thread.sleep(new Random().nextInt(1000));
//		} catch (InterruptedException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
		
		this.doc = doc;
		for (final AceEditor editor : editors) {
			editor.getUI().access(new Runnable() {
				@Override
				public void run() {
					editor.setDoc(doc);
				}
			});
		}
		return doc;
	}
 
开发者ID:ahn,项目名称:mideaas,代码行数:26,代码来源:SharedDoc.java


示例9: init

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	final AceEditor chartCodeField = new AceEditor() {{
		setCaption("Chart Code");
		setSizeFull();
		setMode(AceMode.javascript);
		setValue(INITIAL_HCJS);
	}};

	final HighChart chart = new HighChart() {{
		setSizeFull();
		setHcjs(chartCodeField.getValue());

		addFunction("onClick", (JavaScriptFunction) args -> {
			Notification.show("Chart clicked: (" + args.getNumber(0) + ", " + args.getNumber(1) + ")", Notification.Type.TRAY_NOTIFICATION);

			manipulateChart(
					"chart.addSeries({\n" +
					"    name: 'pos',\n" +
					"    data: [{x: " + args.getNumber(0) + ", y: " + args.getNumber(1) + "}]\n" +
					"});"
			);
		});
	}};

	chartCodeField.addValueChangeListener(e -> chart.setHcjs(e.getValue()));

	HorizontalLayout horizontalLayout = new HorizontalLayout() {{
		setSizeFull();
		setMargin(true);
		setSpacing(true);
		addComponent(chartCodeField);
		setExpandRatio(chartCodeField, 1);
		addComponent(chart);
		setExpandRatio(chart, 1);
	}};

	setContent(horizontalLayout);
}
 
开发者ID:xylo,项目名称:highcharts-vaadin7,代码行数:40,代码来源:HighChartDemoUI.java


示例10: attachEditor

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
public synchronized void attachEditor(final AceEditor editor) {
	boolean wasReadonly = editor.isReadOnly();
	editor.setReadOnly(false);
	editor.setDoc(getDoc());
	editor.setReadOnly(wasReadonly);
	
	editors.add(editor);
	editor.addDiffListener(this);
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:10,代码来源:SharedDoc.java


示例11: 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


示例12: 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


示例13: 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


示例14: init

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	final AceEditor chartCodeField = new AceEditor() {{
		setCaption("Chart Code");
		setSizeFull();
		setMode(AceMode.javascript);
		setValue(INITIAL_HCJS);
	}};

	final StockChart chart = new StockChart() {{
		setSizeFull();
		setHcjs(chartCodeField.getValue());

		/*
		addFunction("onClick", new JavaScriptFunction() {
			@Override
			public void call(JsonArray args) {
				Notification.show("Chart clicked: (" + args.getNumber(0) + ", " + args.getNumber(1) + ")", Notification.Type.TRAY_NOTIFICATION);

				manipulateChart(
						"chart.addSeries({\n" +
						"    name: 'pos',\n" +
						"    data: [{x: " + args.getNumber(0) + ", y: " + args.getNumber(1) + "}]\n" +
						"});"
				);
			}
		});
		*/
	}};

	chartCodeField.addValueChangeListener(e -> chart.setHcjs(e.getValue()));

	HorizontalLayout horizontalLayout = new HorizontalLayout() {{
		setSizeFull();
		setMargin(true);
		setSpacing(true);
		addComponent(chartCodeField);
		setExpandRatio(chartCodeField, 1);
		addComponent(chart);
		setExpandRatio(chart, 1);
	}};

	setContent(horizontalLayout);
}
 
开发者ID:xylo,项目名称:highcharts-vaadin7,代码行数:45,代码来源:StockChartDemoUI.java


示例15: 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


示例16: detachEditor

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
public synchronized void detachEditor(AceEditor editor) {
	editors.remove(editor);
	editor.removeDiffListener(this);
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:5,代码来源:SharedDoc.java


示例17: selectionChanged

import org.vaadin.aceeditor.AceEditor; //导入依赖的package包/类
@Override
public void selectionChanged(AceEditor.SelectionChangeEvent e) {
	udpateXmlContext();
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:5,代码来源:ClaraEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Assertion类代码示例发布时间:2022-05-23
下一篇:
Java EntityAIAttackRangedBow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap