Java Code Examples for consulo.ui.layout.VerticalLayout

The following examples show how to use consulo.ui.layout.VerticalLayout. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: consulo   Source File: XDebuggerGeneralConfigurable.java    License: Apache License 2.0 6 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
protected Component createLayout(PropertyBuilder propertyBuilder) {
  XDebuggerGeneralSettings settings = XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings();

  VerticalLayout layout = VerticalLayout.create();
  CheckBox focusAppOnBreakpointCheckbox = CheckBox.create(XDebuggerBundle.message("setting.focus.app.on.breakpoint.label"));
  layout.add(focusAppOnBreakpointCheckbox);
  propertyBuilder.add(focusAppOnBreakpointCheckbox, settings::isMayBringFrameToFrontOnBreakpoint, settings::setMayBringFrameToFrontOnBreakpoint);

  CheckBox showDebugWindowOnBreakpointCheckbox = CheckBox.create(XDebuggerBundle.message("settings.show.window.label"));
  layout.add(showDebugWindowOnBreakpointCheckbox);
  propertyBuilder.add(showDebugWindowOnBreakpointCheckbox, settings::isShowDebuggerOnBreakpoint, settings::setShowDebuggerOnBreakpoint);

  CheckBox hideWindowCheckBox = CheckBox.create(XDebuggerBundle.message("setting.hide.window.label"));
  layout.add(hideWindowCheckBox);
  propertyBuilder.add(hideWindowCheckBox, settings::isHideDebuggerOnProcessTermination, settings::setHideDebuggerOnProcessTermination);

  CheckBox scrollToCenterCheckbox = CheckBox.create(XDebuggerBundle.message("settings.scroll.to.center"));
  layout.add(scrollToCenterCheckbox);
  propertyBuilder.add(scrollToCenterCheckbox, settings::isScrollToCenter, settings::setScrollToCenter);
  return layout;
}
 
Example 2
Source Project: consulo   Source File: PostfixTemplatesConfigurable.java    License: Apache License 2.0 6 votes vote down vote up
@RequiredUIAccess
public Layout() {
  myLayout = VerticalLayout.create();

  myPostfixTemplatesEnabled = CheckBox.create("&Enable postfix templates");
  myLayout.add(myPostfixTemplatesEnabled);

  myCompletionEnabledCheckbox = CheckBox.create("&Show postfix templates in completion autopopup");
  myLayout.add(myCompletionEnabledCheckbox);

  ComboBox.Builder<Character> builder = ComboBox.<Character>builder();
  builder.add(TemplateSettings.SPACE_CHAR, CodeInsightBundle.message("template.shortcut.space"));
  builder.add(TemplateSettings.ENTER_CHAR, CodeInsightBundle.message("template.shortcut.enter"));
  builder.add(TemplateSettings.TAB_CHAR, CodeInsightBundle.message("template.shortcut.tab"));
  myShortcutComboBox = builder.build();

  myLayout.add(LabeledComponents.left("Expand templates with", myShortcutComboBox));

  myPostfixTemplatesEnabled.addValueListener(event -> updateComponents());
}
 
Example 3
Source Project: consulo   Source File: GeneralCodeFoldingConfigurable.java    License: Apache License 2.0 6 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
protected Component createLayout(PropertyBuilder propertyBuilder) {
  VerticalLayout verticalLayout = VerticalLayout.create();

  CodeFoldingSettings settings = CodeFoldingSettings.getInstance();

  CheckBox fileHeaderBox = CheckBox.create(ApplicationBundle.message("checkbox.collapse.file.header"));
  verticalLayout.add(fileHeaderBox);
  propertyBuilder.add(fileHeaderBox, () -> settings.COLLAPSE_FILE_HEADER, val -> settings.COLLAPSE_FILE_HEADER = val);

  CheckBox importsBox = CheckBox.create(ApplicationBundle.message("checkbox.collapse.title.imports"));
  verticalLayout.add(importsBox);
  propertyBuilder.add(importsBox, () -> settings.COLLAPSE_IMPORTS, val -> settings.COLLAPSE_IMPORTS = val);

  CheckBox docCommentsBox = CheckBox.create(ApplicationBundle.message("checkbox.collapse.javadoc.comments"));
  verticalLayout.add(docCommentsBox);
  propertyBuilder.add(docCommentsBox, () -> settings.COLLAPSE_DOC_COMMENTS, val -> settings.COLLAPSE_DOC_COMMENTS = val);

  CheckBox methodsBox = CheckBox.create(ApplicationBundle.message("checkbox.collapse.method.bodies"));
  verticalLayout.add(methodsBox);
  propertyBuilder.add(methodsBox, () -> settings.COLLAPSE_METHODS, val -> settings.COLLAPSE_METHODS = val);

  return verticalLayout;
}
 
