亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jadeditor.java

?? 配置文件
?? JAVA
字號:
/**
 * Copyright (c) 2003-2005 Craig Setera
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package eclipseme.ui.internal.editor.jad;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourceAttributes;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
import org.eclipse.ui.part.EditorPart;

import eclipseme.core.internal.EclipseMECorePlugin;
import eclipseme.ui.EclipseMEUIStrings;
import eclipseme.ui.internal.utils.ManifestPreferenceStore;

// TODO Error status area... Updated by field editors

/**
 * Editor for specifying the properties of a MIDP 
 * application descriptor.
 * <p />
 * Copyright (c) 2003-2005 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.12 $
 * <br>
 * $Date: 2006/11/12 01:10:49 $
 * <br>
 * @author Craig Setera
 * @see EditorPart
 */
public class JADEditor extends FormEditor 
{
	/**
	 * Get a string value from the resource bundle
	 * @param key
	 * @return
	 */
	private static String getResourceString(String key) {
		return EclipseMEUIStrings.getString(key);
	}

	// The preference store we are using to 
	// represent the edit state	
	private ManifestPreferenceStore preferenceStore;

	// The underlying file being operated on
	private IFile jadFile;
	
	// The most recent timestamp of the JAD file
	private long modificationStamp;

	// The pages in the editor
	private JADRequiredPropertiesEditorPage requiredPropertiesEditorPage;
	private JADMidletsEditorPage midletsEditorPage;
	private JADOptionalPropertiesEditorPage optionalPropertiesEditorPage;
	private JADOTAPropertiesEditorPage otaPropertiesEditorPage;
	private JADUserDefinedPropertiesEditorPage userDefinedPropertiesEditorPage;

	/**
	 * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
	 */
	protected void addPages() {
		try {
			String title = getResourceString("editor.jad.tab.required_properties");
			requiredPropertiesEditorPage = new JADRequiredPropertiesEditorPage(this);
			addPage(requiredPropertiesEditorPage);
			
			title = getResourceString("editor.jad.tab.midlets");
			midletsEditorPage = new JADMidletsEditorPage(this, title);
			addPage(midletsEditorPage);

			title = getResourceString("editor.jad.tab.optional_properties");
			optionalPropertiesEditorPage = new JADOptionalPropertiesEditorPage(this);
			addPage(optionalPropertiesEditorPage);

			title = getResourceString("editor.jad.tab.ota");
			otaPropertiesEditorPage = new JADOTAPropertiesEditorPage(this);
			addPage(otaPropertiesEditorPage);

			title = getResourceString("editor.jad.tab.user_defined_properties");
			userDefinedPropertiesEditorPage = new JADUserDefinedPropertiesEditorPage(this, title);
			addPage(userDefinedPropertiesEditorPage);
			
		} catch (PartInitException e) {
			EclipseMECorePlugin.log(IStatus.ERROR, e);
		}
	}

	/**
	 * @see org.eclipse.ui.ISaveablePart#isDirty()
	 */
	public boolean isDirty() {
		boolean dirty = false;
		
		Iterator pageIter = pages.iterator();
		while (pageIter.hasNext()) {
			IFormPage formPage = (IFormPage) pageIter.next();

			// If the control hasn't been created yet, it can't be dirty yet
			if ((formPage != null) && (formPage.getPartControl() != null)) {
				if (formPage.isDirty())  {
					dirty = true;
					break;
				}
			}
		}
		
		return dirty;
	}
	
	/**
	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
	 */
	public void doSave(IProgressMonitor monitor) {
		monitor.beginTask("", getPageCount() + 1);
		
		int i = 0;
		Iterator pageIter = pages.iterator();
		while (pageIter.hasNext()) {
			IFormPage formPage = (IFormPage) pageIter.next();

			// If the control hasn't been created yet, it can't be dirty yet
			if ((formPage != null) && (formPage.getPartControl() != null)) {
				if (formPage.isDirty())  {
					formPage.doSave(monitor);
				}
			}
			
			monitor.worked(i + 1);
		}

		try {
			// Attempt to make the file read/write as necessary, using
			// the resource API so that Team providers can get involved.
			if (jadFile.exists() && jadFile.isReadOnly()) {
				ResourceAttributes attributes = jadFile.getResourceAttributes();
				attributes.setReadOnly(false);
				jadFile.setResourceAttributes(attributes);
			}
			
			preferenceStore.save();
			
			if ((jadFile != null) && (jadFile.exists())) {
				jadFile.refreshLocal(IResource.DEPTH_ZERO, monitor);
			}
		} catch (IOException e) {
			EclipseMECorePlugin.log(IStatus.ERROR, e);
		} catch (CoreException e) {
			EclipseMECorePlugin.log(IStatus.ERROR, e);
		}
		
		monitor.done();
		editorDirtyStateChanged();
	}

	/**
	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
	 */
	public void doSaveAs() {
		// Not allowed...
	}

