consulo.ui.Label Java Examples

The following examples show how to use consulo.ui.Label. 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 File: DesktopLabelImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Label setHorizontalAlignment(@Nonnull HorizontalAlignment horizontalAlignment) {
  myHorizontalAlignment = horizontalAlignment;
  switch (horizontalAlignment) {
    case LEFT:
      myComponent.setHorizontalAlignment(SwingConstants.LEFT);
      break;
    case CENTER:
      myComponent.setHorizontalAlignment(SwingConstants.CENTER);
      break;
    case RIGHT:
      myComponent.setHorizontalAlignment(SwingConstants.RIGHT);
      break;
  }
  return this;
}
 
Example #2
Source File: WebProgressDialog.java    From consulo with 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 #3
Source File: MicrosoftCSharpMutableModuleExtension.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example #4
Source File: SandServerType.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public UnnamedConfigurable createConfigurable(@Nonnull SandServerConfiguration configuration) {
  return new UnnamedConfigurable() {
    @RequiredUIAccess
    @Override
    public boolean isModified() {
      return false;
    }

    @RequiredUIAccess
    @Nullable
    @Override
    public Component createUIComponent() {
      return Label.create("Sand stub UI");
    }

    @RequiredUIAccess
    @Override
    public void apply() throws ConfigurationException {

    }

    @RequiredUIAccess
    @Override
    public void reset() {

    }
  };
}
 
Example #5
Source File: DesktopLabelImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public Label setForeground(@Nonnull Supplier<ColorValue> colorValueSupplier) {
  myForegroundSupplier = colorValueSupplier;

  myComponent.setForeground(TargetAWT.to(myForegroundSupplier.get()));
  return this;
}
 
Example #6
Source File: DesktopLabelImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
@RequiredUIAccess
@Override
public Label setText(@Nonnull String text) {
  myComponent.setText(text);
  return this;
}
 
Example #7
Source File: WebToolWindowManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@Nonnull
@RequiredUIAccess
protected Component createInitializingLabel() {
  Label label = Label.create("Initializing...");
  DockLayout dock = DockLayout.create();
  dock.center(label);
  return label;
}
 
Example #8
Source File: WebLabelBase.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
@RequiredUIAccess
@Override
public Label setText(@Nonnull String text) {
  getVaadinComponent().setCaption(text);
  return this;
}
 
Example #9
Source File: IdeNotificationArea.java    From consulo with Apache License 2.0 5 votes vote down vote up
public IdeNotificationArea() {
  myLabel = Label.create();

  new ClickListener() {
    @Override
    public boolean onClick(@Nonnull MouseEvent e, int clickCount) {
      EventLog.toggleLog(getProject(), null);
      return true;
    }
  }.installOn(TargetAWT.to(myLabel));

  MessageBusConnection connection = Application.get().getMessageBus().connect(this);
  connection.subscribe(UISettingsListener.TOPIC, source -> updateStatus());
  connection.subscribe(LogModel.LOG_MODEL_CHANGED, () -> Application.get().invokeLater(IdeNotificationArea.this::updateStatus));
}
 
Example #10
Source File: Unity3dRootMutableModuleExtension.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example #11
Source File: MonoCSharpMutableModuleExtension.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Nullable
@Override
public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
{
	return VerticalLayout.create().add(Label.create("Unsupported UI"));
}
 
Example #12
Source File: FormBuilder.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
@RequiredUIAccess
public FormBuilder addLabeled(@Nonnull final String labelText, @Nonnull Component component) {
  String newLabelText = labelText;
  if (!StringUtil.endsWithChar(newLabelText, ':')) {
    newLabelText += ": ";
  }

  myLayout.add(Label.create(newLabelText), TableLayout.cell(myLineCount, 0));
  myLayout.add(component, TableLayout.cell(myLineCount, 1).fill());

  myLineCount++;
  return this;
}
 
