当前位置: 首页>>代码示例>>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;未经允许,请勿转载。