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


Java IResource.PROJECT屬性代碼示例

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


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

示例1: visit

@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	if (resource == null) {
		return false;
	}
	switch (resource.getType()) {
	case IResource.ROOT:
	case IResource.PROJECT:
	case IResource.FOLDER:
		return true;
	case IResource.FILE:
		IFile file = (IFile) resource;
		if (EditorConfigConstants.EDITORCONFIG.equals(file.getName())
				&& delta.getKind() == IResourceDelta.CHANGED) {
			entries.remove(new FileResource(file));
		}
	}
	return false;
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:20,代碼來源:IDEEditorConfigManager.java

示例2: dialogChanged

/**
 * Ensures that both text fields are set.
 */
private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	if (getContainerName().length() == 0) {
		updateStatus(EditorConfigMessages.NewEditorConfigFileWizardPage_folder_required_error);
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus(EditorConfigMessages.NewEditorConfigFileWizardPage_folder_noexists_error);
		return;
	}
	if (!container.isAccessible()) {
		updateStatus(EditorConfigMessages.NewEditorConfigFileWizardPage_project_noaccessible_error);
		return;
	}
	if (((IContainer) container).exists(EDITOTR_CONFIG_PATH)) {
		updateStatus(EditorConfigMessages.NewEditorConfigFileWizardPage_folder_already_editorconfig_error);
		return;
	}
	updateStatus(null);
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:23,代碼來源:NewEditorConfigFileWizardPage.java

示例3: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot()
			.findMember(new Path(getContainerName().get("ProjectPath")));

	if(!containerSourceText.getText().isEmpty()  && !containerTargetText.getText().isEmpty())
	{
		okButton.setEnabled(true);
	}

	if (getContainerName().get("ProjectPath").length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null
			|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	updateStatus(null);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:28,代碼來源:TargetHandlerDialog.java

示例4: dialogChanged

/**
 * This method ensures user select Target project and permissions
 */
private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot()
			.findMember(new Path(getContainerName().get("TargetPath")));
	

	if (getContainerName().get("TargetPath").length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null
			|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	updateStatus(null);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:23,代碼來源:WizardPageHandler.java

示例5: visit

@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	boolean processResourceChildren = true;
	
	if(delta.getResource().getType() == IResource.PROJECT){				
		if(delta.getKind() == IResourceDelta.ADDED){
			newlyCreatedProjects.add((IProject) delta.getResource());
		}
		processResourceChildren = false; // no need to analyze project content
	}
	
	
	return processResourceChildren;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:14,代碼來源:NewProjectWorkspaceListener.java

示例6: getParent

@Override
public ResourcePath getParent() {
	if (container.getType() == IResource.PROJECT) {
		// Stop the search of  '.editorconfig' files in the parent container
		return null;
	}
	IContainer parent = container.getParent();
	return parent == null ? null : new ContainerResourcePath(parent);
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:9,代碼來源:ContainerResourcePath.java

示例7: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot()
			.findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null
			|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("mpe") == false) {
			updateStatus("File extension must be \"mpe\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:40,代碼來源:SampleNewWizardPage.java

示例8: getAcceptedResourceTypes

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

示例9: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged ()
{
    final IResource container = ResourcesPlugin.getWorkspace ().getRoot ().findMember ( new Path ( getContainerName () ) );
    final String fileName = getFileName ();

    if ( getContainerName ().length () == 0 )
    {
        updateStatus ( "File container must be specified" );
        return;
    }
    if ( container == null || ( container.getType () & ( IResource.PROJECT | IResource.FOLDER ) ) == 0 )
    {
        updateStatus ( "File container must exist" );
        return;
    }
    if ( !container.isAccessible () )
    {
        updateStatus ( "Project must be writable" );
        return;
    }
    if ( fileName.length () == 0 )
    {
        updateStatus ( "File name must be specified" );
        return;
    }
    if ( fileName.replace ( '\\', '/' ).indexOf ( '/', 1 ) > 0 )
    {
        updateStatus ( "File name must be valid" );
        return;
    }
    final int dotLoc = fileName.lastIndexOf ( '.' );
    if ( dotLoc != -1 )
    {
        final String ext = fileName.substring ( dotLoc + 1 );
        if ( ext.equalsIgnoreCase ( "oscar" ) == false )
        {
            updateStatus ( "File extension must be \"oscar\"" );
            return;
        }
    }
    updateStatus ( null );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:46,代碼來源:NewArchiveWizardPage.java

示例10: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("cimpl") == false) {
			updateStatus("File extension must be \"cimpl\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:53,代碼來源:CompImplMainPage.java

示例11: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("deploy") == false) {
			updateStatus("File extension must be \"deploy\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:53,代碼來源:IntDeploymentMainPage.java

示例12: dialogChanged

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("types") == false) {
			updateStatus("File extension must be \"types\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:49,代碼來源:TypesMainPage.java

示例13: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("lsys") == false) {
			updateStatus("File extension must be \"lsys\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:53,代碼來源:IntLogicalSysMainPage.java

示例14: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("srvc") == false) {
			updateStatus("File extension must be \"srvc\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:53,代碼來源:ServicesMainPage.java

示例15: dialogChanged

/**
 * Ensures that both text fields are set.
 */

private void dialogChanged() {
	IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
	String fileName = getFileName();

	if (getContainerName().length() == 0) {
		updateStatus("File container must be specified");
		return;
	}
	if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
		updateStatus("File container must exist");
		return;
	}
	if (!container.isAccessible()) {
		updateStatus("Project must be writable");
		return;
	}
	if (fileName.length() == 0) {
		updateStatus("File name must be specified");
		return;
	}
	if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
		updateStatus("File name must be valid");
		return;
	}
	File file = new File(container.getLocation().toOSString());
	File[] contains = file.listFiles(new FileFilter() {

		@Override
		public boolean accept(File pathname) {
			if (pathname.getName().equalsIgnoreCase(fileName))
				return true;
			else
				return false;
		}
	});
	if (contains != null && contains.length > 0) {
		updateStatus("File name must be different");
		return;
	}
	int dotLoc = fileName.lastIndexOf('.');
	if (dotLoc != -1) {
		String ext = fileName.substring(dotLoc + 1);
		if (ext.equalsIgnoreCase("fassmbl") == false) {
			updateStatus("File extension must be \"fassmbl\"");
			return;
		}
	}
	updateStatus(null);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:53,代碼來源:FinalAssemblyMainPage.java


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