Codota Logo
Composite.getMenu
Code IndexAdd Codota to your IDE (free)

How to use
getMenu
method
in
org.eclipse.swt.widgets.Composite

Best Java code snippets using org.eclipse.swt.widgets.Composite.getMenu (Showing top 20 results out of 315)

  • Common ways to obtain Composite
private void myMethod () {
Composite c =
  • Codota IconControl control;control.getParent()
  • Codota IconStatusDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Codota IconTitleAreaDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Smart code suggestions by Codota
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

public LayoutComposite(Composite parent, int style) {
  super(parent, style);
  setMenu(parent.getMenu());
}
@Override
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates the form content control as a child of the provided parent.
 *
 * @param parent
 *            the parent widget
 */
public Form(Composite parent, int style) {
  super(parent, SWT.NO_BACKGROUND | style);
  super.setLayout(new FormLayout());
  head = new FormHeading(this, SWT.NULL);
  head.setMenu(parent.getMenu());
  body = new Composite(this, SWT.NULL);
  body.setMenu(parent.getMenu());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates the form content control as a child of the provided parent.
 *
 * @param parent
 *            the parent widget
 */
public Form(Composite parent, int style) {
  super(parent, SWT.NO_BACKGROUND | style);
  super.setLayout(new FormLayout());
  head = new FormHeading(this, SWT.NULL);
  head.setMenu(parent.getMenu());
  body = new LayoutComposite(this, SWT.NULL);
  body.setMenu(parent.getMenu());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates a scrolled page book widget as a part of the form.
 *
 * @param parent
 *            the page book parent
 * @param style
 *            the text style
 * @return the scrolled page book widget
 */
public ScrolledPageBook createPageBook(Composite parent, int style) {
  ScrolledPageBook book = new ScrolledPageBook(parent, style
      | orientation);
  adapt(book, true, true);
  book.setMenu(parent.getMenu());
  return book;
}
origin: org.eclipse.rap/org.eclipse.rap.jface

  public void handleEvent(Event innerEvent) {
    ToolBar innerToolBar = toolBarManager.getControl();
    if (innerToolBar != null) {
      innerToolBar.setMenu(null);
      Menu innerParentMenu = innerToolBar.getParent()
          .getMenu();
      if (innerParentMenu != null) {
        innerParentMenu.removeListener(SWT.Hide, this);
      }
    }
  }
});
origin: org.eclipse.platform/org.eclipse.jface

  @Override
  public void handleEvent(Event innerEvent) {
    ToolBar innerToolBar = toolBarManager.getControl();
    if (innerToolBar != null) {
      innerToolBar.setMenu(null);
      Menu innerParentMenu = innerToolBar.getParent()
          .getMenu();
      if (innerParentMenu != null) {
        innerParentMenu.removeListener(SWT.Hide, this);
      }
    }
  }
});
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

  @Override
  public void handleEvent(Event innerEvent) {
    ToolBar innerToolBar = toolBarManager.getControl();
    if (innerToolBar != null) {
      innerToolBar.setMenu(null);
      Menu innerParentMenu = innerToolBar.getParent()
          .getMenu();
      if (innerParentMenu != null) {
        innerParentMenu.removeListener(SWT.Hide, this);
      }
    }
  }
});
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates a scrolled page book widget as a part of the form.
 *
 * @param parent
 *            the page book parent
 * @param style
 *            the text style
 * @return the scrolled page book widget
 */
