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

The following examples show how to use org.eclipse.jface.wizard.WizardDialog#setPageSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenWSDLAction.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected void doRun() {
    if (repositoryNode == null) {
        repositoryNode = getCurrentRepositoryNode();
    }
    if (isToolbar()) {
        if (repositoryNode != null && repositoryNode.getContentType() != currentNodeType) {
            repositoryNode = null;
        }
        if (repositoryNode == null) {
            repositoryNode = getRepositoryNodeForDefault(currentNodeType);
        }
    }

    if (isToolbar()) {
        init(repositoryNode);
    }
    WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), new OpenWSDLWizard(repositoryNode));

    wizardDialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
    wizardDialog.create();

    wizardDialog.open();
}
 
Example 2
Source File: PublishLibraryToResourceFolderAction.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void run( )
{

	if ( isEnable( ) == false )
	{
		return;
	}

	ModuleHandle module = SessionHandleAdapter.getInstance( )
			.getReportDesignHandle( );

	String filePath = module.getFileName( );
	String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );

	PublishLibraryWizard publishLibrary = new PublishLibraryWizard( (LibraryHandle) module,
			fileName,
			ReportPlugin.getDefault( ).getResourceFolder( ) );

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			publishLibrary );

	dialog.setPageSize( 500, 250 );
	dialog.open( );

}
 
Example 3
Source File: PublishToLibraryHandler.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public Object execute( ExecutionEvent event ) throws ExecutionException
	{

		super.execute( event );
		
//		String filePath = SessionHandleAdapter.getInstance( )
//				.getReportDesignHandle( )
//				.getFileName( );
//		String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );

		IEvaluationContext context = (IEvaluationContext) event.getApplicationContext( );
		String fileName = (String)UIUtil.getVariableFromContext( context, ICommandParameterNameContants.PUBLISH_LIBRARY_FILENAME);
		LibraryHandle libHandle = (LibraryHandle) UIUtil.getVariableFromContext( context, ICommandParameterNameContants.PUBLISH_LIBRARY_LIBRARY_HANDLE);
	
		PublishLibraryWizard publishLibrary = new PublishLibraryWizard( libHandle,
				fileName,
				ReportPlugin.getDefault( ).getResourceFolder( ) );

		WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
				publishLibrary );

		dialog.setPageSize( 500, 250 );
		dialog.open( );
		
		return Boolean.TRUE;
	}
 
Example 4
Source File: PublishLibraryToResourceFolderAction.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void run( )
{

	if ( isEnable( ) == false )
	{
		return;
	}

	ModuleHandle module = SessionHandleAdapter.getInstance( )
			.getReportDesignHandle( );

	String filePath = module.getFileName( );
	String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );

	PublishLibraryWizard publishLibrary = new PublishLibraryWizard( (LibraryHandle) module,
			fileName,
			ReportPlugin.getDefault( ).getResourceFolder( ) );

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			publishLibrary );

	dialog.setPageSize( 500, 250 );
	dialog.open( );

}
 
Example 5
Source File: AbstractPythonWizard.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Must be called in the UI thread.
 * @param sel will define what appears initially in the project/source folder/name.
 */
public static void startWizard(AbstractPythonWizard wizard, String title, IStructuredSelection sel) {
    IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();

    wizard.init(part.getSite().getWorkbenchWindow().getWorkbench(), sel);
    wizard.setWindowTitle(title);

    Shell shell = part.getSite().getShell();
    if (shell == null) {
        shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    }
    WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.setPageSize(350, 500);
    dialog.setHelpAvailable(false);
    dialog.create();
    dialog.open();
}
 
Example 6
Source File: ExporCameltJobScriptAction.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
protected void doRun() {
    JobCamelScriptsExportWizard processWizard = new JobCamelScriptsExportWizard();
    IWorkbench workbench = getWorkbench();
    processWizard.setWindowTitle(EXPORTJOBSCRIPTS);
    processWizard.init(workbench, (IStructuredSelection) this.getSelection());

    WizardDialog dialog = new WizardDialog(shell, processWizard);
    workbench.saveAllEditors(true);
    dialog.setPageSize(830, 450);
    dialog.open();
}
 
Example 7
Source File: OpenCamelExistVersionProcessAction.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;

    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();

    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setHelpAvailable(false);
    dialog.setPageSize(300, 250);
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog")); //$NON-NLS-1$
    if (dialog.open() == Dialog.OK) {
        refresh(node);
        // refresh the corresponding editor's name
        IEditorPart part = getCorrespondingEditor(node);
        if (part != null && part instanceof IUIRefresher) {
            ((IUIRefresher) part).refreshName();
        } else {
            processRoutineRenameOperation(originalName, node, path);
        }
    }
}
 
Example 8
Source File: ExportToLibraryAction.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void run( )
{

	ExportReportWizard exportReportWizard = new ExportReportWizard( );
	WizardDialog wDialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			exportReportWizard );
	wDialog.setPageSize( 500, 250 );
	wDialog.open( );
}
 
Example 9
Source File: PublishTemplateViewAction.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void run( )
{

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			new PublishTemplateWizard( (ReportDesignHandle) getSelection( ) ) );
	dialog.setPageSize( 500, 250 );
	dialog.open( );
}
 
