Search in sources :

Example 1 with EditorAreaDropAdapter

use of net.heartsome.cat.ts.drop.EditorAreaDropAdapter in project translationstudio8 by heartsome.

the class ApplicationWorkbenchWindowAdvisor method preWindowOpen.

/**
	 * (non-Javadoc)
	 * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()
	 */
public void preWindowOpen() {
    IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
    // show the shortcut bar and progress indicator, which are hidden by default
    configurer.setShowCoolBar(true);
    // 检查是否显示装态栏 robert 2011-11-04 true为显示,false为隐藏,默认显示.
    IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
    boolean visibleStatus = prefs.getBoolean(TsPreferencesConstant.TS_statusBar_status);
    configurer.setShowStatusLine(visibleStatus);
    configurer.setShowProgressIndicator(true);
    // 添加“编辑区域”的传递者(org.eclipse.swt.dnd.Transfer)
    configurer.addEditorAreaTransfer(LocalSelectionTransfer.getTransfer());
    configurer.addEditorAreaTransfer(FileTransfer.getInstance());
    // 添加“编辑区域”的释放拖拽监听
    configurer.configureEditorAreaDropListener(new EditorAreaDropAdapter(configurer.getWindow()));
// 注释整理
// TODO 根据注册的转换器插件,动态添加 XLIFF Editor 映射的文件后缀名。
// abw,html,htm,inx,properties,js,mif,doc,xls,ppt,docx,xlsx,pptx,ppsx,sxw,sxc,sxi,sxd,odt,ods,odp,odg,txt,ttx,po,pot,rc,resx,rtf,svg,xml
// String[] extensions = FileFormatUtils.getExtensions();
// for (String extension : extensions) {
// PlatformUI
// .getWorkbench()
// .getEditorRegistry()
// .setDefaultEditor(extension,
// "net.heartsome.cat.ts.ui.xliffeditor.nattable.editor");
// }
// begin屏蔽掉向导中的General部分
// AbstractExtensionWizardRegistry wizardRegistry = (AbstractExtensionWizardRegistry) WorkbenchPlugin
// .getDefault().getNewWizardRegistry();
// IWizardCategory[] categories = WorkbenchPlugin.getDefault()
// .getNewWizardRegistry().getRootCategory().getCategories();
// for (IWizardDescriptor wizard : getAllWizards(categories)) {
// WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard;
// if (!allowedWizard(wizardElement.getId())) {
// wizardRegistry.removeExtension(wizardElement
// .getConfigurationElement().getDeclaringExtension(),
// new Object[] { wizardElement });
// }
// }
// end
}
Also used : EditorAreaDropAdapter(net.heartsome.cat.ts.drop.EditorAreaDropAdapter) IWorkbenchWindowConfigurer(org.eclipse.ui.application.IWorkbenchWindowConfigurer) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Aggregations

EditorAreaDropAdapter (net.heartsome.cat.ts.drop.EditorAreaDropAdapter)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 IWorkbenchWindowConfigurer (org.eclipse.ui.application.IWorkbenchWindowConfigurer)1