public ScrolledPageBook createPageBook(Composite parent, int style) {
  checkDisposed();
  ScrolledPageBook book = new ScrolledPageBook(parent, style
      | orientation);
  adapt(book, true, true);
  book.setMenu(parent.getMenu());
  return book;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates a rich text as a part of the form.
 *
 * @param parent
 *            the rich text parent
 * @param trackFocus
 *            if <code>true</code>, the toolkit will monitor focus
 *            transfers to ensure that the hyperlink in focus is visible in
 *            the form.
 * @return the rich text widget
 */
public FormText createFormText(Composite parent, boolean trackFocus) {
  FormText engine = new FormText(parent, SWT.WRAP | orientation);
  engine.marginWidth = 1;
  engine.marginHeight = 0;
  engine.setHyperlinkSettings(getHyperlinkGroup());
  adapt(engine, trackFocus, true);
  engine.setMenu(parent.getMenu());
  return engine;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates an expandable composite as a part of the form.
 *
 * @param parent
 *            the expandable composite parent
 * @param expansionStyle
 *            the expandable composite style
 * @return the expandable composite widget
 */
public ExpandableComposite createExpandableComposite(Composite parent,
    int expansionStyle) {
  ExpandableComposite ec = new ExpandableComposite(parent, orientation,
      expansionStyle);
  ec.setMenu(parent.getMenu());
  adapt(ec, true, true);
  ec.setFont(boldFontHolder.getBoldFont(ec.getFont()));
  return ec;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Adapts a composite to be used in a form associated with this toolkit.
 *
 * @param composite
 *            the composite to adapt
 */
public void adapt(Composite composite) {
  composite.setBackground(colors.getBackground());
  composite.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      ((Control) e.widget).setFocus();
    }
  });
  if (composite.getParent() != null)
    composite.setMenu(composite.getParent().getMenu());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates the form control as a child of the provided parent.
 *
 * @param parent
 *            the parent widget
 */
public ScrolledForm(Composite parent, int style) {
  super(parent, style);
  super.setMenu(parent.getMenu());
  content = new Form(this, SWT.NULL);
  super.setContent(content);
  content.setMenu(getMenu());
  addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent e) {
      if (!customMenu)
        setMenu(null);
    }
  });
}
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates a rich text as a part of the form.
 *
 * @param parent
 *            the rich text parent
 * @param trackFocus
 *            if <code>true</code>, the toolkit will monitor focus
 *            transfers to ensure that the hyperlink in focus is visible in
 *            the form.
 * @return the rich text widget
 */
public FormText createFormText(Composite parent, boolean trackFocus) {
  checkDisposed();
  FormText engine = new FormText(parent, SWT.WRAP | orientation);
  engine.marginWidth = 1;
  engine.marginHeight = 0;
  engine.setHyperlinkSettings(getHyperlinkGroup());
  adapt(engine, trackFocus, true);
  engine.setMenu(parent.getMenu());
  return engine;
}
origin: BiglySoftware/BiglyBT

@Override
public void tableViewTabInitComplete() {
  if (COConfigurationManager.getBooleanParameter("Library.showFancyMenu")) {
   Composite tableComposite = tv.getComposite();
   oldMenu = tableComposite.getMenu();
   Menu menu = new Menu(tableComposite);
   tableComposite.setMenu(menu);
   menu.addMenuListener(new MenuListener() {
      @Override
      public void menuShown(MenuEvent e) {
        if (!showMyOwnMenu(e)) {
          oldMenu.setVisible(true);
        }
      }
      @Override
      public void menuHidden(MenuEvent e) {
      }
    });
  }
  super.tableViewTabInitComplete();
}
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates the form control as a child of the provided parent.
 *
 * @param parent
 *            the parent widget
 */
public ScrolledForm(Composite parent, int style) {
  super(parent, style);
  super.setMenu(parent.getMenu());
  content = new Form(this, SWT.NULL);
  super.setContent(content);
  content.setMenu(getMenu());
  addDisposeListener(e -> {
    if (!customMenu)
      setMenu(null);
  });
}
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates an expandable composite as a part of the form.
 *
 * @param parent
 *            the expandable composite parent
 * @param expansionStyle
 *            the expandable composite style
 * @return the expandable composite widget
 */
public ExpandableComposite createExpandableComposite(Composite parent,
    int expansionStyle) {
  checkDisposed();
  ExpandableComposite ec = new ExpandableComposite(parent, orientation,
      expansionStyle);
  ec.setMenu(parent.getMenu());
  adapt(ec, true, true);
  ec.setFont(boldFontHolder.getBoldFont(ec.getFont()));
  return ec;
}
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Adapts a composite to be used in a form associated with this toolkit.
 *
 * @param composite
 *            the composite to adapt
 */