	/**
	 * Get the IPreferenceStore in use for the edit
	 * function.
	 * 
	 * @return
	 */
	public ManifestPreferenceStore getPreferenceStore() {
		return preferenceStore;
	}

	/**
	 * @see org.eclipse.ui.part.EditorPart#gotoMarker(org.eclipse.core.resources.IMarker)
	 */
	public void gotoMarker(IMarker marker) {
		// Nothing to do here...
	}

	/**
	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
	 */
	public boolean isSaveAsAllowed() {
		// Don't allow "Save As..."
		return false;
	}

	/**
	 * @see org.eclipse.ui.part.MultiPageEditorPart#setFocus()
	 */
	public void setFocus() {
		File localFile = getLocalFile();
		
		if ((localFile != null) && (localFile.lastModified() > modificationStamp)) {
			if (shouldReloadFile()) {
				updateEditorInput();
				
				requiredPropertiesEditorPage.editorInputChanged();
				optionalPropertiesEditorPage.editorInputChanged();
				otaPropertiesEditorPage.editorInputChanged();
				midletsEditorPage.editorInputChanged();
				userDefinedPropertiesEditorPage.editorInputChanged();
			}
		}

		super.setFocus();
	}

	/**
	 * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
	 */
	protected void setInput(IEditorInput input) {
		super.setInput(input);
		
		// Update the application descriptor instance
		if (input instanceof IStorageEditorInput) {
			IStorageEditorInput storageInput = (IStorageEditorInput) input;
			try {
				// Read the storage from the file system as 
				// a preference store
				IPath storagePath = storageInput.getStorage().getFullPath();
				if (storagePath != null) {
					IWorkspaceRoot root = EclipseMECorePlugin.getWorkspace().getRoot(); 
					jadFile = root.getFile(storagePath.makeAbsolute());
					
					if ((jadFile != null) && (jadFile.exists())) {
						updateEditorInput();
					}
				}
				
			} catch (Exception e) {
				EclipseMECorePlugin.log(IStatus.WARNING, e);
			}
		} 
	}

	/**
	 * Return a boolean indicating whether the specified property key is 
	 * an allowable user-defined property.
	 * 
	 * @param key
	 * @return
	 */
	boolean isUserDefinedPropertyKey(String key) {
		return
			!requiredPropertiesEditorPage.isManagingProperty(key) &&
			!optionalPropertiesEditorPage.isManagingProperty(key) &&
			!otaPropertiesEditorPage.isManagingProperty(key) &&
			!midletsEditorPage.isManagingProperty(key);
	}

	/**
	 * Return the jad file as a local File instance.
	 * 
	 * @return
	 */
	private File getLocalFile() {
		return jadFile.getLocation().toFile(); 
	}
	
	/**
	 * Return a boolean indicating whether the user wants
	 * to reload the updated file.
	 * 
	 * @return
	 */
	private boolean shouldReloadFile() {
		return MessageDialog.openQuestion(
				getSite().getShell(), 
				"File Updated", 
				"The file has been updated.  Would you like to reload?");
	}

