congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Composite.getMenu
Code IndexAdd Tabnine 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)

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

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now