Example 4
Source Project: consulo   Source File: WebProgressDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void show() {
  WebApplication.invokeOnCurrentSession(() -> {
    VerticalLayout verticalLayout = VerticalLayout.create();

    verticalLayout.add(myTextLabel = Label.create());
    verticalLayout.add(myProgressBar = ProgressBar.create());
    verticalLayout.add(myTextLabel2 = Label.create());

    myWindow = Window.createModal("Consulo");
    myWindow.setClosable(false);
    myWindow.setResizable(false);
    myWindow.setSize(new Size(288, 123));
    myWindow.setContent(verticalLayout);
    myWindow.show();
  });
}
 
Example 5
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example 6
@Nullable
@Override
@RequiredUIAccess
protected Component createUIComponent()
{
	LabeledLayout layout = LabeledLayout.create("Attach to");

	ValueGroup<Boolean> group = ValueGroups.boolGroup();
	VerticalLayout vertical = VerticalLayout.create();
	layout.set(vertical);

	myUnityEditorButton = RadioButton.create("Unity Editor");
	vertical.add(myUnityEditorButton);
	group.add(myUnityEditorButton);

	myProcessWithNameButton = RadioButton.create("Process");
	vertical.add(myProcessWithNameButton);
	group.add(myProcessWithNameButton);

	myNameTextField = TextBox.create();
	myNameTextField.setEnabled(false);
	vertical.add(LabeledComponents.leftFilled("Name", myNameTextField));
	myProcessWithNameButton.addValueListener(valueEvent -> myNameTextField.setEnabled(valueEvent.getValue()));

	mySelectFromDialogButton = RadioButton.create("Selected process in dialog");
	vertical.add(mySelectFromDialogButton);
	group.add(mySelectFromDialogButton);

	return layout;
}
 
Example 7
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example 8
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example 9
@RequiredUIAccess
@Nonnull
@Override
protected Component createLayout(PropertyBuilder propertyBuilder)
{
	VerticalLayout verticalLayout = VerticalLayout.create();

	CSharpCodeInsightSettings settings = CSharpCodeInsightSettings.getInstance();

	CheckBox optimizeImportOnTheFlyBox = CheckBox.create(ApplicationBundle.message("checkbox.optimize.imports.on.the.fly"));
	verticalLayout.add(optimizeImportOnTheFlyBox);
	propertyBuilder.add(optimizeImportOnTheFlyBox, () -> settings.OPTIMIZE_IMPORTS_ON_THE_FLY, value -> settings.OPTIMIZE_IMPORTS_ON_THE_FLY = value);

	return verticalLayout;
}
 
Example 10
Source Project: consulo   Source File: CompilerConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
public Root() {
  myLayout = VerticalLayout.create();

  myCompilerOptions = ComboBox.<CompilationType>builder().fillByEnum(CompilationType.class, Enum::name).build();
  Component compilerOptions = LabeledComponents.left("Compilation type:", myCompilerOptions);
  myLayout.add(compilerOptions);
  compilerOptions.setVisible(false);

  myCbClearOutputDirectory = CheckBox.create(CompilerBundle.message("label.option.clear.output.directory.on.rebuild"));
  myLayout.add(myCbClearOutputDirectory);

  myCbAutoShowFirstError = CheckBox.create(CompilerBundle.message("label.option.autoshow.first.error"));
  myLayout.add(myCbAutoShowFirstError);
}
 
Example 11
Source Project: consulo   Source File: WebServicesConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
protected Component createLayout(PropertyBuilder propertyBuilder) {
  UpdateSettings updateSettings = UpdateSettings.getInstance();

  VerticalLayout layout = VerticalLayout.create();

  VerticalLayout repoLayout = VerticalLayout.create();
  layout.add(LabeledLayout.create("Repository settings", repoLayout));

  CheckBox enableUpdates = CheckBox.create("Enabled updates?");
  propertyBuilder.add(enableUpdates, updateSettings::isEnable, updateSettings::setEnable);

  ComboBox<UpdateChannel> channelComboBox = ComboBox.<UpdateChannel>builder().fillByEnum(UpdateChannel.class, Object::toString).build();
  channelComboBox.setEnabled(updateSettings.isEnable()); // set default state
  propertyBuilder.add(channelComboBox, updateSettings::getChannel, updateSettings::setChannel);
  enableUpdates.addValueListener(event -> channelComboBox.setEnabled(event.getValue()));

  repoLayout.add(HorizontalLayout.create().add(enableUpdates));
  repoLayout.add(LabeledComponents.left("Channel", channelComboBox));

  WebServicesConfiguration webServicesConfiguration = WebServicesConfiguration.getInstance();
  for (WebServiceApi api : WebServiceApi.values()) {
    String description = api.getDescription();
    if (description == null) {
      continue;
    }

    TextBox textBox = TextBox.create();

    layout.add(LabeledLayout.create(description, LabeledComponents.leftFilled("OAuth Key", textBox)));
    propertyBuilder.add(textBox, () -> webServicesConfiguration.getOAuthKey(api), text -> webServicesConfiguration.setOAuthKey(api, text));
  }
  return layout;
}
 
