Java Code Examples for org.jetbrains.annotations.NotNull

The following are top voted examples for showing how to use org.jetbrains.annotations.NotNull. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AppleScript-IDEA   File: AppleScriptPsiImplUtil.java   View source code 6 votes vote down vote up
private static void addRecordTargetVariablesRecursive(@NotNull AppleScriptTargetRecordLiteral targetRecord, 
                                                      @NotNull List<AppleScriptTargetVariable> targetVariables) {

  for (AppleScriptObjectTargetPropertyDeclaration property : targetRecord.getObjectTargetPropertyDeclarationList()) {
    AppleScriptTargetVariable innerVariable = property.getTargetVariable();
    AppleScriptTargetListLiteral innerList = property.getTargetListLiteral();
    AppleScriptTargetRecordLiteral innerRecord = property.getTargetRecordLiteral();
    if (innerVariable != null) {
      targetVariables.add(innerVariable);
    }
    if (innerList != null) {
      targetVariables.addAll(innerList.getTargetVariableList());
    }
    if (innerRecord != null) {
      addRecordTargetVariablesRecursive(innerRecord, targetVariables);
    }
  }
}
 
Example 2
Project: devenv   File: IO.java   View source code 6 votes vote down vote up
private static void copyFile(@NotNull File source, @NotNull File dir) throws IOException
{
    //noinspection ResultOfMethodCallIgnored
    dir.mkdirs();
    File dest = new File(dir, source.getName());
    if (dest.exists())
    {
        //noinspection ResultOfMethodCallIgnored
        dest.delete();
    }
    //noinspection ResultOfMethodCallIgnored
    dest.createNewFile();
    try (InputStream is = new FileInputStream(source); OutputStream os = new FileOutputStream(dest))
    {
        byte[] buffer = new byte[BUFFER_SIZE];
        int length;
        while ((length = is.read(buffer)) > 0)
        {
            os.write(buffer, 0, length);
        }
    }
}
 
Example 3
Project: intellij-postfix-templates   File: CptReferenceContributor.java   View source code 6 votes vote down vote up
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
	// TODO
	registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),
		new PsiReferenceProvider() {
			@NotNull
			@Override
			public PsiReference[] getReferencesByElement(@NotNull PsiElement element,
			                                             @NotNull ProcessingContext
				                                             context) {
				PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
				String value = literalExpression.getValue() instanceof String ?
					(String) literalExpression.getValue() : null;
				if (value != null && value.startsWith("simple" + ":")) {
					return new PsiReference[]{
						new CptReference(element, new TextRange(8, value.length() + 1))};
				}
				return PsiReference.EMPTY_ARRAY;
			}
		});
}
 
Example 4
Project: pysonar2   File: TypeInferencer.java   View source code 6 votes vote down vote up
@NotNull
@Override
public Type visit(For node, State s) {
    bindIter(s, node.target, node.iter, SCOPE);
    Type t1 = Types.UNKNOWN;
    Type t2 = Types.UNKNOWN;
    Type t3 = Types.UNKNOWN;

    State s1 = s.copy();
    State s2 = s.copy();

    if (node.body != null) {
        t1 = visit(node.body, s1);
        s.merge(s1);
        t2 = visit(node.body, s1);
        s.merge(s1);
    }

    if (node.orelse != null) {
        t3 = visit(node.orelse, s2);
        s.merge(s2);
    }

    return UnionType.union(UnionType.union(t1, t2), t3);
}
 
Example 5
Project: teamcity-kubernetes-plugin   File: KubeCloudClient.java   View source code 6 votes vote down vote up
public KubeCloudClient(@Nullable String serverUuid,
                       @NotNull String cloudProfileId,
                       @NotNull KubeApiConnector apiConnector,
                       @NotNull List<KubeCloudImage> images,
                       @NotNull KubeCloudClientParametersImpl kubeClientParams,
                       @NotNull BuildAgentPodTemplateProviders podTemplateProviders,
                       @NotNull KubeDataCache cache,
                       @NotNull KubeBackgroundUpdater updater) {
    myServerUuid = serverUuid;
    myCloudProfileId = cloudProfileId;
    myApiConnector = apiConnector;
    myImageIdToImageMap = new ConcurrentHashMap<>(Maps.uniqueIndex(images, CloudImage::getId));
    myKubeClientParams = kubeClientParams;
    myPodTemplateProviders = podTemplateProviders;
    myCache = cache;
    myUpdater = updater;
    myUpdater.registerClient(this);
}
 
