@@ -490,74 +490,6 @@ public static boolean isContentTypeId(IDOMNode node, String contentTypeId) {
490490 return contentTypeId .equals (nodeContentTypeId );
491491 }
492492
493- /**
494- * Returns the content type id of the file by using SSE DOM Model.
495- *
496- * @param file
497- * @return
498- */
499- public static String getStructuredModelContentTypeId (IFile file ) {
500- IStructuredModel model = null ;
501- try {
502- model = StructuredModelManager .getModelManager ()
503- .getExistingModelForRead (file );
504- if (model == null ) {
505- model = StructuredModelManager .getModelManager ()
506- .getModelForRead (file );
507- }
508- if (model != null ) {
509- return model .getContentTypeIdentifier ();
510- }
511- } catch (IOException e ) {
512- return null ;
513- } catch (CoreException e ) {
514- return null ;
515- } finally {
516- if (model != null ) {
517- model .releaseFromRead ();
518- }
519- }
520- return null ;
521- }
522-
523- /**
524- * Returns true if file match an item of the contentTypeIds list and false
525- * otherwise.
526- *
527- * @param file
528- * @param contentTypeIds
529- * @return
530- */
531- public static boolean isContentTypeId (IFile file ,
532- Collection <String > contentTypeIds ) {
533- if (contentTypeIds == null ) {
534- return false ;
535- }
536- String structuredModelContentTypeId = getStructuredModelContentTypeId (file );
537- if (structuredModelContentTypeId == null ) {
538- return false ;
539- }
540- return contentTypeIds .contains (structuredModelContentTypeId );
541- }
542-
543- /**
544- * Returns true if file match the contentTypeId and false otherwise.
545- *
546- * @param file
547- * @param contentTypeId
548- * @return
549- */
550- public static boolean isContentTypeId (IFile file , String contentTypeId ) {
551- if (contentTypeId == null ) {
552- return false ;
553- }
554- String structuredModelContentTypeId = getStructuredModelContentTypeId (file );
555- if (structuredModelContentTypeId == null ) {
556- return false ;
557- }
558- return contentTypeId .equals (structuredModelContentTypeId );
559- }
560-
561493 /**
562494 * Returns the owner element of the node and null if not found.
563495 *
0 commit comments