Example 12
Source Project: consulo   Source File: MergedCompositeConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createUIComponent() {
  if (myRootComponent == null) {
    Configurable firstConfigurable = children[0];
    if (children.length == 1) {
      myRootComponent = firstConfigurable.createUIComponent();
    }
    else {
      VerticalLayout verticalLayout = VerticalLayout.create();
      for (Configurable configurable : children) {
        Component uiComponent = configurable.createUIComponent();
        if (uiComponent == null) {
          continue;
        }

        String displayName = configurable.getDisplayName();
        if (StringUtil.isEmpty(displayName)) {
          verticalLayout.add(uiComponent);
        }
        else {
          LabeledLayout labeledLayout = LabeledLayout.create(displayName);
          labeledLayout.set(uiComponent);
          verticalLayout.add(labeledLayout);
        }
      }
      myRootComponent = verticalLayout;
    }
  }
  return myRootComponent;
}
 
Example 13
Source Project: consulo   Source File: CodeFoldingConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
protected Component createLayout(PropertyBuilder propertyBuilder) {
  VerticalLayout verticalLayout = VerticalLayout.create();

  CheckBox outlineBox = CheckBox.create(ApplicationBundle.message("checkbox.show.code.folding.outline"));
  verticalLayout.add(outlineBox);
  EditorSettingsExternalizable externalizable = EditorSettingsExternalizable.getInstance();
  propertyBuilder.add(outlineBox, externalizable::isFoldingOutlineShown, externalizable::setFoldingOutlineShown);
  return verticalLayout;
}
 
Example 14
Source Project: consulo   Source File: EditorSmartKeysConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
public Panel() {
  myWholeLayout = VerticalLayout.create();
  myWholeLayout.add(myCbSmartHome = CheckBox.create(ApplicationBundle.message("checkbox.smart.home")));
  myWholeLayout.add(myCbSmartEnd = CheckBox.create(ApplicationBundle.message("checkbox.smart.end.on.blank.line")));
  myWholeLayout.add(myCbInsertPairBracket = CheckBox.create(ApplicationBundle.message("checkbox.insert.pair.bracket")));
  myWholeLayout.add(myCbInsertPairQuote = CheckBox.create(ApplicationBundle.message("checkbox.insert.pair.quote")));
  myWholeLayout.add(myCbReformatBlockOnTypingRBrace = CheckBox.create(ApplicationBundle.message("checkbox.reformat.on.typing.rbrace")));
  myWholeLayout.add(myCbCamelWords = CheckBox.create(ApplicationBundle.message("checkbox.use.camelhumps.words")));
  myWholeLayout.add(myCbSurroundSelectionOnTyping = CheckBox.create(ApplicationBundle.message("checkbox.surround.selection.on.typing.quote.or.brace")));
  myWholeLayout.add(mySmartIndentPastedLinesCheckBox = CheckBox.create(ApplicationBundle.message("checkbox.indent.on.paste")));

  ComboBox.Builder<Integer> reformatOnPasteBuilder = ComboBox.builder();
  reformatOnPasteBuilder.add(CodeInsightSettings.NO_REFORMAT, ApplicationBundle.message("combobox.paste.reformat.none"));
  reformatOnPasteBuilder.add(CodeInsightSettings.INDENT_BLOCK, ApplicationBundle.message("combobox.paste.reformat.indent.block"));
  reformatOnPasteBuilder.add(CodeInsightSettings.INDENT_EACH_LINE, ApplicationBundle.message("combobox.paste.reformat.indent.each.line"));
  reformatOnPasteBuilder.add(CodeInsightSettings.REFORMAT_BLOCK, ApplicationBundle.message("combobox.paste.reformat.reformat.block"));

  myWholeLayout.add(LabeledComponents.left(ApplicationBundle.message("combobox.paste.reformat"), myReformatOnPasteCombo = reformatOnPasteBuilder.build()));

  VerticalLayout enterLayout = VerticalLayout.create();
  myWholeLayout.add(LabeledLayout.create("Enter", enterLayout));

  enterLayout.add(myCbSmartIndentOnEnter = CheckBox.create(ApplicationBundle.message("checkbox.smart.indent")));
  enterLayout.add(myCbInsertPairCurlyBraceOnEnter = CheckBox.create(ApplicationBundle.message("checkbox.insert.pair.curly.brace")));
  enterLayout.add(myCbInsertJavadocStubOnEnter = CheckBox.create(ApplicationBundle.message("checkbox.javadoc.stub.after.slash.star.star")));
  myCbInsertJavadocStubOnEnter.setVisible(hasAnyDocAwareCommenters());

  VerticalLayout backspaceLayout = VerticalLayout.create();
  myWholeLayout.add(LabeledLayout.create("Backspace", backspaceLayout));

  ComboBox.Builder<SmartBackspaceMode> smartIndentBuilder = ComboBox.builder();
  smartIndentBuilder.add(SmartBackspaceMode.OFF, ApplicationBundle.message("combobox.smart.backspace.off"));
  smartIndentBuilder.add(SmartBackspaceMode.INDENT, ApplicationBundle.message("combobox.smart.backspace.simple"));
  smartIndentBuilder.add(SmartBackspaceMode.AUTOINDENT, ApplicationBundle.message("combobox.smart.backspace.smart"));
  backspaceLayout.add(LabeledComponents.left(ApplicationBundle.message("combobox.smart.backspace"), myCbIndentingBackspace = smartIndentBuilder.build()));
}
 
