Search in sources :

Example 26 with PropertiesComponent

use of com.intellij.ide.util.PropertiesComponent in project intellij-plugins by JetBrains.

the class ProjectWindowBounds method save.

public static void save(Project project, DataInput input) throws IOException {
    PropertiesComponent d = PropertiesComponent.getInstance(project);
    d.setValue(X, readValue(input));
    d.setValue(Y, readValue(input));
    d.setValue(W, readValue(input));
    d.setValue(H, readValue(input));
}
Also used : PropertiesComponent(com.intellij.ide.util.PropertiesComponent)

Example 27 with PropertiesComponent

use of com.intellij.ide.util.PropertiesComponent in project intellij-plugins by JetBrains.

the class PhoneGapSettings method getWorkingDirectory.

@NotNull
public String getWorkingDirectory(@Nullable Project project) {
    if (project == null)
        return "";
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    String value = propertiesComponent.getValue(PHONEGAP_WORK_DIRECTORY);
    if (value != null)
        return value;
    String item = ContainerUtil.getFirstItem(PhoneGapUtil.getDefaultWorkingDirectory(project));
    return item == null ? "" : item;
}
Also used : PropertiesComponent(com.intellij.ide.util.PropertiesComponent) NotNull(org.jetbrains.annotations.NotNull)

Example 28 with PropertiesComponent

use of com.intellij.ide.util.PropertiesComponent in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoModuleLibrariesInitializer method showVendoringNotification.

private void showVendoringNotification() {
    if (!myModuleInitialized || myModule.isDisposed()) {
        return;
    }
    Project project = myModule.getProject();
    String version = GoSdkService.getInstance(project).getSdkVersion(myModule);
    if (!GoVendoringUtil.supportsVendoring(version) || GoVendoringUtil.supportsVendoringByDefault(version)) {
        return;
    }
    if (GoModuleSettings.getInstance(myModule).getVendoringEnabled() != ThreeState.UNSURE) {
        return;
    }
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    boolean shownAlready;
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (propertiesComponent) {
        shownAlready = propertiesComponent.getBoolean(GO_VENDORING_NOTIFICATION_HAD_BEEN_SHOWN, false);
        if (!shownAlready) {
            propertiesComponent.setValue(GO_VENDORING_NOTIFICATION_HAD_BEEN_SHOWN, String.valueOf(true));
        }
    }
    if (!shownAlready) {
        NotificationListener.Adapter notificationListener = new NotificationListener.Adapter() {

            @Override
            protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED && "configure".equals(event.getDescription())) {
                    GoModuleSettings.showModulesConfigurable(project);
                }
            }
        };
        Notification notification = GoConstants.GO_NOTIFICATION_GROUP.createNotification("Vendoring usage is detected", "<p><strong>vendor</strong> directory usually means that project uses Go Vendor Experiment.</p>\n" + "<p>Selected Go SDK version support vendoring but it's disabled by default.</p>\n" + "<p>You may want to explicitly enabled Go Vendor Experiment in the <a href='configure'>project settings</a>.</p>", NotificationType.INFORMATION, notificationListener);
        Notifications.Bus.notify(notification, project);
    }
}
Also used : Project(com.intellij.openapi.project.Project) HyperlinkEvent(javax.swing.event.HyperlinkEvent) PropertiesComponent(com.intellij.ide.util.PropertiesComponent) NotNull(org.jetbrains.annotations.NotNull) Notification(com.intellij.notification.Notification) NotificationListener(com.intellij.notification.NotificationListener)

Example 29 with PropertiesComponent

use of com.intellij.ide.util.PropertiesComponent in project adb-idea by pbreault.

the class ModuleChooserDialogHelper method saveModuleName.

private static void saveModuleName(Project project, String moduleName) {
    final PropertiesComponent properties = PropertiesComponent.getInstance(project);
    properties.setValue(SELECTED_MODULE_PROPERTY, moduleName);
}
Also used : PropertiesComponent(com.intellij.ide.util.PropertiesComponent)

Example 30 with PropertiesComponent

use of com.intellij.ide.util.PropertiesComponent in project intellij-community by JetBrains.

the class GenerateAntBuildDialog method saveSettings.

private void saveSettings() {
    final PropertiesComponent properties = PropertiesComponent.getInstance(myProject);
    properties.setValue(SINGLE_FILE_PROPERTY, myRbGenerateSingleFileBuild.isSelected());
    properties.setValue(UI_FORM_PROPERTY, myCbEnableUIFormsCompilation.isSelected());
    properties.setValue(FORCE_TARGET_JDK_PROPERTY, myCbForceTargetJdk.isSelected());
    properties.setValue(BACKUP_FILES_PROPERTY, myRbBackupFiles.isSelected());
    properties.setValue(INLINE_RUNTIME_CLASSPATH_PROPERTY, myCbInlineRuntimeClasspath.isSelected());
    properties.setValue(GENERATE_IDEA_HOME_PROPERTY, myGenerateIdeaHomeProperty.isSelected());
    properties.setValue(OUTPUT_FILE_NAME_PROPERTY, StringUtil.nullize(getOutputFileName()));
}
Also used : PropertiesComponent(com.intellij.ide.util.PropertiesComponent)

Aggregations

PropertiesComponent (com.intellij.ide.util.PropertiesComponent)53 File (java.io.File)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 Project (com.intellij.openapi.project.Project)5 IOException (java.io.IOException)5 NotNull (org.jetbrains.annotations.NotNull)5 ArrayList (java.util.ArrayList)4 SdkPaths.validateAndroidSdk (com.android.tools.idea.sdk.SdkPaths.validateAndroidSdk)2 CommitStepException (com.intellij.ide.wizard.CommitStepException)2 Notification (com.intellij.notification.Notification)2 NotificationListener (com.intellij.notification.NotificationListener)2 TIntArrayList (gnu.trove.TIntArrayList)2 List (java.util.List)2 JDOMException (org.jdom.JDOMException)2 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)2 Nullable (org.jetbrains.annotations.Nullable)2 Variant (com.android.builder.model.Variant)1 IDevice (com.android.ddmlib.IDevice)1 GradleVersion (com.android.ide.common.repository.GradleVersion)1 IdDisplay (com.android.sdklib.repository.IdDisplay)1