Tabnine Logo
ResourceUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
ResourceUtils
in
com.nexitia.emaginplatform.jfx.core.api

Best Java code snippets using com.nexitia.emaginplatform.jfx.core.api.ResourceUtils (Showing top 13 results out of 315)

origin: com.nexitia.emaginplatform/emagin-core-api

 private static InputStream getFromStringContext(String path) {
  if(path.startsWith("classpath:")) {
   return getStream(path.split("classpath:")[1]);
  }
  return null;
 }
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public URL getMenuConfiguration(IEmaginController context) {
 return ResourceUtils.getURL(AbstractViewController.class, primaryMenu);
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-mobile-integration

@Bean
@Singleton
@Named("ResourceUtils")
public ResourceUtils resourceUtils() {
 return new ResourceUtils();
}
origin: com.nexitia.emaginplatform/emagin-core-api

/**
 * Uses all possible methods to find out this resource.
 *
 * @param clazz
 * @param path
 * @return
 */
public static InputStream getStream(Class clazz, String path) {
 InputStream inputStream = clazz.getResourceAsStream(path);
 if (inputStream == null) {
  inputStream = clazz.getClassLoader().getResourceAsStream(path);
 }
 if (inputStream == null) {
  inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
 }
 if (inputStream == null) {
  inputStream = getFromStringContext(path);
 }
 if (inputStream == null) {
  System.out.println("Definitly Resource not found : " + path);
 }
 return inputStream;
}
origin: com.nexitia.emaginplatform/emagin-core-api

/**
 * Uses all possible methods to find out this resource.
 *
 * @param clazz
 * @param path
 * @return
 */
public static InputStream getStream(String path) {
 InputStream inputStream = ResourceUtils.class.getResourceAsStream(path);
 if (inputStream == null) {
  inputStream = ResourceUtils.class.getClassLoader().getResourceAsStream(path);
 }
 if (inputStream == null) {
  inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
 }
 if (inputStream == null) {
  inputStream = getFromStringContext(path);
 }
 if (inputStream == null) {
  System.out.println("Definitly Resource not found : " + path);
 }
 return inputStream;
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-mobile-integration

 /**
  * Merge views definitions corresponding to this view. View must define at least one
  * wizardConfiguration.
  */
 @Override
 public VLViewConfigXML getConfigurationFile(final IEmaginController controller) {
  VLViewConfigXML finalResult = null;

  if(debug) {
   System.out.println("Searching for wiew : " + controller.getViewDefinitions().get(0));
  }

  String file = controller.getViewDefinitions().get(0);
  if(file.endsWith(".xml")) {
   throw new RuntimeException("Only Json configurration file is supported, given" + file);
  }

  if(debug) {
   System.out.println("### Searching for wiew : " + file);
  }

  Gson gson = new Gson();
  InputStream io = ResourceUtils.getStream(controller.getClass(), file);
  finalResult = gson.fromJson(new InputStreamReader(io), VLViewConfigXML.class);

  return finalResult;
 }
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public URL getMenuConfiguration(IEmaginController context) {
 return ResourceUtils.getURL(AbstractViewController.class, menuDefinitionLocation);
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Get the single instance of icon reolver. When first time loading, it will search for spring bean
 * nammed 'IconDefinitionFiles", and will load all files inside it.
 */
public static ModelIconUtils instance() {
 if (instance == null) {
  instance = (ModelIconUtils) Services.getBean("ModelIconUtils");
  List<String> iconDefinitionFiles = (List<String>) Services.getBean("IconDefinitionFiles");
  for (String definition : iconDefinitionFiles) {
   Properties definitionMapping = new Properties();
   try (InputStream is = ResourceUtils.getStream(ModelIconUtils.class, definition)) {
    definitionMapping.load(is);
    instance.iconMapping.putAll(definitionMapping);
   } catch (Exception ex) {
    ex.printStackTrace();
   }
  }
 }
 return instance;
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

public void setDefaultTheme(String themePath) {
 clearCurrentTheme();
 loadedStylesheets.add(ResourceUtils.getURL(themePath).toExternalForm());
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-mobile-integration

try(InputStream io = ResourceUtils.getStream(getClass(), coreAttributes)){
 Gson gson1 = new Gson();
 VLViewConfigXML c  = gson1.fromJson(new InputStreamReader(io), VLViewConfigXML.class);
try(InputStream io = ResourceUtils.getStream(getClass(), coreComp)){
 Gson gson = new Gson();
 VLViewConfigXML c = gson.fromJson(new InputStreamReader(io), VLViewConfigXML.class);
try(InputStream io = ResourceUtils.getStream(getClass(), coreActions)){
 Gson gson = new Gson();
 VLViewConfigXML c = gson.fromJson(new InputStreamReader(io), VLViewConfigXML.class);
try(InputStream io = ResourceUtils.getStream(getClass(), coreActionsModel)){
 Gson gson = new Gson();
 VLViewConfigXML c = gson.fromJson(new InputStreamReader(io), VLViewConfigXML.class);
origin: com.nexitia.emaginplatform/emagin-core-api

URL rul = getURL(path);
if(rul == null) {
 rul = clazz.getResource(path);
origin: com.nexitia.emaginplatform/emagin-jfxcore-demoapp-components

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 NodeHelper.styleClassAddAll(this, configuration);
 try (InputStream is = ResourceUtils.getStream("/images/logo/EMAGIN_FX_WHITE.png")) {
  if(is != null) {
   final Image img = new Image(is, 200, 102, true, true);
   final ImageView imgView = new ImageView(img);
   // getChildren().add(imgView);
  }
 } catch (IOException e) {
  // e.printStackTrace();
 }
}
origin: com.nexitia.emaginplatform/emagin-jfxcore-demoapp-components

try (InputStream is = ResourceUtils.getStream("/images/logo/EMAGIN_FX_DEMOAPP_DARK.png")) {
 final Image img = new Image(is, 180, 180, true, true);
 final ImageView imgView = new ImageView(img);
com.nexitia.emaginplatform.jfx.core.apiResourceUtils

Most used methods

  • getStream
    Uses all possible methods to find out this resource.
  • getURL
    Get classpath url associated to resource with given path.
  • <init>
  • getFromStringContext

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • Collectors (java.util.stream)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BoxLayout (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now