Example 15
Source Project: consulo   Source File: WebVerticalLayoutImpl.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
public VerticalLayout add(@Nonnull consulo.ui.Component component) {
  getVaadinComponent().add(TargetVaddin.to(component));
  return this;
}
 
Example 16
Source Project: consulo   Source File: DesktopVerticalLayoutImpl.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nonnull
@Override
public VerticalLayout add(@Nonnull Component component) {
  add(component, null);
  return this;
}
 
Example 17
Source Project: consulo   Source File: Sand2MutableModuleExtension.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable uiDisposable, @Nonnull Runnable updateOnCheck) {
  final VerticalLayout vertical = VerticalLayout.create();
  vertical.add(CheckBox.create(LocalizeValue.of("Check Me (New UI)")));
  return vertical;
}
 
Example 18
Source Project: consulo   Source File: SandMutableModuleExtension.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable uiDisposable, @Nonnull Runnable updateOnCheck) {
  VerticalLayout panel = VerticalLayout.create();
  panel.add(ModuleExtensionBundleBoxBuilder.createAndDefine(this, uiDisposable, updateOnCheck).uiDisposable(uiDisposable).build());
  return panel;
}
 
Example 19
@Nullable
@Override
protected Component createUIComponent()
{
	return VerticalLayout.create();
}
 
Example 20
Source Project: consulo   Source File: UnifiedActionToolbarImpl.java    License: Apache License 2.0 4 votes vote down vote up
private void rebuildUI() {
  myComponent = myOrientation == HORIZONTAL_ORIENTATION ? HorizontalLayout.create() : VerticalLayout.create();
}
 
