net.jqhome.jwps.ea.standard
Class TypeEA

java.lang.Object
  |
  +--net.jqhome.jwps.ea.AbstractEA
        |
        +--net.jqhome.jwps.ea.EAVector
              |
              +--net.jqhome.jwps.ea.MVMTEA
                    |
                    +--net.jqhome.jwps.ea.StringMVMT
                          |
                          +--net.jqhome.jwps.ea.standard.TypeEA

public class TypeEA
extends StringMVMT

Here is a place where EAs really shine. Normally a file is associated with an application by its extension – a holdover from the days of DOS. This is pretty fragile and in file systems that have long names (the old DOS FAT (File Allocation Table) system allowed 8 characters per name with a three character extension), it is all too easy to rename the file in a GUI and promptly lose the ability to use the file. OS/2 lets you set the type. For a list of pre-defined types look in JWPConstants where they all start with TYPE_. Other type may and surely do exist on your system, depending on what applications you have. If you add a type to a file, then when you display the open menu for this file, the corresponding application appears as an option. renaming or moving the file does not change this relationship.

You may, of course, define your own types if you like, although you then need to have applications that use them. This is easy to do under jWPS and you should look at JWPProgramFile for the way to do this.

Finally, if there are no types defined for a file, the OS falls back on looking at the extension.

This is supposed to be an MVMT. A lot of applications, however, actually set this as an ASCII EA. This is not good practice but a statistical check on a few systems showed that this was running neck and neck as the way to do it.jWPS will always return the correct object, so this is just for your information.


Nested Class Summary
 
Nested classes inherited from class net.jqhome.jwps.ea.MVMTEA
MVMTEA.FoundEA
 
Field Summary
 
Fields inherited from class net.jqhome.jwps.ea.EAVector
EA_CODEPAGE_INDEX, EA_COUNT_INDEX, EA_TYPE_INDEX, MVMT_DATA_CONTROL_BLOCK_LENGTH, MVMT_DATA_LENGTH_OFFSET, MVMT_DATA_OFFSET, MVMT_DATA_START_INDEX, MVMT_DATA_TYPE_OFFSET, MVST_DATA_CONTROL_BLOCK_LENGTH, MVST_DATA_LENGTH_OFFSET, MVST_DATA_OFFSET, MVST_DATA_START_INDEX, MVST_TYPE_INDEX
 
Fields inherited from class net.jqhome.jwps.ea.AbstractEA
EA_NAME_ASSOCIATION_TABLE, EA_NAME_CODEPAGE, EA_NAME_COMMENTS, EA_NAME_HISTORY, EA_NAME_ICON, EA_NAME_ICON1, EA_NAME_KEYPHRASES, EA_NAME_LONGNAME, EA_NAME_SUBJECT, EA_NAME_TYPE, EA_NAME_VERSION, XML_EA_B64_ENCODING, XML_EA_CODEPAGE_TAGNAME, XML_EA_ENCODING_TYPE_TAGNAME, XML_EA_FILE_TAGNAME, XML_EA_IS_CRITICAL_TAGNAME, XML_EA_LIST_TAGNAME, XML_EA_NAME_TAGNAME, XML_EA_TAGNAME, XML_EA_TEXT_ENCODING, XML_EA_TYPE_TAGNAME, XML_EA_VALUE_TAGNAME
 
Constructor Summary
TypeEA()
           
TypeEA(RawEA rEA)
           
 
Method Summary
 void addType(java.lang.String type)
          Adds a type to this EA.
 boolean isCritical()
          Returns if this EA is marked as critical.
 void removeType(java.lang.String type)
          Removes the given type.
 void setCritical(boolean value)
           
 
Methods inherited from class net.jqhome.jwps.ea.StringMVMT
addEA, getStringEAAt, removeStringEA, removeStringEA
 
Methods inherited from class net.jqhome.jwps.ea.MVMTEA
fromRawEA, getEA, getEntryType, getMVEA2, getMVMTCount, getRawEASize, getSTEntryLength, getSVEA2, mvmtSetup, toRawEA, toString, valueSize
 
Methods inherited from class net.jqhome.jwps.ea.EAVector
addEA, addEA, equals, getCodepage, getEAAt, getEACodepage, getEACount, getEAType, getVector, isDefaultCodepage, removeEAAt, setCodepage, size, toXML
 
Methods inherited from class net.jqhome.jwps.ea.AbstractEA
fileToBytes, getName, getType, isUserDefined, setName, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeEA

public TypeEA()
       throws JWPException

TypeEA

public TypeEA(RawEA rEA)
       throws JWPException
Method Detail

isCritical

public boolean isCritical()
Description copied from class: AbstractEA
Returns if this EA is marked as critical. Note that critical here means that the applications that use this EA will not be able to function without it. Yes, you can edit or delete them as you like. All that this means is that some application needs it. The honor system is in effect to leave other applications EAs alone especially if they are critical.

Overrides:
isCritical in class AbstractEA

setCritical

public void setCritical(boolean value)
                 throws JWPException
Overrides:
setCritical in class AbstractEA
Throws:
JWPException - if an attempt is made to set the value to anything but false since this EA is not critical.

addType

public void addType(java.lang.String type)
             throws JWPException
Adds a type to this EA. Case is important, so this is added unless there is an exact match.

JWPException

removeType

public void removeType(java.lang.String type)
                throws JWPException
Removes the given type.

JWPException