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

Java Editor类代码示例

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

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



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

示例1: end

import processing.app.Editor; //导入依赖的package包/类
@Override
public void end() {
	try {
		// Restore the original export handler
		Util.setPrivateField(Editor.class, editor, EXPORT_HANDLER_FIELD_NAME, originalExportHandler);
		
		Util.EditorStatus editorStatus = Util.readStatus(editor);
		if (editorStatus.status == editorStatus.ERR) {
			error = new HttpCommandException(editorStatus.message);
		} else {
			// Nothing to do here; the upload was a success; we notify this, by NOT setting any error field.
		}
	} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e1) {
		error = new ReflectionException("Reflection error.", e1);
	} catch (Throwable th) {
		error = th;
	}
	
	finished = true;
}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:21,代码来源:UploadToBoardCommand.java


示例2: init

import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
	if (ArduBlockTool.editor == null )
	{
		ArduBlockTool.editor = editor;
		ArduBlockTool.openblocksFrame = new ArduBlockToolFrame();
		ArduBlockTool.openblocksFrame.addListener(this);
		Context context = Context.getContext();
		String arduinoVersion = this.getArduinoVersion();
		context.setInArduino(true);
		context.setArduinoVersionString(arduinoVersion);
		context.setEditor(editor);
		System.out.println("Arduino Version: " + arduinoVersion);
		
		// Don't just "close" Ardublock, see if there's something to save first.
		// Note to self: Code here only affects behaviour when we're an Arduino Tool,
		// not when run directly - See Main.java for that.
		//ArduBlockTool.openblocksFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		ArduBlockTool.openblocksFrame.addWindowListener( new WindowAdapter()
		{
		    public void windowClosing(WindowEvent e)
		    {		        
		    	ArduBlockTool.openblocksFrame.doCloseArduBlockFile();		        
		    }
		});
	}
}
 
开发者ID:tairo,项目名称:STEMDu_Ardublock,代码行数:27,代码来源:ArduBlockTool.java


示例3: init

import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
	if (ArduBlockTool.editor == null )
	{
		ArduBlockTool.editor = editor;
		ArduBlockTool.openblocksFrame = new ArduBlockToolFrame();
		ArduBlockTool.openblocksFrame.addListener(this);
		Context context = Context.getContext();
		String arduinoVersion = this.getArduinoVersion();
		context.setInArduino(true);
		context.setArduinoVersionString(arduinoVersion);
		context.setEditor(editor);
		System.out.println("Arduino Version: " + arduinoVersion);
	}
}
 
开发者ID:dwengovzw,项目名称:Ardublock-for-Dwenguino,代码行数:15,代码来源:ArduBlockTool.java


示例4: readStatus

import processing.app.Editor; //导入依赖的package包/类
/**
 * Reads the status field from the given editor instance.
 * @param editor
 * @return
 */
public static EditorStatus readStatus(Editor editor) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
	processing.app.EditorStatus editorStatus = Util.getPrivateField(Editor.class, editor, "status");

	EditorStatus result = new EditorStatus();
	
	result.ERR = Util.<Integer>getPrivateField(processing.app.EditorStatus.class, processing.app.EditorStatus.class, "ERR");
	result.status = Util.getPrivateField(processing.app.EditorStatus.class, editorStatus, "mode");
	result.message = Util.getPrivateField(processing.app.EditorStatus.class, editorStatus, "message");

	return result;
}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:17,代码来源:Util.java


示例5: convertEditorStatusIntoCompilationResult

import processing.app.Editor; //导入依赖的package包/类
/**
 * Utility function; analyzes the internal field "status" of the Arduino IDE main Editor, and
 * calls the appropiate {@link CompilationListener#compilationSuccessful()} or
 * {@link CompilationListener#compilationFailed(HttpCommandException)()} method.
 */
private void convertEditorStatusIntoCompilationResult(Editor editor, CompilationListener compilationListener) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
	Util.EditorStatus editorStatus = Util.readStatus(editor);
	
	if (editorStatus.status == editorStatus.ERR) {
		compilationListener.compilationFailed(new HttpCommandException(editorStatus.message));
	} else {
		compilationListener.compilationSuccessful();
	}
}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:15,代码来源:UpdateSourceFilesAndCompileCommand.java


示例6: UploadHandler

import processing.app.Editor; //导入依赖的package包/类
public UploadHandler(Editor editor, Runnable originalExportHandler) {
	if (editor == null) {
		throw new NullPointerException("The editor instance cannot be null.");
	}
	this.editor = editor;
	this.originalExportHandler = originalExportHandler;
}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:8,代码来源:UploadToBoardCommand.java


示例7: run

import processing.app.Editor; //导入依赖的package包/类
public Object run() {
	Editor editor = FlowerPlatformPlugin.getInstance().getEditor();
	JMenuBar menuBar = editor.getJMenuBar();
	JMenu toolsMenu = menuBar.getMenu(3);
	toolsMenu.getListeners(MenuListener.class)[0].menuSelected(null);
	toolsMenu.getListeners(MenuListener.class)[1].menuSelected(null);

	// set menu options
	for (Component c : toolsMenu.getMenuComponents()) {
		if ((c instanceof JMenu) && c.isVisible()) {
			JMenu menu = (JMenu) c;
			String option = menu.getText();
			if (option == null) {
				continue;
			}
			int index = option.indexOf(':');
			if (index > 0) {
				option = option.substring(0, index);
			}
			String newValue = options.get(option);
			for (int i = 0; i < menu.getItemCount(); i++) {
				JMenuItem item = menu.getItem(i);
				if (item != null && item.isVisible() && item.getText().equals(newValue)) {
					item.setSelected(true);
				}
			}
		}
	}

	
	return null;
}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:33,代码来源:SetOptionsCommand.java


示例8: run

import processing.app.Editor; //导入依赖的package包/类
public Object run() {
		Editor editor = FlowerPlatformPlugin.getInstance().getEditor();
		JMenuBar menuBar = editor.getJMenuBar();
		JMenu toolsMenu = menuBar.getMenu(3);
		toolsMenu.getListeners(MenuListener.class)[0].menuSelected(null);

		JMenu boardsMenu = null;
		for (Component c : toolsMenu.getMenuComponents()) {
			if (!(c instanceof JMenu) || !c.isVisible()) {
				continue;
			}
			JMenu menu = (JMenu) c;
			if (menu.getText().startsWith("Board")) {
				boardsMenu = menu;
				break;
			}
		}
		List<String> boards = new ArrayList<>();
		// start from 1 (skip first entry - "Boards manager")
		for (int i = 1; i < boardsMenu.getItemCount(); i++) {
			JMenuItem item = boardsMenu.getItem(i);
			if (item != null && item.isEnabled()) {
//				System.out.println(item.getText());
				boards.add(item.getText());
			}
		}
		
		return boards;
	}
 
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:30,代码来源:GetBoardsCommand.java


示例9: init

import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
  this.editor = editor;
}
 
开发者ID:me-no-dev,项目名称:arduino-esp32fs-plugin,代码行数:4,代码来源:ESP32FS.java


示例10: setEditor

import processing.app.Editor; //导入依赖的package包/类
public void setEditor(Editor e) {
	editor = e;
}
 
开发者ID:heqichen,项目名称:ardublock,代码行数:4,代码来源:Context.java


示例11: getEditor

import processing.app.Editor; //导入依赖的package包/类
public Editor getEditor() {
	return editor;
}
 
开发者ID:heqichen,项目名称:ardublock,代码行数:4,代码来源:Context.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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