use of net.heartsome.cat.ts.ui.wizards.NewProjectWizard in project translationstudio8 by heartsome.
the class NewProjectHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
NewProjectWizard wizard = new NewProjectWizard();
TSWizardDialog dialog = new NewProjectWizardDialog(window.getShell(), wizard) {
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.FINISH_ID).setText(Messages.getString("handlers.NewProjectHandler.finishLbl"));
}
// robert help 2012-09-06
@Override
protected Control createHelpControl(Composite parent) {
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) {
String language = CommonFunction.getSystemLanguage();
String helpUrl = "";
if (getCurrentPage() instanceof NewProjectWizardProjInfoPage) {
// ROBERTHELP 新建项目-项目信息
helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s02.html#create-project-wizard-project-info", language);
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
} else if (getCurrentPage() instanceof NewProjectWizardLanguagePage) {
// ROBERTHELP 新建项目-语言信息
helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s02.html#create-project-wizard-languages", language);
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
} else if (getCurrentPage() instanceof AbstractNewProjectWizardPage) {
if ("TM".equals(((AbstractNewProjectWizardPage) getCurrentPage()).getPageType())) {
// ROBERTHELP 新建项目-记忆库
helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s02.html#create-project-wizard-tm", language);
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
} else {
// ROBERTHELP 新建项目-术语库
helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s02.html#create-project-wizard-tb", language);
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
}
} else if (getCurrentPage() instanceof NewProjectWizardSourceFilePage) {
// ROBERTHELP 新建项目-源文件
helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s02.html#create-project-wizard-source-file", language);
PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
}
}
});
return toolBar;
}
};
dialog.setHelpAvailable(true);
dialog.open();
return null;
}
Aggregations