Example 6
Project: voicemenu   File: WorkSpace_TransformationMenu.java   View source code 6 votes vote down vote up
@NotNull
@Override
public TransformationMenuItem createItem(@NotNull TransformationMenuContext context) {
  String description;
  try {
    description = "submenu " + getText(context);
  } catch (Throwable t) {
    return super.createItem(context);
  }
  context.getEditorMenuTrace().pushTraceInfo();
  context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "8517997849287913434")));
  try {
    return super.createItem(context);
  } finally {
    context.getEditorMenuTrace().popTraceInfo();
  }
}
 
Example 7
Project: greycat-idea-plugin   File: GCMStructureViewClassElement.java   View source code 6 votes vote down vote up
@NotNull
@Override
public ItemPresentation getPresentation() {
    return new ItemPresentation() {
        @Nullable
        @Override
        public String getPresentableText() {
            return presText;
        }

        @Nullable
        @Override
        public String getLocationString() {
            return null;
        }

        @Nullable
        @Override
        public Icon getIcon(boolean b) {
            return PlatformIcons.CLASS_ICON;
        }
    };
}
 
Example 8
Project: educational-plugin   File: StudyNextWindowAction.java   View source code 6 votes vote down vote up
@Override
protected AnswerPlaceholder getTargetPlaceholder(@NotNull final TaskFile taskFile, int offset) {
  final AnswerPlaceholder selectedAnswerPlaceholder = taskFile.getAnswerPlaceholder(offset);
  final List<AnswerPlaceholder> placeholders = taskFile.getActivePlaceholders();
  if (selectedAnswerPlaceholder == null) {
    for (AnswerPlaceholder placeholder : placeholders) {
      if (placeholder.getOffset() > offset) {
        return placeholder;
      }
    }
  }
  else {
    int index = selectedAnswerPlaceholder.getIndex();
    if (StudyUtils.indexIsValid(index, placeholders)) {
      int newIndex = index + 1;
      return placeholders.get(newIndex == placeholders.size() ? 0 : newIndex);
    }
  }
  return null;
}
 
Example 9
Project: intellij-circleci-integration   File: RecentBuildsToolWindowFactory.java   View source code 5 votes vote down vote up
@NotNull
private Set<Integer> getExpandedRows() {
    Set<Integer> expanded = new HashSet<>(tree1.getRowCount());
    for (int i = 0; i < tree1.getRowCount(); i++) {
        if (tree1.isExpanded(i)) {
            expanded.add(i);
        }
    }
    return expanded;
}
 
Example 10
Project: jmonkeybuilder   File: ImageViewerEditor.java   View source code 5 votes vote down vote up
@Override
@FXThread
protected void createContent(@NotNull final VBox root) {

    imageView = new ImageView();

    FXUtils.addToPane(imageView, root);
    FXUtils.addClassTo(root, CSSClasses.IMAGE_VIEW_EDITOR_CONTAINER);
}
 
Example 11
Project: vertx-prometheus-metrics   File: PoolPrometheusMetrics.java   View source code 5 votes vote down vote up
@Override
public @NotNull Stopwatch begin(@NotNull Stopwatch submittedStopwatch) {
  tasks.queued.dec();
  tasks.used.inc();
  time.delay.observe(submittedStopwatch.stop());
  return submittedStopwatch;
}
 