Example #13
Source File: LabeledComponents.java    From consulo with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
public static Component left(@Nonnull String text, @Nonnull PseudoComponent component) {
  if (!StringUtil.endsWithChar(text, ':')) {
    text += ": ";
  }

  HorizontalLayout horizontal = HorizontalLayout.create(5);
  horizontal.add(Label.create(text));
  horizontal.add(component);
  return horizontal;
}
 
Example #14
Source File: LabeledComponents.java    From consulo with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
public static Component leftFilled(@Nonnull String text, @Nonnull PseudoComponent component) {
  if (!StringUtil.endsWithChar(text, ':')) {
    text += ": ";
  }

  DockLayout dock = DockLayout.create();
  dock.left(Label.create(text));
  dock.center(component);
  return dock;
}
 
Example #15
Source File: LabeledComponents.java    From consulo with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
public static Component leftWithRight(@Nonnull String text, @Nonnull PseudoComponent component) {
  DockLayout dock = DockLayout.create();
  dock.left(Label.create(text));
  dock.right(component);
  return dock;
}
 
Example #16
Source File: VaadinWebSessionImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void close() {
  myAccess.give(() -> {
    Window window = Window.createModal("Consulo");
    window.setContent(Label.create("Session Closed"));
    window.setResizable(false);
    window.setClosable(false);

    window.show();

    ((WebUIAccessImpl)myAccess).getUI().close();
  });
}
 
Example #17
Source File: WebLabelBase.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setImage(@Nullable Image icon) {
  return this;
}
 
Example #18
Source File: DesktopLabelImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setImage(@Nullable Image icon) {
  myComponent.setIcon(TargetAWT.to(icon));
  return this;
}
 
Example #19
Source File: WebLabelBase.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setForeground(@Nonnull Supplier<ColorValue> colorValueSupplier) {
  return this;
}
 
Example #20
Source File: DesktopLabelImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setToolTipText(@Nullable String text) {
  myComponent.setToolTipText(text);
  return this;
}
 
Example #21
Source File: WebLabelBase.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setHorizontalAlignment(@Nonnull HorizontalAlignment horizontalAlignment) {
  getVaadinComponent().setHorizontalAlignment(horizontalAlignment);
  return this;
}
 
Example #22
Source File: WebLabelBase.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Label setToolTipText(@Nullable String text) {
  return this;
}
 
Example #23
Source File: DesktopUIInternalImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public Label _Components_label(String text) {
  return new DesktopLabelImpl(text);
}
 
Example #24
Source File: SandFileEditor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Component getUIComponent() {
  return Label.create("Hello World");
}
 
Example #25
Source File: UITester.java    From consulo with Apache License 2.0 3 votes vote down vote up
@RequiredUIAccess
private Component layouts() {
  TabbedLayout tabbedLayout = TabbedLayout.create();

  VerticalLayout fold = VerticalLayout.create();
  fold.add(Label.create("Some label"));
  fold.add(Button.create("Some Button", () -> Alerts.okError("Clicked!").showAsync()));

  FoldoutLayout layout = FoldoutLayout.create(LocalizeValue.of("Show Me"), fold);
  layout.addStateListener(state -> Alerts.okInfo("State " + state).showAsync());

  tabbedLayout.addTab("FoldoutLayout", layout);

  TwoComponentSplitLayout splitLayout = TwoComponentSplitLayout.create(SplitLayoutPosition.HORIZONTAL);
  splitLayout.setFirstComponent(DockLayout.create().center(Button.create("Left")));
  splitLayout.setSecondComponent(DockLayout.create().center(Button.create("Second")));

  tabbedLayout.addTab("SplitLayout", splitLayout);

  SwipeLayout swipeLayout = SwipeLayout.create();

  swipeLayout.register("left", () -> swipeChildLayout("Right", () -> swipeLayout.swipeRightTo("right")));
  swipeLayout.register("right", () -> swipeChildLayout("Left", () -> swipeLayout.swipeLeftTo("left")));

  tabbedLayout.addTab("SwipeLayout", swipeLayout);

  return tabbedLayout;
}