當前位置: 首頁>>代碼示例>>Java>>正文


Java IResource.FILE屬性代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IResource.FILE屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResource.FILE屬性的具體用法?Java IResource.FILE怎麽用?Java IResource.FILE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.core.resources.IResource的用法示例。


在下文中一共展示了IResource.FILE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visit

@Override
public boolean visit(IResourceDelta delta) throws CoreException
{
	IResource resource = delta.getResource();
	if( resource.isDerived() )
	{
		return false;
	}
	if( resource.getType() == IResource.FILE )
	{
		IFile file = (IFile) resource;
		IProject project = resource.getProject();
		if( file.equals(JPFProject.getManifest(project)) )
		{
			manifestChanged = true;
			return false;
		}
	}
	return true;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:20,代碼來源:JPFManifestBuilder.java

示例2: browseFiles

/***
 * Open a resource chooser to select a file
 **/
protected void browseFiles() {
	IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
	ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(getShell(), root, IResource.FILE);
	dialog.setTitle("Search File");
	if (dialog.open() == Window.OK) {
		Object[] files = dialog.getResult();
		IFile file = (IFile) files[0];
		fileText.setText(file.getFullPath().toString());
	}

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:14,代碼來源:LaunchConfigurationMainTab.java

示例3: createContents

public Control createContents(Composite parent) {

		noDefaultAndApplyButton();
		Composite panel = createComposite(parent, 2);

		// PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),PROPERTY_PAGE_CONTEXT);

		IResource resource = (IResource) getElement();

		if (resource.getType() == IResource.FILE) {
			Label label = createLabel(panel, MessageUtil.getString("File_name")); //$NON-NLS-1$
			label = createLabel(panel, resource.getName());
			label.setData(GW4E_LABEL_ID,GW4E_LABEL_ID);
			fillExcessHorizontalSpace(label);

			//
			createLabel(panel, MessageUtil.getString("Path")); //$NON-NLS-1$
			label = createLabel(panel, resource.getFullPath().setDevice(null).toString());
			fillExcessHorizontalSpace(label);

			createLabel(panel, MessageUtil.getString("modified")); //$NON-NLS-1$
			IFile file = (IFile) resource;
			label = createLabel(panel, formatDate(new Date(file.getLocalTimeStamp())));
			fillExcessHorizontalSpace(label);

			createrequirementSection(panel, file);
			createMethodSection(panel, file);
		}
		return new Canvas(panel, 0);
	}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:30,代碼來源:GraphModelPropertyPage.java

示例4: tryCreateName

public void tryCreateName ()
{
    // Try and get the resource selection to determine a current directory for the file dialog.
    //
    if ( this.selection != null && !this.selection.isEmpty () )
    {
        // Get the resource...
        //
        final Object selectedElement = this.selection.iterator ().next ();
        if ( selectedElement instanceof IResource )
        {
            // Get the resource parent, if its a file.
            //
            IResource selectedResource = (IResource)selectedElement;
            if ( selectedResource.getType () == IResource.FILE )
            {
                selectedResource = selectedResource.getParent ();
            }

            // This gives us a directory...
            //
            if ( selectedResource instanceof IFolder || selectedResource instanceof IProject )
            {
                // Set this for the container.
                //
                this.newFileCreationPage.setContainerFullPath ( selectedResource.getFullPath () );

                // Make up a unique new name here.
                //
                String modelFilename = this.base + "." + this.extension; //$NON-NLS-1$
                for ( int i = 1; ( (IContainer)selectedResource ).findMember ( modelFilename ) != null; ++i )
                {
                    modelFilename = this.base + i + "." + this.extension; //$NON-NLS-1$
                }
                this.newFileCreationPage.setFileName ( modelFilename );
            }
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:39,代碼來源:AbstractNewFileWizard.java

示例5: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
	@Override
public void addPages() {
	// Create a page, set the title, and the initial model file name.
	//
	newFileCreationPage = new LibraryModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(LibraryEditorPlugin.INSTANCE.getString("_UI_LibraryModelWizard_label"));
	newFileCreationPage.setDescription(LibraryEditorPlugin.INSTANCE.getString("_UI_LibraryModelWizard_description"));
	newFileCreationPage.setFileName(LibraryEditorPlugin.INSTANCE.getString("_UI_LibraryEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
	addPage(newFileCreationPage);

	// Try and get the resource selection to determine a current directory for the file dialog.
	//
	if (selection != null && !selection.isEmpty()) {
		// Get the resource...
		//
		Object selectedElement = selection.iterator().next();
		if (selectedElement instanceof IResource) {
			// Get the resource parent, if its a file.
			//
			IResource selectedResource = (IResource)selectedElement;
			if (selectedResource.getType() == IResource.FILE) {
				selectedResource = selectedResource.getParent();
			}

			// This gives us a directory...
			//
			if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
				// Set this for the container.
				//
				newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

				// Make up a unique new name here.
				//
				String defaultModelBaseFilename = LibraryEditorPlugin.INSTANCE.getString("_UI_LibraryEditorFilenameDefaultBase");
				String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
				String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
				for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
					modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
				}
				newFileCreationPage.setFileName(modelFilename);
			}
		}
	}
	initialObjectCreationPage = new LibraryModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(LibraryEditorPlugin.INSTANCE.getString("_UI_LibraryModelWizard_label"));
	initialObjectCreationPage.setDescription(LibraryEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:54,代碼來源:LibraryModelWizard.java

示例6: n4mfFileHasBeenChanged

private boolean n4mfFileHasBeenChanged(IResourceDelta delta) {
	return delta.getKind() == IResourceDelta.CHANGED
			&& delta.getResource().getType() == IResource.FILE
			&& IN4JSProject.N4MF_MANIFEST.equalsIgnoreCase(delta.getFullPath().lastSegment());
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:5,代碼來源:N4JSAllContainersState.java

示例7: getAcceptedResourceTypes

@Override
protected int getAcceptedResourceTypes() {
	return IResource.PROJECT | IResource.FOLDER | IResource.FILE;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:TesterLaunchConfigurationMainTab.java

示例8: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void addPages ()
{
    // Create a page, set the title, and the initial model file name.
    //
    newFileCreationPage = new ComponentModelWizardNewFileCreationPage ( "Whatever", selection ); //$NON-NLS-1$
    newFileCreationPage.setTitle ( ComponentEditorPlugin.INSTANCE.getString ( "_UI_ComponentModelWizard_label" ) ); //$NON-NLS-1$
    newFileCreationPage.setDescription ( ComponentEditorPlugin.INSTANCE.getString ( "_UI_ComponentModelWizard_description" ) ); //$NON-NLS-1$
    newFileCreationPage.setFileName ( ComponentEditorPlugin.INSTANCE.getString ( "_UI_ComponentEditorFilenameDefaultBase" ) + "." + FILE_EXTENSIONS.get ( 0 ) ); //$NON-NLS-1$ //$NON-NLS-2$
    addPage ( newFileCreationPage );

    // Try and get the resource selection to determine a current directory for the file dialog.
    //
    if ( selection != null && !selection.isEmpty () )
    {
        // Get the resource...
        //
        Object selectedElement = selection.iterator ().next ();
        if ( selectedElement instanceof IResource )
        {
            // Get the resource parent, if its a file.
            //
            IResource selectedResource = (IResource)selectedElement;
            if ( selectedResource.getType () == IResource.FILE )
            {
                selectedResource = selectedResource.getParent ();
            }

            // This gives us a directory...
            //
            if ( selectedResource instanceof IFolder || selectedResource instanceof IProject )
            {
                // Set this for the container.
                //
                newFileCreationPage.setContainerFullPath ( selectedResource.getFullPath () );

                // Make up a unique new name here.
                //
                String defaultModelBaseFilename = ComponentEditorPlugin.INSTANCE.getString ( "_UI_ComponentEditorFilenameDefaultBase" ); //$NON-NLS-1$
                String defaultModelFilenameExtension = FILE_EXTENSIONS.get ( 0 );
                String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                for ( int i = 1; ( (IContainer)selectedResource ).findMember ( modelFilename ) != null; ++i )
                {
                    modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                }
                newFileCreationPage.setFileName ( modelFilename );
            }
        }
    }
    initialObjectCreationPage = new ComponentModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    initialObjectCreationPage.setTitle ( ComponentEditorPlugin.INSTANCE.getString ( "_UI_ComponentModelWizard_label" ) ); //$NON-NLS-1$
    initialObjectCreationPage.setDescription ( ComponentEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( initialObjectCreationPage );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:60,代碼來源:ComponentModelWizard.java

示例9: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
public void addPages ()
{
    // Create a page, set the title, and the initial model file name.
    //
    this.newFileCreationPage = new RecipeModelWizardNewFileCreationPage ( "Whatever", this.selection ); //$NON-NLS-1$
    this.newFileCreationPage.setTitle ( RecipeEditorPlugin.INSTANCE.getString ( "_UI_RecipeModelWizard_label" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setDescription ( RecipeEditorPlugin.INSTANCE.getString ( "_UI_RecipeModelWizard_description" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setFileName ( RecipeEditorPlugin.INSTANCE.getString ( "_UI_RecipeEditorFilenameDefaultBase" ) + "." + FILE_EXTENSIONS.get ( 0 ) ); //$NON-NLS-1$ //$NON-NLS-2$
    addPage ( this.newFileCreationPage );

    // Try and get the resource selection to determine a current directory for the file dialog.
    //
    if ( this.selection != null && !this.selection.isEmpty () )
    {
        // Get the resource...
        //
        final Object selectedElement = this.selection.iterator ().next ();
        if ( selectedElement instanceof IResource )
        {
            // Get the resource parent, if its a file.
            //
            IResource selectedResource = (IResource)selectedElement;
            if ( selectedResource.getType () == IResource.FILE )
            {
                selectedResource = selectedResource.getParent ();
            }

            // This gives us a directory...
            //
            if ( selectedResource instanceof IFolder || selectedResource instanceof IProject )
            {
                // Set this for the container.
                //
                this.newFileCreationPage.setContainerFullPath ( selectedResource.getFullPath () );

                // Make up a unique new name here.
                //
                final String defaultModelBaseFilename = RecipeEditorPlugin.INSTANCE.getString ( "_UI_RecipeEditorFilenameDefaultBase" ); //$NON-NLS-1$
                final String defaultModelFilenameExtension = FILE_EXTENSIONS.get ( 0 );
                String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                for ( int i = 1; ( (IContainer)selectedResource ).findMember ( modelFilename ) != null; ++i )
                {
                    modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                }
                this.newFileCreationPage.setFileName ( modelFilename );
            }
        }
    }
    this.initialObjectCreationPage = new RecipeModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    this.initialObjectCreationPage.setTitle ( RecipeEditorPlugin.INSTANCE.getString ( "_UI_RecipeModelWizard_label" ) ); //$NON-NLS-1$
    this.initialObjectCreationPage.setDescription ( RecipeEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( this.initialObjectCreationPage );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:61,代碼來源:RecipeModelWizard.java

示例10: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
	@Override
public void addPages() {
	// Create a page, set the title, and the initial model file name.
	//
	newFileCreationPage = new GrmModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(GrmEditorPlugin.INSTANCE.getString("_UI_GrmModelWizard_label"));
	newFileCreationPage.setDescription(GrmEditorPlugin.INSTANCE.getString("_UI_GrmModelWizard_description"));
	newFileCreationPage.setFileName(GrmEditorPlugin.INSTANCE.getString("_UI_GrmEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
	addPage(newFileCreationPage);

	// Try and get the resource selection to determine a current directory for the file dialog.
	//
	if (selection != null && !selection.isEmpty()) {
		// Get the resource...
		//
		Object selectedElement = selection.iterator().next();
		if (selectedElement instanceof IResource) {
			// Get the resource parent, if its a file.
			//
			IResource selectedResource = (IResource)selectedElement;
			if (selectedResource.getType() == IResource.FILE) {
				selectedResource = selectedResource.getParent();
			}

			// This gives us a directory...
			//
			if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
				// Set this for the container.
				//
				newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

				// Make up a unique new name here.
				//
				String defaultModelBaseFilename = GrmEditorPlugin.INSTANCE.getString("_UI_GrmEditorFilenameDefaultBase");
				String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
				String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
				for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
					modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
				}
				newFileCreationPage.setFileName(modelFilename);
			}
		}
	}
	initialObjectCreationPage = new GrmModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(GrmEditorPlugin.INSTANCE.getString("_UI_GrmModelWizard_label"));
	initialObjectCreationPage.setDescription(GrmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:54,代碼來源:GrmModelWizard.java

示例11: SelectAnyIFileDialog

public SelectAnyIFileDialog(Shell parentShell, IContainer container){
	super(parentShell, container, IResource.FILE);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:3,代碼來源:SelectAnyIFileDialog.java

示例12: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
	@Override
public void addPages() {
	// Create a page, set the title, and the initial model file name.
	//
	newFileCreationPage = new ConstraintsModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(ConstraintsEditorPlugin.INSTANCE.getString("_UI_ConstraintsModelWizard_label"));
	newFileCreationPage.setDescription(ConstraintsEditorPlugin.INSTANCE.getString("_UI_ConstraintsModelWizard_description"));
	newFileCreationPage.setFileName(ConstraintsEditorPlugin.INSTANCE.getString("_UI_ConstraintsEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
	addPage(newFileCreationPage);

	// Try and get the resource selection to determine a current directory for the file dialog.
	//
	if (selection != null && !selection.isEmpty()) {
		// Get the resource...
		//
		Object selectedElement = selection.iterator().next();
		if (selectedElement instanceof IResource) {
			// Get the resource parent, if its a file.
			//
			IResource selectedResource = (IResource)selectedElement;
			if (selectedResource.getType() == IResource.FILE) {
				selectedResource = selectedResource.getParent();
			}

			// This gives us a directory...
			//
			if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
				// Set this for the container.
				//
				newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

				// Make up a unique new name here.
				//
				String defaultModelBaseFilename = ConstraintsEditorPlugin.INSTANCE.getString("_UI_ConstraintsEditorFilenameDefaultBase");
				String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
				String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
				for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
					modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
				}
				newFileCreationPage.setFileName(modelFilename);
			}
		}
	}
	initialObjectCreationPage = new ConstraintsModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(ConstraintsEditorPlugin.INSTANCE.getString("_UI_ConstraintsModelWizard_label"));
	initialObjectCreationPage.setDescription(ConstraintsEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:54,代碼來源:ConstraintsModelWizard.java

示例13: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
	@Override
public void addPages() {
	// Create a page, set the title, and the initial model file name.
	//
	newFileCreationPage = new CrtpModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(CrtpEditorPlugin.INSTANCE.getString("_UI_CrtpModelWizard_label"));
	newFileCreationPage.setDescription(CrtpEditorPlugin.INSTANCE.getString("_UI_CrtpModelWizard_description"));
	newFileCreationPage.setFileName(CrtpEditorPlugin.INSTANCE.getString("_UI_CrtpEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
	addPage(newFileCreationPage);

	// Try and get the resource selection to determine a current directory for the file dialog.
	//
	if (selection != null && !selection.isEmpty()) {
		// Get the resource...
		//
		Object selectedElement = selection.iterator().next();
		if (selectedElement instanceof IResource) {
			// Get the resource parent, if its a file.
			//
			IResource selectedResource = (IResource)selectedElement;
			if (selectedResource.getType() == IResource.FILE) {
				selectedResource = selectedResource.getParent();
			}

			// This gives us a directory...
			//
			if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
				// Set this for the container.
				//
				newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

				// Make up a unique new name here.
				//
				String defaultModelBaseFilename = CrtpEditorPlugin.INSTANCE.getString("_UI_CrtpEditorFilenameDefaultBase");
				String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
				String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
				for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
					modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
				}
				newFileCreationPage.setFileName(modelFilename);
			}
		}
	}
	initialObjectCreationPage = new CrtpModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(CrtpEditorPlugin.INSTANCE.getString("_UI_CrtpModelWizard_label"));
	initialObjectCreationPage.setDescription(CrtpEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:54,代碼來源:CrtpModelWizard.java

示例14: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
	@Override
public void addPages() {
	// Create a page, set the title, and the initial model file name.
	//
	newFileCreationPage = new SlaModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(SlaEditorPlugin.INSTANCE.getString("_UI_SlaModelWizard_label"));
	newFileCreationPage.setDescription(SlaEditorPlugin.INSTANCE.getString("_UI_SlaModelWizard_description"));
	newFileCreationPage.setFileName(SlaEditorPlugin.INSTANCE.getString("_UI_SlaEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
	addPage(newFileCreationPage);

	// Try and get the resource selection to determine a current directory for the file dialog.
	//
	if (selection != null && !selection.isEmpty()) {
		// Get the resource...
		//
		Object selectedElement = selection.iterator().next();
		if (selectedElement instanceof IResource) {
			// Get the resource parent, if its a file.
			//
			IResource selectedResource = (IResource)selectedElement;
			if (selectedResource.getType() == IResource.FILE) {
				selectedResource = selectedResource.getParent();
			}

			// This gives us a directory...
			//
			if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
				// Set this for the container.
				//
				newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

				// Make up a unique new name here.
				//
				String defaultModelBaseFilename = SlaEditorPlugin.INSTANCE.getString("_UI_SlaEditorFilenameDefaultBase");
				String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
				String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
				for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
					modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
				}
				newFileCreationPage.setFileName(modelFilename);
			}
		}
	}
	initialObjectCreationPage = new SlaModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(SlaEditorPlugin.INSTANCE.getString("_UI_SlaModelWizard_label"));
	initialObjectCreationPage.setDescription(SlaEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:54,代碼來源:SlaModelWizard.java

示例15: addPages

/**
 * The framework calls this to create the contents of the wizard.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void addPages ()
{
    // Create a page, set the title, and the initial model file name.
    //
    newFileCreationPage = new ProtocolModelWizardNewFileCreationPage ( "Whatever", selection ); //$NON-NLS-1$
    newFileCreationPage.setTitle ( NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_ProtocolModelWizard_label" ) ); //$NON-NLS-1$
    newFileCreationPage.setDescription ( NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_ProtocolModelWizard_description" ) ); //$NON-NLS-1$
    newFileCreationPage.setFileName ( NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_ProtocolEditorFilenameDefaultBase" ) + "." + FILE_EXTENSIONS.get ( 0 ) ); //$NON-NLS-1$ //$NON-NLS-2$
    addPage ( newFileCreationPage );

    // Try and get the resource selection to determine a current directory for the file dialog.
    //
    if ( selection != null && !selection.isEmpty () )
    {
        // Get the resource...
        //
        Object selectedElement = selection.iterator ().next ();
        if ( selectedElement instanceof IResource )
        {
            // Get the resource parent, if its a file.
            //
            IResource selectedResource = (IResource)selectedElement;
            if ( selectedResource.getType () == IResource.FILE )
            {
                selectedResource = selectedResource.getParent ();
            }

            // This gives us a directory...
            //
            if ( selectedResource instanceof IFolder || selectedResource instanceof IProject )
            {
                // Set this for the container.
                //
                newFileCreationPage.setContainerFullPath ( selectedResource.getFullPath () );

                // Make up a unique new name here.
                //
                String defaultModelBaseFilename = NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_ProtocolEditorFilenameDefaultBase" ); //$NON-NLS-1$
                String defaultModelFilenameExtension = FILE_EXTENSIONS.get ( 0 );
                String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                for ( int i = 1; ( (IContainer)selectedResource ).findMember ( modelFilename ) != null; ++i )
                {
                    modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; //$NON-NLS-1$
                }
                newFileCreationPage.setFileName ( modelFilename );
            }
        }
    }
    initialObjectCreationPage = new ProtocolModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    initialObjectCreationPage.setTitle ( NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_ProtocolModelWizard_label" ) ); //$NON-NLS-1$
    initialObjectCreationPage.setDescription ( NextGenerationProtocolEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( initialObjectCreationPage );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:60,代碼來源:ProtocolModelWizard.java


注:本文中的org.eclipse.core.resources.IResource.FILE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。