use of net.heartsome.cat.ts.exportproject.wizards.ExportProjectWizard in project translationstudio8 by heartsome.
the class ExportProjectHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
ExportProjectWizard wizard = new ExportProjectWizard();
TSWizardDialog dialog = new TSWizardDialog(window.getShell(), wizard) {
/**
* 添加帮助按钮 robert 2012-09-06
*/
@Override
protected Control createHelpControl(Composite parent) {
// ROBERTHELP 导出项目
String language = CommonFunction.getSystemLanguage();
final String helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch07s02.html#export-project", language);
Image helpImage = JFaceResources.getImage(DLG_IMG_HELP);
ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
((GridLayout) parent.getLayout()).numColumns++;
toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
toolBar.setCursor(cursor);
toolBar.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
cursor.dispose();
}
});
ToolItem helpItem = new ToolItem(toolBar, SWT.NONE);
helpItem.setImage(helpImage);
//$NON-NLS-1$
helpItem.setToolTipText(JFaceResources.getString("helpToolTip"));
helpItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
}
});
return toolBar;
}
};
dialog.setHelpAvailable(true);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if (null != root) {
try {
root.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
LOGGER.error("", e);
}
}
dialog.open();
return null;
}
Aggregations