public void adapt(Composite composite) {
  checkDisposed();
  if (colors.getBackground() != null) {
    composite.setBackground(colors.getBackground());
  }
  composite.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      ((Control) e.widget).setFocus();
    }
  });
  if (composite.getParent() != null)
    composite.setMenu(composite.getParent().getMenu());
}
origin: org.eclipse/org.eclipse.help.ui

private EngineDescriptor loadEngine(final EngineDescriptor edesc, Composite container, FormToolkit toolkit) {
  Label ilabel = toolkit.createLabel(container, null);
  ilabel.setImage(edesc.getIconImage());
  ilabel.setData(edesc);
  final Button master = toolkit.createButton(container, edesc.getLabel(), SWT.CHECK);
  master.setData(edesc);
  master.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      scopeSetManager.getActiveSet().setEngineEnabled(edesc, master.getSelection());
    }
  });
  String desc = edesc.getDescription();
  if (desc != null) {
    Label spacer = toolkit.createLabel(container, null);
    spacer.setData(edesc);
    Label dlabel = toolkit.createLabel(container, desc, SWT.WRAP);
    dlabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    dlabel.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    dlabel.setMenu(container.getMenu());
    dlabel.setData(edesc);
  }
  return edesc;
}
origin: org.eclipse.platform/org.eclipse.ui.forms

/**
 * Creates the content of the master/details block inside the parent composite.
 * This method should be called as late as possible inside the parent part.
 *
 * @param managedForm
 *            the managed form to create the block in
 * @since 3.4
 */
public void createContent(IManagedForm managedForm, Composite parent) {
  final ScrolledForm form = managedForm.getForm();
  FormToolkit toolkit = managedForm.getToolkit();
  applyLayout(parent);
  sashForm = new MDSashForm(parent, SWT.NULL);
  sashForm.setData("form", managedForm); //$NON-NLS-1$
  toolkit.adapt(sashForm, false, false);
  sashForm.setMenu(parent.getMenu());
  applyLayoutData(sashForm);
  createMasterPart(managedForm, sashForm);
  createDetailsPart(managedForm, sashForm);
  hookResizeListener();
  createToolBarActions(managedForm);
  form.updateToolBar();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

/**
 * Creates the content of the master/details block inside the parent composite.
 * This method should be called as late as possible inside the parent part.
 *
 * @param managedForm
 *            the managed form to create the block in
 * @since 3.4
 */
public void createContent(IManagedForm managedForm, Composite parent) {
  final ScrolledForm form = managedForm.getForm();
  FormToolkit toolkit = managedForm.getToolkit();
  applyLayout(parent);
  sashForm = new MDSashForm(parent, SWT.NULL);
  sashForm.setData("form", managedForm); //$NON-NLS-1$
  toolkit.adapt(sashForm, false, false);
  sashForm.setMenu(parent.getMenu());
  applyLayoutData(sashForm);
  createMasterPart(managedForm, sashForm);
  createDetailsPart(managedForm, sashForm);
  hookResizeListener();
  createToolBarActions(managedForm);
  form.updateToolBar();
}
org.eclipse.swt.widgetsCompositegetMenu

Popular methods of Composite

  • setLayout
    Sets the layout which is associated with the receiver to be the argument which may be null.
  • <init>
    Constructs a new instance of this class given its parent and a style value describing its behavior a
  • setLayoutData
  • layout
    Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarc
  • getDisplay
  • getChildren
    Returns a (possibly empty) array containing the receiver's children. Children are returned in the or
  • getShell
  • getFont
  • getLayout
    Returns layout which is associated with the receiver, or null if one has not been set.
  • setFont
  • getParent
  • computeSize
  • getParent,
  • computeSize,
  • dispose,
  • setBackground,
  • getClientArea,
  • isDisposed,
  • getBackground,
  • setVisible,
  • setSize,
  • setData

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now