Example 12
Project: DeBrug   File: ZwakkeAanspraakZwakkePlicht__BehaviorDescriptor.java   View source code 5 votes vote down vote up
@Override
protected <T> T invokeSpecial0(@NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
  int methodIndex = BH_METHODS.indexOf(method);
  if (methodIndex < 0) {
    throw new BHMethodNotFoundException(this, method);
  }
  switch (methodIndex) {
    case 0:
      return (T) ((SNode) GeefOvergang_id2hDGrbWPFpO(node));
    default:
      throw new BHMethodNotFoundException(this, method);
  }
}
 
Example 13
Project: hybris-integration-intellij-idea-plugin   File: ImpexPsiUtils.java   View source code 5 votes vote down vote up
@Nullable
@Contract(pure = true)
public static PsiElement getPrevNonWhitespaceElement(@NotNull final PsiElement element) {
    Validate.notNull(element);

    PsiElement prevSibling = element.getPrevSibling();

    while (null != prevSibling && (isWhiteSpace(prevSibling) || isLineBreak(prevSibling))) {
        prevSibling = prevSibling.getPrevSibling();
    }

    return prevSibling;
}
 
Example 14
Project: traute   File: TrauteJavacPlugin.java   View source code 5 votes vote down vote up
@NotNull
private static Set<String> collectPluginOptionKeys() {
    Set<String> result = new HashSet<>();
    for (Field field : TrauteConstants.class.getFields()) {
        int modifiers = field.getModifiers();
        if ((modifiers & PUBLIC) == 0 || (modifiers & STATIC) == 0 || (modifiers & FINAL) == 0
            || field.getType() != String.class)
        {
            continue;
        }
        try {
            String value = field.get(null).toString();
            if (!value.contains("traute")) {
                continue;
            }
            if (field.getName().contains("PREFIX")) {
                for (InstrumentationType type : InstrumentationType.values()) {
                    result.add(value + type.getShortName());
                }
            } else {
                result.add(value);
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(String.format(
                    "Unexpected exception on attempt to collect plugin option keys for %s.%s",
                    TrauteConstants.class.getName(), field.getName()
            ), e);
        }
    }
    return result;
}
 
Example 15
Project: traute   File: TrauteJavacPlugin.java   View source code 5 votes vote down vote up
private void printInstrumentationResults(@NotNull JavaFileObject file,
                                         @NotNull StatsCollector statsCollector,
                                         @NotNull TrautePluginLogger logger)
{

    ConcurrentMap<InstrumentationType, Long> stats = statsCollector.getStats();
    long totalInstrumentationsNumber = stats.entrySet()
                                            .stream()
                                            .mapToLong(Map.Entry::getValue)
                                            .sum();
    if (totalInstrumentationsNumber <= 0) {
        return;
    }
    StringBuilder details = new StringBuilder();
    for (InstrumentationType type : InstrumentationType.values()) {
        Long count = stats.get(type);
        if (count != null) {
            details.append(type).append(": ").append(count).append(", ");
        }
    }
    details.setLength(details.length() - 2);

    String fileName = file.toUri().getSchemeSpecificPart();
    while (fileName.startsWith("//")) {
        fileName = fileName.substring(1);
    }
    logger.info(String.format(
            "added %d instrumentation%s to the class %s - %s",
            totalInstrumentationsNumber, totalInstrumentationsNumber > 1 ? "s" : "", fileName, details)
    );
}
 
Example 16
Project: voicemenu   File: QueriesGenerated.java   View source code 5 votes vote down vote up
@Override
public boolean check(@NotNull IfMacroContext ctx) throws GenerationFailureException {
  switch (methodKey) {
    case 0:
      return QueriesGenerated.ifMacro_Condition_2702278965991008820(ctx);
    case 1:
      return QueriesGenerated.ifMacro_Condition_2702278965991168248(ctx);
    default:
      throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for if macro %s (key: #%d)", ctx.getTemplateReference(), methodKey));
  }
}
 
Example 17
Project: JWaves   File: Waves.java   View source code 5 votes vote down vote up
/**
 * Create feed client.
 *
 * @param url feed url.
 * @return feed client.
 */
public FeedClient createFeedClient(@NotNull final String url) {
    final Retrofit.Builder retrofitBuilder = configureRetrofit()
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .baseUrl(url);

    feedClient = new FeedClient(retrofitBuilder);
    return feedClient;
}
 
Example 18
Project: miniventure   File: Player.java   View source code 5 votes vote down vote up
public void checkInput(float delta, @NotNull Vector2 mouseInput) {
	// checks for keyboard input to move the player.
	// getDeltaTime() returns the time passed between the last and the current frame in seconds.
	int speed = Tile.SIZE * 5; // this is technically in units/second.
	Vector2 movement = new Vector2();
	if(Gdx.input.isKeyPressed(Input.Keys.LEFT)) movement.x--;
	if(Gdx.input.isKeyPressed(Input.Keys.RIGHT)) movement.x++;
	if(Gdx.input.isKeyPressed(Input.Keys.UP)) movement.y++;
	if(Gdx.input.isKeyPressed(Input.Keys.DOWN)) movement.y--;
	
	movement.nor();
	
	movement.add(mouseInput);
	movement.nor();
	
	movement.scl(speed * delta);
	
	move(movement.x, movement.y);
	
	if(pressingKey(Input.Keys.Q)) cycleHeldItem(false);
	if(pressingKey(Input.Keys.E)) cycleHeldItem(true);
	
	if(pressingKey(Input.Keys.C))
		attack();
	else if(pressingKey(Input.Keys.V))
		interact();
	
	heldItem = heldItem == null ? null : heldItem.consume();
}
 
Example 19
Project: educational-plugin   File: EduKotlinPluginConfigurator.java   View source code 5 votes vote down vote up
@NotNull
@Override
public DefaultActionGroup getTaskDescriptionActionGroup() {
  DefaultActionGroup taskDescriptionActionGroup = super.getTaskDescriptionActionGroup();
  taskDescriptionActionGroup.remove(ActionManager.getInstance().getAction(StudyShowHintAction.ACTION_ID));
  StudyFillPlaceholdersAction fillPlaceholdersAction = new StudyFillPlaceholdersAction();
  fillPlaceholdersAction.getTemplatePresentation().setIcon(EduKotlinIcons.FILL_PLACEHOLDERS_ICON);
  fillPlaceholdersAction.getTemplatePresentation().setText("Fill Answer Placeholders");
  taskDescriptionActionGroup.add(fillPlaceholdersAction);
  return taskDescriptionActionGroup;
}
 
Example 20
Project: jmonkeybuilder   File: NodeTreeNode.java   View source code 5 votes vote down vote up
@Override
public @NotNull Array<TreeNode<?>> getChildren(@NotNull final NodeTree<?> nodeTree) {

    final Array<TreeNode<?>> result = ArrayFactory.newArray(TreeNode.class);
    final List<Spatial> children = getSpatials();
    children.forEach(spatial -> result.add(FACTORY_REGISTRY.createFor(spatial)));
    result.addAll(super.getChildren(nodeTree));

    return result;
}
 
Example 21
Project: hybris-integration-intellij-idea-plugin   File: DefaultHybrisProjectService.java   View source code 5 votes vote down vote up
@Override
public boolean isPlatformExtModule(@NotNull final File file) {
    Validate.notNull(file);

    return file.getAbsolutePath().contains(HybrisConstants.PLATFORM_EXT_MODULE_PREFIX)
           && new File(file, HybrisConstants.EXTENSION_INFO_XML).isFile()
           && !isCoreExtModule(file);
}
 
Example 22
Project: allure-idea   File: AllureInvalidFixtureInspection.java   View source code 5 votes vote down vote up
@Nullable
private static String getAnnotationName(@NotNull final PsiAnnotation annotation) {
    final Ref<String> qualifiedAnnotationName = new Ref<>();
    ApplicationManager.getApplication().runReadAction(() -> {
                String qualifiedName = annotation.getQualifiedName();
                qualifiedAnnotationName.set(qualifiedName);
            }
    );
    return qualifiedAnnotationName.get();
}
 
Example 23
Project: languagetool-languageserver   File: DocumentPositionCalculator.java   View source code 5 votes vote down vote up
@NotNull
private static Position getPosition(int pos, int[] lineStarts) {

    int line = Arrays.binarySearch(lineStarts, pos);

    if (line < 0) {
        int insertion_point = -1 * line - 1;
        line = insertion_point - 1;
    }

    return new Position(line, pos - lineStarts[line]);
}
 
Example 24
Project: teamcity-autotools-plugin   File: DejagnuTestsXMLParser.java   View source code 5 votes vote down vote up
/**
 * Replace header with xml version 1.0 to version 1.1.
 * @param xmlEntry string for replacing
 * @return new string after replacing
 */
@NotNull static String replaceXmlHeaderVersion(@NotNull final String xmlEntry){
  final Matcher matcher = XML_HEADER_PATTERN.matcher(xmlEntry);
  if (matcher.find()) {
    return matcher.replaceFirst(matcher.group(1) + "1.1" + matcher.group(3));
  }
  return xmlEntry;
}
 
Example 25
Project: dtmlibs   File: CustomSerializer2.java   View source code 5 votes vote down vote up
@Nullable
@Override
public Custom deserialize(@Nullable Object serialized, @NotNull Class wantedType, @NotNull SerializerSet serializerSet) throws IllegalArgumentException {
    if (serialized instanceof Map) {
        Custom custom = new Custom(((Map) serialized).get("name").toString().toLowerCase());
        List<?> data = ((List<?>)((Map)((Map) serialized).get("data")).get("array"));
        custom.data.array = data.toArray(new Object[data.size()]);
        for (int i = 0; i < data.size(); i++) {
            custom.data.array[i] = Integer.valueOf(String.valueOf(data.get(i)));
        }
        return custom;
    } else {
        throw new IllegalArgumentException("serialized form must be a map");
    }
}
 
Example 26
Project: dtmlibs   File: YamlFileCommentInstrumenter.java   View source code 5 votes vote down vote up
/**
 * Parses the given file (which must be in yaml format) and inserts comments.
 *
 * @throws IOException if the file does not exist, is a directory or cannot be read/written for some reason.
 */
public void saveCommentsToFile(@NotNull final File yamlFile) throws IOException {
    if (commentMap.hasComments()) {
        String fileAsString = FileUtil.getFileContentsAsString(yamlFile);
        String instrumentedContents = addCommentsToYamlString(fileAsString);
        saveNewContentsToFile(instrumentedContents, yamlFile);
    }
}
 
Example 27
Project: scmt-server   File: DeskClient.java   View source code 5 votes vote down vote up
/**
 * Get the Desk Note service
 *
 * @return the default Desk Note service
 */
@NotNull
public NoteService notes()
{
    if (noteService == null)
    {
        noteService = this.getRestAdapter().create(NoteService.class);
    }
    return noteService;
}
 
Example 28
Project: jmonkeybuilder-extension   File: EditableWaterWithDirectionLightFilter.java   View source code 5 votes vote down vote up
@Override
public @NotNull List<EditableProperty<?, ?>> getEditableProperties() {

    final List<EditableProperty<?, ?>> result = super.getEditableProperties();
    result.add(new SimpleProperty<>(DIRECTION_LIGHT_FROM_SCENE, "Direction light", this,
            makeGetter(this, DirectionalLight.class, "getDirectionalLight"),
            makeSetter(this, DirectionalLight.class, "setDirectionalLight")));

    return result;
}
 
Example 29
Project: yii2support   File: Util.java   View source code 5 votes vote down vote up
@NotNull
static ArrayHashElement[] getMessages(PhpPsiElement element, String category) {
    ArrayList<ArrayHashElement> messages = new ArrayList<>();

    PsiDirectory directory = getDirectory(element);
    if (directory != null) {
        PsiFile file = directory.findFile(category.concat(".php"));
        if (file != null) {
            messages.addAll(loadMessagesFromFile(file));
        }
    }

    return messages.toArray(new ArrayHashElement[messages.size()]);
}
 
Example 30
Project: intellij-plugin   File: CoffigFindUsagesProvider.java   View source code 5 votes vote down vote up
@NotNull
@Override
public String getNodeText(@NotNull PsiElement element, boolean useFullName) {
    if (element instanceof YAMLKeyValue) {
        if (useFullName) {
            return resolvePath(element);
        } else {
            return ((YAMLKeyValue) element).getKeyText();
        }
    } else {
        return "";
    }
}
 
Example 31
Project: hybris-integration-intellij-idea-plugin   File: DefaultEclipseConfigurator.java   View source code 5 votes vote down vote up
@Override
public void configure(
    @NotNull final HybrisProjectDescriptor hybrisProjectDescriptor,
    @NotNull final Project project,
    @NotNull final List<EclipseModuleDescriptor> eclipseModules,
    @Nullable final String[] eclipseGroup
) {
    if (eclipseModules.isEmpty()) {
        return;
    }
    final EclipseImportBuilder eclipseImportBuilder = new EclipseImportBuilder();
    final List<String> projectList = eclipseModules
        .stream()
        .map(AbstractHybrisModuleDescriptor::getRootDirectory)
        .map(File::getPath)
        .collect(Collectors.toList());
    if (hybrisProjectDescriptor.getModulesFilesDirectory() != null) {
        eclipseImportBuilder.getParameters().converterOptions.commonModulesDirectory =
            hybrisProjectDescriptor.getModulesFilesDirectory().getPath();
    }
    eclipseImportBuilder.setList(projectList);
    ApplicationManager.getApplication().invokeAndWait(() -> {
        final List<Module> newRootModules = eclipseImportBuilder.commit(project);
        moveEclipseModulesToGroup(project, newRootModules, eclipseGroup);
    });

}
 
Example 32
Project: jmonkeybuilder-extension   File: EditablePosterizationFilter.java   View source code 5 votes vote down vote up
@Override
public void write(@NotNull final JmeExporter exporter) throws IOException {
    super.write(exporter);
    final OutputCapsule capsule = exporter.getCapsule(this);
    capsule.write(getGamma(), "gamma", 0.6F);
    capsule.write(getNumColors(), "numColors", 8);
    capsule.write(getStrength(), "strength", 1.0f);
}
 
Example 33
Project: jmonkeybuilder   File: DefaultControlPropertyBuilder.java   View source code 5 votes vote down vote up
@FXThread
private void build(@NotNull final AbstractControl control, @NotNull final VBox container,
                   @NotNull final ModelChangeConsumer changeConsumer) {

    final boolean enabled = control.isEnabled();

    final BooleanPropertyControl<ModelChangeConsumer, AbstractControl> enabledControl =
            new BooleanPropertyControl<>(enabled, Messages.MODEL_PROPERTY_IS_ENABLED, changeConsumer);

    enabledControl.setApplyHandler(AbstractControl::setEnabled);
    enabledControl.setSyncHandler(AbstractControl::isEnabled);
    enabledControl.setEditObject(control);

    FXUtils.addToPane(enabledControl, container);
}
 
Example 34
Project: crypto-shuffle   File: JsonUtil.java   View source code 5 votes vote down vote up
@NotNull
@Override
public MultiEncryption deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
    JsonNode node = jsonParser.getCodec().readTree(jsonParser);
    String version = deserializeVersion(node);
    switch (version) {
        case VERSION1_0:
            return deserialize1_0(node);
        default:
            throw new RuntimeException("Value of " + VERSION_NAME + " is \"" + version + "\" but must be \"1.0\"");
    }
}
 
Example 35
Project: jmonkeybuilder   File: Texture2DPropertyControl.java   View source code 4 votes vote down vote up
@Override
@FXThread
protected void createComponents(@NotNull final HBox container) {
    super.createComponents(container);

    fieldContainer = new HBox();

    if (!isSingleRow()) {
        fieldContainer.prefWidthProperty().bind(container.widthProperty());
    }

    textureTooltip = new ImageChannelPreview();

    final VBox previewContainer = new VBox();

    texturePreview = new ImageView();
    texturePreview.fitHeightProperty().bind(previewContainer.heightProperty());
    texturePreview.fitWidthProperty().bind(previewContainer.widthProperty());

    Tooltip.install(texturePreview, textureTooltip);

    final Button settingsButton = new Button();
    settingsButton.setGraphic(new ImageView(Icons.SETTINGS_16));
    settingsButton.setOnAction(event -> openSettings());
    settingsButton.disableProperty().bind(buildDisableRemoveCondition());

    final Button addButton = new Button();
    addButton.setGraphic(new ImageView(Icons.ADD_12));
    addButton.setOnAction(event -> processAdd());

    final Button removeButton = new Button();
    removeButton.setGraphic(new ImageView(Icons.REMOVE_12));
    removeButton.setOnAction(event -> processRemove());
    removeButton.disableProperty().bind(buildDisableRemoveCondition());

    if (!isSingleRow()) {

        textureLabel = new Label(NO_TEXTURE);
        textureLabel.prefWidthProperty().bind(widthProperty()
                .subtract(removeButton.widthProperty())
                .subtract(previewContainer.widthProperty())
                .subtract(settingsButton.widthProperty())
                .subtract(addButton.widthProperty()));

        FXUtils.addToPane(textureLabel, fieldContainer);
        FXUtils.addClassTo(textureLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_ELEMENT_LABEL);
        FXUtils.addClassesTo(fieldContainer, CSSClasses.TEXT_INPUT_CONTAINER,
                CSSClasses.ABSTRACT_PARAM_CONTROL_INPUT_CONTAINER);

    } else {
        FXUtils.addClassesTo(fieldContainer, CSSClasses.TEXT_INPUT_CONTAINER_WITHOUT_PADDING);
    }

    FXUtils.addToPane(previewContainer, fieldContainer);
    FXUtils.addToPane(addButton, fieldContainer);
    FXUtils.addToPane(settingsButton, fieldContainer);
    FXUtils.addToPane(removeButton, fieldContainer);
    FXUtils.addToPane(fieldContainer, container);
    FXUtils.addToPane(texturePreview, previewContainer);

    FXUtils.addClassTo(previewContainer, CSSClasses.ABSTRACT_PARAM_CONTROL_PREVIEW_CONTAINER);
    FXUtils.addClassesTo(settingsButton, addButton, removeButton, CSSClasses.FLAT_BUTTON,
            CSSClasses.INPUT_CONTROL_TOOLBAR_BUTTON);
}
 
Example 36
Project: DeBrug   File: OptioneleBevoegdheidOptioneleGehoudenheid_EditorBuilder_a.java   View source code 4 votes vote down vote up
Inline_Builder_xevd8x_a61a(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) {
  super(context);
  myReferencingNode = referencingNode;
  myNode = node;
}
 
Example 37
Project: ProjectAltaria   File: Pool.java   View source code 4 votes vote down vote up
Pool(@NotNull Map<String, String> options, @NotNull IMessage message, long time, @NotNull Type type) {
    this.options = options;
    this.message = message;
    this.time = time;
    this.type = type;
}
 
Example 38
Project: AppleScript-IDEA   File: DictionaryPropertyImpl.java   View source code 4 votes vote down vote up
@NotNull
@Override
public PsiType getPsiType() {
  //definition from dictionary by name? is it really needed?
  return null;
}
 
Example 39
Project: jmonkeybuilder   File: FolderAssetResourcePropertyControl.java   View source code 4 votes vote down vote up
public FolderAssetResourcePropertyControl(@NotNull final VarTable vars,
                                          @NotNull final PropertyDefinition definition,
                                          @NotNull final Runnable validationCallback) {
    super(vars, definition, validationCallback);
}
 
Example 40
Project: devenv   File: MavenToolProvider.java   View source code 4 votes vote down vote up
@Override
@NotNull
public String id()
{
    return "maven";
}