Example 10
Source File: PublishToTemplateHandler.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Object execute( ExecutionEvent event ) throws ExecutionException
{
	boolean retBoolean = true;
	super.execute( event );

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			new PublishTemplateWizard( (ReportDesignHandle) SessionHandleAdapter.getInstance( )
					.getReportDesignHandle( ) ) );
	dialog.setPageSize( 500, 250 );
	dialog.open( );

	return Boolean.valueOf( retBoolean );
}
 
Example 11
Source File: ExportLibraryHandler.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Object execute( ExecutionEvent event ) throws ExecutionException
{
	boolean retBoolean = true;
	super.execute( event );
	selection = (DesignElementHandle) getElementHandles( ).get( 0 );
	ExportReportWizard exportReportWizard = new ExportReportWizard( );
	WizardDialog wDialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			exportReportWizard );
	wDialog.setPageSize( 500, 250 );
	wDialog.open( );

	return Boolean.valueOf( retBoolean );
}
 
Example 12
Source File: PublishTemplateViewAction.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void run( )
{

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			new PublishTemplateWizard( (ReportDesignHandle) getSelection( ) ) );
	dialog.setPageSize( 500, 250 );
	dialog.open( );
}
 
Example 13
Source File: SaveProcessDialog.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public static int open(ResultEditor<?> editor) {
	if (editor == null)
		return Window.CANCEL;
	SaveProcessDialog d = new SaveProcessDialog(editor);
	d.setWindowTitle(M.SaveAsLCIResult);
	WizardDialog dialog = new WizardDialog(UI.shell(), d);
	dialog.setPageSize(150, 250);
	return dialog.open();
}
 
Example 14
Source File: AddResourceAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void run( )
{
	File container;

	try
	{
		container = getSelectedContainer( );
	}
	catch ( IOException e )
	{
		ExceptionUtil.handle( e );
		return;
	}

	if ( container == null )
	{
		return;
	}

	final PublishResourceWizard publishLibrary = new PublishResourceWizard( container.getAbsolutePath( ) );
	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			publishLibrary ) {

		@Override
		protected void okPressed( )
		{
			publishLibrary.setCopyFileRunnable( createCopyFileRunnable( publishLibrary.getSourceFile( ),
					publishLibrary.getTargetFile( ) ) );

			super.okPressed( );
		}
	};

	dialog.setPageSize( 500, 250 );
	if ( dialog.open( ) == Window.OK )
	{
		fireResourceChanged( publishLibrary.getTargetFile( )
				.getAbsolutePath( ) );
	}
}
 
Example 15
Source File: PublishLibraryNavigatorAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void run( IAction action )
{
	IFile file = getSelectedFile( );
	if ( file == null )
	{
		return;
	}

	String url = file.getLocation( ).toOSString( );
	ModuleHandle handle = null;
	try
	{
		handle = SessionHandleAdapter.getInstance( )
				.getSessionHandle( )
				.openLibrary( url );

		if ( handle == null )
		{
			action.setEnabled( false );
			return;
		}

		String filePath = handle.getFileName( );
		String fileName = null;
		if ( filePath != null && filePath.length( ) != 0 )
		{
			fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );
		}

		PublishLibraryWizard publishLibrary = new PublishLibraryWizard( (LibraryHandle) handle,
				fileName,
				ReportPlugin.getDefault( ).getResourceFolder( ) );

		WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
				publishLibrary );

		dialog.setPageSize( 500, 250 );
		dialog.open( );
	}
	catch ( Exception e )
	{
		ExceptionUtil.handle( e );
		return;
	}
	finally
	{
		if ( handle != null )
		{
			handle.close( );
		}
	}

}
 
Example 16
Source File: PublishTemplateNavigatorAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
public void run( IAction action )
{
	IFile file = getSelectedFile( );
	if ( file != null )
	{
		String url = file.getLocation( ).toOSString( );
		try
		{
			ModuleHandle handle = SessionHandleAdapter.getInstance( )
					.getSessionHandle( )
					.openDesign( url );

			if ( handle == null )
			{
				action.setEnabled( false );
				return;
			}

			IEditorPart editor = org.eclipse.birt.report.designer.internal.ui.util.UIUtil.findOpenedEditor( url );

			if ( editor != null && editor.isDirty( ) )
			{
				MessageDialog md = new MessageDialog( UIUtil.getDefaultShell( ),
						Messages.getString( "PublishTemplateAction.SaveBeforeGenerating.dialog.title" ), //$NON-NLS-1$
						null,
						Messages.getFormattedString( "PublishTemplateAction.SaveBeforeGenerating.dialog.message", new Object[]{file.getName( )} ), //$NON-NLS-1$
						MessageDialog.CONFIRM,
						new String[]{
								Messages.getString( "PublishTemplateAction.SaveBeforeGenerating.dialog.button.yes" ), //$NON-NLS-1$
								Messages.getString( "PublishTemplateAction.SaveBeforeGenerating.dialog.button.no" ) //$NON-NLS-1$
						},
						0 );
				switch ( md.open( ) )
				{
					case 0 :
						editor.doSave( null );
						break;
					case 1 :
					default :
				}
			}

			WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
					new PublishTemplateWizard( (ReportDesignHandle) handle ) );
			dialog.setPageSize( 500, 250 );
			dialog.open( );

			handle.close( );
		}
		catch ( Exception e )
		{
			ExceptionUtil.handle( e );
			return;
		}
	}
	else
	{
		action.setEnabled( false );
	}
}