Example 21
Source Project: consulo   Source File: GeneralSettingsConfigurable.java    License: Apache License 2.0 4 votes vote down vote up
@RequiredUIAccess
public MyComponent() {
  myRootLayout = VerticalLayout.create();

  VerticalLayout startupOrShutdownLayout = VerticalLayout.create();
  startupOrShutdownLayout.add(myChkReopenLastProject = CheckBox.create(IdeLocalize.checkboxReopenLastProjectOnStartup()));
  startupOrShutdownLayout.add(myConfirmExit = CheckBox.create(IdeLocalize.checkboxConfirmApplicationExit()));
  myRootLayout.add(LabeledLayout.create("Startup/Shutdown", startupOrShutdownLayout));

  VerticalLayout projectReopeningLayout = VerticalLayout.create();
  ValueGroup<Boolean> projectOpenGroup = ValueGroup.createBool();
  projectReopeningLayout.add(myOpenProjectInNewWindow = RadioButton.create("Open project in new window").toGroup(projectOpenGroup));
  projectReopeningLayout.add(myOpenProjectInSameWindow = RadioButton.create("Open project in the same window").toGroup(projectOpenGroup));
  projectReopeningLayout.add(myConfirmWindowToOpenProject = RadioButton.create("Confirm window to open project in").toGroup(projectOpenGroup));
  myRootLayout.add(LabeledLayout.create("Project Opening", projectReopeningLayout));

  VerticalLayout syncLayout = VerticalLayout.create();
  syncLayout.add(myChkSyncOnFrameActivation = CheckBox.create(IdeLocalize.checkboxSynchronizeFilesOnFrameActivation()));
  syncLayout.add(myChkSaveOnFrameDeactivation = CheckBox.create(IdeBundle.message("checkbox.save.files.on.frame.deactivation")));

  HorizontalLayout syncWithIde = HorizontalLayout.create();
  syncLayout.add(syncWithIde);
  syncWithIde.add(myChkAutoSaveIfInactive = CheckBox.create(IdeLocalize.checkboxSaveFilesAutomatically()));
  syncWithIde.add(myTfInactiveTimeout = TextBox.create());
  myTfInactiveTimeout.setEnabled(false);
  syncWithIde.add(Label.create(IdeBundle.message("label.inactive.timeout.sec")));
  myChkAutoSaveIfInactive.addValueListener(event -> myTfInactiveTimeout.setEnabled(event.getValue()));

  syncLayout.add(myChkUseSafeWrite = CheckBox.create("Use \"safe write\" (save changes to a temporary file first)"));
  myRootLayout.add(LabeledLayout.create("Synchronization", syncLayout));

  VerticalLayout screenLayout = VerticalLayout.create();
  screenLayout.add(myChkSupportScreenReaders = CheckBox.create(IdeLocalize.checkboxSupportScreenReaders()));
  myRootLayout.add(LabeledLayout.create("Accessibility", screenLayout));

  VerticalLayout localizeLayout = VerticalLayout.create();
  Set<Locale> avaliableLocales = LocalizeManager.getInstance().getAvaliableLocales();
  ComboBox.Builder<Locale> builder = ComboBox.builder();
  builder.add(avaliableLocales, Locale::getDisplayName);

  localizeLayout.add(LabeledComponents.leftWithRight("Locale", myLocaleBox = builder.build()));
  myRootLayout.add(LabeledLayout.create("Localization", localizeLayout));

  VerticalLayout processLayout = VerticalLayout.create();
  ValueGroup<Boolean> processGroup = ValueGroup.createBool();
  processLayout.add(myTerminateProcessRadioButton = RadioButton.create(IdeBundle.message("radio.process.close.terminate")).toGroup(processGroup));
  processLayout.add(myDisconnectRadioButton = RadioButton.create(IdeBundle.message("radio.process.close.disconnect")).toGroup(processGroup));
  processLayout.add(myAskRadioButton = RadioButton.create(IdeBundle.message("radio.process.close.ask")).toGroup(processGroup));

  myRootLayout.add(LabeledLayout.create(IdeBundle.message("group.settings.process.tab.close"), processLayout));

  VerticalLayout fileDialogsLayout = VerticalLayout.create();

  ComboBox.Builder<FileOperateDialogProvider> fileChooseDialogBox = ComboBox.<FileOperateDialogProvider>builder();
  for (FileChooseDialogProvider fileChooseDialogProvider : FileChooseDialogProvider.EP_NAME.getExtensionList()) {
    if (fileChooseDialogProvider.isAvaliable()) {
      fileChooseDialogBox.add(fileChooseDialogProvider, fileChooseDialogProvider.getName());
    }
  }

  fileDialogsLayout.add(LabeledComponents.leftWithRight("File/Path Choose Dialog Type", myFileChooseDialogBox = fileChooseDialogBox.build()));

  ComboBox.Builder<FileOperateDialogProvider> fileSaveDialogBox = ComboBox.<FileOperateDialogProvider>builder();
  for (FileSaveDialogProvider fileSaveDialogProvider : FileSaveDialogProvider.EP_NAME.getExtensionList()) {
    if (fileSaveDialogProvider.isAvaliable()) {
      fileSaveDialogBox.add(fileSaveDialogProvider, fileSaveDialogProvider.getName());
    }
  }

  fileDialogsLayout.add(LabeledComponents.leftWithRight("File Save Dialog Type", myFileSaveDialogBox = fileSaveDialogBox.build()));

  myRootLayout.add(LabeledLayout.create("File Dialogs", fileDialogsLayout));

  VerticalLayout webSearchOptionsLayout = VerticalLayout.create();
  ComboBox.Builder<WebSearchEngine> webSearchEngineBuilder = ComboBox.<WebSearchEngine>builder().fillByEnum(WebSearchEngine.class, WebSearchEngine::getPresentableName);
  webSearchOptionsLayout.add(LabeledComponents.leftWithRight("Engine", myWebSearchEngineComboBox = webSearchEngineBuilder.build()));

  myRootLayout.add(LabeledLayout.create(IdeLocalize.webSearchLabelLayout(), webSearchOptionsLayout));
}