当前位置: 首页>>代码示例>>Java>>正文


Java IResource.getParent方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.IResource.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java IResource.getParent方法的具体用法?Java IResource.getParent怎么用?Java IResource.getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.IResource的用法示例。


在下文中一共展示了IResource.getParent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryCreateName

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
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,代码行数:40,代码来源:AbstractNewFileWizard.java

示例2: createRule

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * Returns the scheduling rule to use when creating the resource at the
 * given container path. The rule should be the creation rule for the
 * top-most non-existing parent.
 * 
 * @param resource
 *            The resource being created
 * @return The scheduling rule for creating the given resource
 * @since 3.1
 * @deprecated As of 3.3, scheduling rules are provided by the undoable
 *             operation that this page creates and executes.
 */
protected ISchedulingRule createRule(IResource resource) {
	IResource parent = resource.getParent();
	while (parent != null) {
		if (parent.exists()) {
			return resource.getWorkspace().getRuleFactory()
					.createRule(resource);
		}
		resource = parent;
		parent = parent.getParent();
	}
	return resource.getWorkspace().getRoot();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:25,代码来源:WizardNewFileCreationPage.java

示例3: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 SrmModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(SrmEditorPlugin.INSTANCE.getString("_UI_SrmModelWizard_label"));
	newFileCreationPage.setDescription(SrmEditorPlugin.INSTANCE.getString("_UI_SrmModelWizard_description"));
	newFileCreationPage.setFileName(SrmEditorPlugin.INSTANCE.getString("_UI_SrmEditorFilenameDefaultBase") + "." + 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 = SrmEditorPlugin.INSTANCE.getString("_UI_SrmEditorFilenameDefaultBase");
				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 SrmModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(SrmEditorPlugin.INSTANCE.getString("_UI_SrmModelWizard_label"));
	initialObjectCreationPage.setDescription(SrmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:55,代码来源:SrmModelWizard.java

示例4: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 MetamodelModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(MetamodelEditorPlugin.INSTANCE.getString("_UI_MetamodelModelWizard_label"));
	newFileCreationPage.setDescription(MetamodelEditorPlugin.INSTANCE.getString("_UI_MetamodelModelWizard_description"));
	newFileCreationPage.setFileName(MetamodelEditorPlugin.INSTANCE.getString("_UI_MetamodelEditorFilenameDefaultBase") + "." + 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 = MetamodelEditorPlugin.INSTANCE.getString("_UI_MetamodelEditorFilenameDefaultBase");
				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 MetamodelModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(MetamodelEditorPlugin.INSTANCE.getString("_UI_MetamodelModelWizard_label"));
	initialObjectCreationPage.setDescription(MetamodelEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:cetic,项目名称:SimQRI,代码行数:55,代码来源:MetamodelModelWizard.java

示例5: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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,代码行数:55,代码来源:LibraryModelWizard.java

示例6: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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,代码行数:61,代码来源:ProtocolModelWizard.java

示例7: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 OCCIModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(OCCIEditorPlugin.INSTANCE.getString("_UI_OCCIModelWizard_label"));
	newFileCreationPage.setDescription(OCCIEditorPlugin.INSTANCE.getString("_UI_OCCIModelWizard_description"));
	newFileCreationPage.setFileName(OCCIEditorPlugin.INSTANCE.getString("_UI_OCCIEditorFilenameDefaultBase") + "." + 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 = OCCIEditorPlugin.INSTANCE.getString("_UI_OCCIEditorFilenameDefaultBase");
				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 OCCIModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(OCCIEditorPlugin.INSTANCE.getString("_UI_OCCIModelWizard_label"));
	initialObjectCreationPage.setDescription(OCCIEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:55,代码来源:OCCIModelWizard.java

示例8: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 MonitoringModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(MonitoringEditorPlugin.INSTANCE.getString("_UI_MonitoringModelWizard_label"));
	newFileCreationPage.setDescription(MonitoringEditorPlugin.INSTANCE.getString("_UI_MonitoringModelWizard_description"));
	newFileCreationPage.setFileName(MonitoringEditorPlugin.INSTANCE.getString("_UI_MonitoringEditorFilenameDefaultBase") + "." + 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 = MonitoringEditorPlugin.INSTANCE.getString("_UI_MonitoringEditorFilenameDefaultBase");
				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 MonitoringModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(MonitoringEditorPlugin.INSTANCE.getString("_UI_MonitoringModelWizard_label"));
	initialObjectCreationPage.setDescription(MonitoringEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:55,代码来源:MonitoringModelWizard.java

示例9: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 Time4sysModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(Time4sysEditorPlugin.INSTANCE.getString("_UI_Time4sysModelWizard_label"));
	newFileCreationPage.setDescription(Time4sysEditorPlugin.INSTANCE.getString("_UI_Time4sysModelWizard_description"));
	newFileCreationPage.setFileName(Time4sysEditorPlugin.INSTANCE.getString("_UI_Time4sysEditorFilenameDefaultBase") + "." + 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 = Time4sysEditorPlugin.INSTANCE.getString("_UI_Time4sysEditorFilenameDefaultBase");
				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 Time4sysModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(Time4sysEditorPlugin.INSTANCE.getString("_UI_Time4sysModelWizard_label"));
	initialObjectCreationPage.setDescription(Time4sysEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:55,代码来源:Time4sysModelWizard.java

示例10: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 GexpressionsModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsModelWizard_label"));
	newFileCreationPage.setDescription(GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsModelWizard_description"));
	newFileCreationPage.setFileName(GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsEditorFilenameDefaultBase") + "." + 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 = GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsEditorFilenameDefaultBase");
				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 GexpressionsModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsModelWizard_label"));
	initialObjectCreationPage.setDescription(GexpressionsEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:55,代码来源:GexpressionsModelWizard.java

示例11: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 ProfileModelWizardNewFileCreationPage ( "Whatever", selection ); //$NON-NLS-1$
    newFileCreationPage.setTitle ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ProfileModelWizard_label" ) ); //$NON-NLS-1$
    newFileCreationPage.setDescription ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ProfileModelWizard_description" ) ); //$NON-NLS-1$
    newFileCreationPage.setFileName ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ProfileEditorFilenameDefaultBase" ) + "." + 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 = WorldEditorPlugin.INSTANCE.getString ( "_UI_ProfileEditorFilenameDefaultBase" ); //$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 ProfileModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    initialObjectCreationPage.setTitle ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ProfileModelWizard_label" ) ); //$NON-NLS-1$
    initialObjectCreationPage.setDescription ( WorldEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( initialObjectCreationPage );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:61,代码来源:ProfileModelWizard.java

示例12: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 ConfigurationModelWizardNewFileCreationPage ( "Whatever", this.selection ); //$NON-NLS-1$
    this.newFileCreationPage.setTitle ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ConfigurationModelWizard_label" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setDescription ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ConfigurationModelWizard_description" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setFileName ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ConfigurationEditorFilenameDefaultBase" ) + "." + 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...
        //
        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 defaultModelBaseFilename = WorldEditorPlugin.INSTANCE.getString ( "_UI_ConfigurationEditorFilenameDefaultBase" ); //$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$
                }
                this.newFileCreationPage.setFileName ( modelFilename );
            }
        }
    }
    this.initialObjectCreationPage = new ConfigurationModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    this.initialObjectCreationPage.setTitle ( WorldEditorPlugin.INSTANCE.getString ( "_UI_ConfigurationModelWizard_label" ) ); //$NON-NLS-1$
    this.initialObjectCreationPage.setDescription ( WorldEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( this.initialObjectCreationPage );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:62,代码来源:WorldModelWizard.java

示例13: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 MemoryModelWizardNewFileCreationPage ( "Whatever", this.selection ); //$NON-NLS-1$
    this.newFileCreationPage.setTitle ( MemoryEditorPlugin.INSTANCE.getString ( "_UI_MemoryModelWizard_label" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setDescription ( MemoryEditorPlugin.INSTANCE.getString ( "_UI_MemoryModelWizard_description" ) ); //$NON-NLS-1$
    this.newFileCreationPage.setFileName ( MemoryEditorPlugin.INSTANCE.getString ( "_UI_MemoryEditorFilenameDefaultBase" ) + "." + 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 = MemoryEditorPlugin.INSTANCE.getString ( "_UI_MemoryEditorFilenameDefaultBase" ); //$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 MemoryModelWizardInitialObjectCreationPage ( "Whatever2" ); //$NON-NLS-1$
    this.initialObjectCreationPage.setTitle ( MemoryEditorPlugin.INSTANCE.getString ( "_UI_MemoryModelWizard_label" ) ); //$NON-NLS-1$
    this.initialObjectCreationPage.setDescription ( MemoryEditorPlugin.INSTANCE.getString ( "_UI_Wizard_initial_object_description" ) ); //$NON-NLS-1$
    addPage ( this.initialObjectCreationPage );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:62,代码来源:MemoryModelWizard.java

示例14: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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,代码行数:62,代码来源:RecipeModelWizard.java

示例15: addPages

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * 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 FsmModelWizardNewFileCreationPage("Whatever", selection);
	newFileCreationPage.setTitle(FsmEditorPlugin.INSTANCE.getString("_UI_FsmModelWizard_label"));
	newFileCreationPage.setDescription(FsmEditorPlugin.INSTANCE.getString("_UI_FsmModelWizard_description"));
	newFileCreationPage.setFileName(FsmEditorPlugin.INSTANCE.getString("_UI_FsmEditorFilenameDefaultBase") + "." + 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 = FsmEditorPlugin.INSTANCE.getString("_UI_FsmEditorFilenameDefaultBase");
				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 FsmModelWizardInitialObjectCreationPage("Whatever2");
	initialObjectCreationPage.setTitle(FsmEditorPlugin.INSTANCE.getString("_UI_FsmModelWizard_label"));
	initialObjectCreationPage.setDescription(FsmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
	addPage(initialObjectCreationPage);
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:55,代码来源:FsmModelWizard.java


注:本文中的org.eclipse.core.resources.IResource.getParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。