Java Code Examples for org.eclipse.jface.wizard.WizardDialog.setHelpAvailable()

The following are Jave code examples for showing how to use setHelpAvailable() of the org.eclipse.jface.wizard.WizardDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: tlaplus   File: TraceExplorerComposite.java   View Source Code Vote up 6 votes
/**
 * Opens a dialog for formula processing and returns the edited formula  
 * @param formula initial formula, can be <code>null</code>
 * @return result of editing or <code>null</code>, if editing canceled
 */
protected Formula doEditFormula(Formula formula)
{
    // Create the wizard
    FormulaWizard wizard = new FormulaWizard(section.getText(), section.getDescription());
    wizard.setFormula(formula);

    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;
    }
}
 
Example 2
Project: tlaplus   File: ValidateableConstantSectionPart.java   View Source Code Vote up 6 votes
protected Assignment doEditFormula(Assignment formula) // gets called when editing a constant and ...
{
    Assert.isNotNull(formula);

    // Create the wizard
    AssignmentWizard wizard = new AssignmentWizard(getSection().getText(), getSection().getDescription(),
            (Assignment) formula, AssignmentWizard.SHOW_OPTION, AssignmentWizardPage.CONSTANT_WIZARD_ID);
    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    wizard.setWizardDialog(dialog);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;  // We get here if the user cancels.
    }
}
 
Example 3
Project: tlaplus   File: ValidateableTableSectionPart.java   View Source Code Vote up 6 votes
/**
 * Opens a dialog for formula processing and returns the edited formula  
 * @param formula initial formula, can be <code>null</code>
 * @return result of editing or <code>null</code>, if editing canceled
 */
protected Formula doEditFormula(Formula formula)
{
    // Create the wizard
    FormulaWizard wizard = new FormulaWizard(getSection().getText(), getSection().getDescription());
    wizard.setFormula(formula);

    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;
    }
}
 
Example 4
Project: PDFReporter-Studio   File: FindResourceJob.java   View Source Code Vote up 6 votes
public static void doFindResource(ServerProvider sp, TreeViewer treeViewer) {
	TreeSelection ts = (TreeSelection) treeViewer.getSelection();
	Object el = ts.getFirstElement();
	MServerProfile msp = null;
	if (el instanceof MServerProfile)
		msp = (MServerProfile) el;
	else if (el instanceof MResource) {
		INode n = ((MResource) el).getRoot();
		if (n != null && n instanceof MServerProfile)
			msp = (MServerProfile) n;
	}
	if (msp != null) {
		FindResourceWizard wizard = new FindResourceWizard(msp);
		WizardDialog dialog = new FindWizardDialog(UIUtils.getShell(), wizard);
		dialog.setHelpAvailable(false);
		dialog.create();
		if (dialog.open() == Dialog.OK) {
			ResourceDescriptor rd = wizard.getValue();
			if (rd != null)
				selectResource(sp, msp, rd, treeViewer);
		}
	}
}
 
Example 5
Project: tlaplus   File: NewSpecHandler.java   View Source Code Vote up 5 votes
/**
 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 */
public Object execute(ExecutionEvent event) throws ExecutionException
{
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

    // Create the wizard
    NewSpecWizard wizard = new NewSpecWizard(event.getParameter(PARAM_PATH));
    // we pass null for structured selection, cause we just not using it
    wizard.init(window.getWorkbench(), null);
    Shell parentShell = window.getShell();
    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(parentShell, wizard);
    dialog.setHelpAvailable(true);
    
    // Open the wizard dialog
    if (Window.OK == dialog.open() && wizard.getRootFilename() != null)
    {
    	// read UI values from the wizard page
    	final boolean importExisting = wizard.isImportExisting();
    	final String specName = wizard.getSpecName();
    	final String rootFilename = wizard.getRootFilename();
        
        // the moment the user clicks finish on the wizard page does
        // not correspond with the availability of the spec object
        // it first has to be created/parsed fully before it can be shown in
        // the editor. Thus, delay opening the editor until parsing is done.        	
        createModuleAndSpecInNonUIThread(rootFilename, importExisting, specName);
    }

    return null;
}
 
Example 6
Project: PDFReporter-Studio   File: FindResourceJob.java   View Source Code Vote up 5 votes
public static ResourceDescriptor doFindResource(MServerProfile msp, String[] in, String[] excl) {
	FindResourceWizard wizard = new FindResourceWizard(msp);
	wizard.setFilterTypes(in, excl);
	WizardDialog dialog = new FindWizardDialog(UIUtils.getShell(), wizard);
	dialog.setHelpAvailable(false);
	dialog.create();
	if (dialog.open() == Dialog.OK)
		return wizard.getValue();
	return null;
}