	/**
	 * Update the editor input.
	 * 
	 * @throws IOException
	 */
	private void updateEditorInput() {
		File localFile = getLocalFile();
		modificationStamp = localFile.lastModified();
		String filename = localFile.toString();  
		preferenceStore = new ManifestPreferenceStore(filename);
		
		try {
			preferenceStore.load();
		} catch (IOException e) {
			EclipseMECorePlugin.log(IStatus.WARNING, e);
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品乱码av一区二区| 一区二区三区蜜桃| 欧美色图12p| 国产乱对白刺激视频不卡| 亚洲乱码国产乱码精品精可以看| 日韩视频一区二区三区| 一本色道亚洲精品aⅴ| 国内精品伊人久久久久av影院| 亚洲伦理在线免费看| 精品国产乱码久久久久久图片 | 久久久久久亚洲综合| 色综合久久久久久久久久久| 国产乱子轮精品视频| 日av在线不卡| 亚洲sss视频在线视频| 亚洲欧洲美洲综合色网| 久久久亚洲高清| 欧美一二三四在线| 欧美另类高清zo欧美| 91丨porny丨首页| 国产·精品毛片| 国内精品写真在线观看| 日韩国产精品久久| 亚洲成人免费看| 亚洲精品中文字幕在线观看| 亚洲欧洲精品天堂一级| 欧美国产一区二区| 久久精品人人爽人人爽| 日韩视频国产视频| 欧美精品久久99久久在免费线| 欧美在线一区二区| 在线亚洲一区二区| 色综合咪咪久久| 色婷婷亚洲综合| 色综合天天综合| 91蜜桃在线免费视频| 久久精品亚洲精品国产欧美kt∨| 日韩欧美一区二区三区在线| 欧美性大战久久久| 欧美私人免费视频| 欧美日精品一区视频| 在线观看日韩高清av| 91美女视频网站| 91老师国产黑色丝袜在线| 99riav一区二区三区| 色美美综合视频| 一本久久精品一区二区| 欧美午夜视频网站| 欧美一区二区三区视频免费| 日韩视频在线观看一区二区| 精品久久久久一区二区国产| 欧美v日韩v国产v| 久久久影院官网| 国产精品视频第一区| 成人免费在线观看入口| 亚洲综合清纯丝袜自拍| 亚洲成人免费电影| 久久激情五月婷婷| 国产精品中文有码| 成人精品国产一区二区4080| 91伊人久久大香线蕉| 欧美日本免费一区二区三区| 欧美日韩一区在线观看| 日韩限制级电影在线观看| 日韩视频免费直播| 国产日韩欧美激情| 一区二区三区高清不卡| 日韩精彩视频在线观看| 国产一区二三区| 色www精品视频在线观看| 欧美人牲a欧美精品| 久久伊99综合婷婷久久伊| 亚洲欧洲av在线| 日韩电影在线免费看| 久久不见久久见免费视频1| 成人精品一区二区三区四区| 在线日韩一区二区| 欧美电影免费提供在线观看| 国产欧美日韩精品a在线观看| 一区二区三区精品在线观看| 免费成人在线视频观看| av在线不卡网| 欧美一区二区三区不卡| 国产精品免费久久| 日本美女视频一区二区| 成人中文字幕在线| 欧美精品日韩综合在线| 欧美高清在线一区二区| 日本成人在线不卡视频| 91色乱码一区二区三区| 欧美成人a在线| 亚洲一二三四区| 国产精品一区在线观看你懂的| 日本韩国欧美一区| 久久婷婷成人综合色| 一区二区三区在线观看视频| 国产乱码精品一区二区三| 欧美另类一区二区三区| 亚洲色图制服丝袜| 国产一区二区女| 欧美欧美欧美欧美首页| 国产精品久久网站| 激情亚洲综合在线| 欧美高清激情brazzers| 最新不卡av在线| 国产98色在线|日韩| 日韩欧美aaaaaa| 午夜欧美在线一二页| 99久久精品国产网站| 久久久久久免费网| 黄页视频在线91| 欧美一区二区三区的| 午夜激情综合网| 欧美日韩在线播放一区| 中文字幕一区不卡| 国产成人精品一区二区三区网站观看 | 日韩午夜精品视频| 悠悠色在线精品| 91一区二区在线观看| 欧美激情综合网| 国产一区二区在线影院| 欧美一区二区免费观在线| 亚洲香肠在线观看| 欧美中文字幕一区| 亚洲一区免费视频| 在线视频国内自拍亚洲视频| 亚洲色图丝袜美腿| av在线播放不卡| 中文字幕 久热精品 视频在线| 国产毛片精品一区| 久久综合狠狠综合久久综合88 | 一区二区三区蜜桃| 日本久久电影网| 亚洲一二三四在线| 欧美视频一区二区三区在线观看| 亚洲三级视频在线观看| 9l国产精品久久久久麻豆| 欧美韩国一区二区| 成年人午夜久久久| 有码一区二区三区| 欧美四级电影在线观看| 日韩精品免费专区| 精品国产乱码久久久久久免费| 久久精品国产精品青草| 久久一区二区三区国产精品| 久久99精品国产麻豆婷婷洗澡| 亚洲精品在线免费播放| 国产精品一区一区三区| 欧美激情一二三区| 91久久精品网| 亚洲高清在线精品| 91麻豆精品国产自产在线 | 免费久久精品视频| 精品少妇一区二区三区在线播放| 国产伦理精品不卡| 亚洲婷婷在线视频| 精品视频免费在线| 久久精品理论片| 国产日韩欧美精品电影三级在线| 成人aaaa免费全部观看| 亚洲国产精品久久一线不卡| 91精品国产色综合久久不卡蜜臀 | 国产精品久久久久久久久免费丝袜 | 日韩高清不卡在线| 精品久久久久久久久久久久久久久| 久久se这里有精品| 国产精品国产三级国产aⅴ入口| 欧美中文字幕一区| 青草av.久久免费一区| 欧美成人免费网站| 粉嫩aⅴ一区二区三区四区| 亚洲欧美日韩国产手机在线| 欧美人妖巨大在线| 国产成人在线视频网站| 亚洲乱码国产乱码精品精小说| 67194成人在线观看| 国产专区欧美精品| 亚洲男女毛片无遮挡| 日韩三级电影网址| 91亚洲男人天堂| 免费欧美在线视频| 亚洲欧美一区二区三区久本道91| 欧美精品亚洲一区二区在线播放| 成人午夜在线视频| 日韩影院在线观看| 亚洲欧美日韩在线不卡| 日韩精品影音先锋| 欧美视频一区二| 国产91丝袜在线18| 性欧美大战久久久久久久久| 国产日本一区二区| 91精品久久久久久蜜臀| 成人自拍视频在线| 精品一区二区综合| 亚洲亚洲人成综合网络| 国产精品久99| 久久综合狠狠综合久久激情| 欧美性猛片xxxx免费看久爱| 成人激情av网| 国产在线精品一区在线观看麻豆|