Editor[] editors = EditorFactory.getInstance().getAllEditors(); FileDocumentManager fileDocManager = FileDocumentManager.getInstance(); for(Editor editor : editors) { VirtualFile vf = fileDocManager.getFile(editor.getDocument()); String path = vf.getCanonicalPath(); System.out.println("path = " + path); }
/** * Attempt to convert the supplied value (with the given type) into a value compatible with this type. * * @param actualValue the value to be converted; may be null * @param actualType the type of the value; may be null * @return the converted value, or null if the value could not be converted to this type */ public Object convertValueFrom( Object actualValue, Type actualType ) { if (actualType == null) actualType = Type.typeFor(actualValue); return converter.convert(actualValue, actualType); }
/** * Determine whether monitoring is enabled. The default is to enable monitoring, but this can be used to turn off support * for monitoring should it not be necessary. * * @return true if monitoring is enabled, or false if it is disabled */ public boolean enabled() { return monitoring.getBoolean(FieldName.MONITORING_ENABLED, Default.MONITORING_ENABLED); } }
protected void addValidatorsForDisallowedTypes( Document parent, Path parentPath, Problems problems, CompositeValidator validators ) { Object disallowed = parent.get("disallowed"); if (Null.matches(disallowed)) return; String requiredName = parentPath.getLast(); if (requiredName != null) { EnumSet<Type> disallowedTypes = Type.typesWithNames(disallowed); validators.add(new DisallowedTypesValidator(requiredName, disallowedTypes)); } }
/** * Get the time that the first garbage collection process should be run. * * @return the initial time; never null */ public String getInitialTimeExpression() { return gc.getString(FieldName.INITIAL_TIME, Default.GARBAGE_COLLECTION_INITIAL_TIME); }
public void setKey( EditableDocument document, String key ) { assert key != null; document.setString(KEY, key); }
/** * Marks the given document as cacheable, by setting a flag. * * @param document a {@link EditableDocument} instance; never null * @param cacheable a boolean which indicates whether the document should be cacheable or not. */ public void setCacheable(EditableDocument document, boolean cacheable) { document.set(CACHEABLE_FIELD, cacheable); }
/** * Get the optimization interval in hours. * * @return the interval; never null */ public int getIntervalInHours() { return optimization.getInteger(FieldName.INTERVAL_IN_HOURS, Default.OPTIMIZATION_INTERVAL_IN_HOURS); }
@Override public String toString() { return Json.write(value); } }
@Override public String toString() { return "Code (" + getCode() + ')'; } }
@Override public int compareTo( Path that ) { if (that == this) return 0; if (that instanceof EmptyPath) return 0; return 0 - that.size(); }
protected void addValidatorsForDisallowedTypes( Document parent, Path parentPath, Problems problems, CompositeValidator validators ) { Object disallowed = parent.get("disallowed"); if (Null.matches(disallowed)) return; String requiredName = parentPath.getLast(); if (requiredName != null) { EnumSet<Type> disallowedTypes = Type.typesWithNames(disallowed); validators.add(new DisallowedTypesValidator(requiredName, disallowedTypes)); } }
/** * The location of the journal * * @return a {@code non-null} String */ public String location() { return this.journalingDoc.getString(FieldName.JOURNAL_LOCATION, Default.JOURNAL_LOCATION); }
/** * Get whether the reindexing should be done synchronously or asynchronously * * @return {@code true} if the reindexing should be performed asynchronously, {@code false} otherwise */ public boolean isAsync() { return reindexing == null || reindexing.getBoolean(FieldName.REINDEXING_ASYNC, true); }
public void setKey( EditableDocument document, String key ) { assert key != null; document.setString(KEY, key); }
@Override protected void writeBinaryStorageConfiguration( String repositoryName, OperationContext context, ModelNode model, EditableDocument binaries ) throws OperationFailedException { binaries.set(FieldName.TYPE, FieldValue.BINARY_STORAGE_TYPE_TRANSIENT); }
/** * Attempt to convert the supplied value (with the given type) into a value compatible with this type. * * @param actualValue the value to be converted; may be null * @param actualType the type of the value; may be null * @return the converted value, or null if the value could not be converted to this type */ public Object convertValueFrom( Object actualValue, Type actualType ) { if (actualType == null) actualType = Type.typeFor(actualValue); return converter.convert(actualValue, actualType); }
/** * Returns the type of the configured binary store. * * @return the type of the configured binary store, never {@code null} */ public String getType() { return binaryStorage.getString(FieldName.TYPE, FieldValue.BINARY_STORAGE_TYPE_TRANSIENT); }
/** * Get the name of the thread pool that should be used for sequencing work. * * @return the thread pool name; never null */ public String getThreadPoolName() { return sequencing.getString(FieldName.THREAD_POOL, Default.SEQUENCING_POOL); }