Example usage for org.eclipse.jdt.internal.core SourceType getElementName

List of usage examples for org.eclipse.jdt.internal.core SourceType getElementName

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core SourceType getElementName.

Prototype

@Override
    public String getElementName() 

Source Link

Usage

From source file:hydrograph.ui.expression.editor.datastructure.ClassDetails.java

License:Apache License

private void intialize(SourceType javaClassFile, String jarFileName, String packageName,
        boolean isUserDefined) {
    this.cName = javaClassFile.getElementName();
    displayName = cName;/*w  ww .j a  va  2 s.com*/
    if (StringUtils.isNotBlank(jarFileName)) {
        jarName = jarFileName;
    }
    if (StringUtils.isNotBlank(packageName)) {
        this.packageName = packageName;
    }
    if (StringUtils.isBlank(javaDoc)) {
        javaDoc = Constants.EMPTY_STRING;
    }
    if (isUserDefined) {
        isUserDefined = true;
        displayName = cName + Constants.SRC_CLASS_SUFFIX;
        updateJavaDocForSorceClass(jarFileName, packageName);
    }
}

From source file:org.eclipse.ajdt.core.javaelements.ITDAwareSourceTypeInfo.java

License:Open Source License

private SourceType createITDAwareType(SourceType type, ITDAwareSourceTypeInfo info) {
    if (type instanceof AspectElement) {
        return new ITDAwareAspectType((JavaElement) type.getParent(), type.getElementName(), info);
    } else {/*from w w  w  .  j  a  v a  2s.  co m*/
        return new ITDAwareSourceType((JavaElement) type.getParent(), type.getElementName(), info);
    }
}

From source file:org.polarsys.reqcycle.jdt.traceability.preferences.NewAnnotDialog.java

License:Open Source License

/**
 * Create contents of the dialog./*  ww w . j a  v a2  s .com*/
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    setTitleImage(ResourceManager.getPluginImage("org.polarsys.reqcycle.jdt.traceability", "icons/annot.gif"));
    setTitle("Register new Annotation");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(3, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label lblAnnotationName = new Label(container, SWT.NONE);
    lblAnnotationName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblAnnotationName.setText("Annotation Name : ");

    text = new Text(container, SWT.BORDER);
    text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    text.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            annotName = text.getText();
        }
    });

    Button button = new Button(container, SWT.NONE);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            OpenTypeSelectionDialog d = new OpenTypeSelectionDialog(getShell(), false,
                    PlatformUI.getWorkbench().getProgressService(), SearchEngine.createWorkspaceScope(),
                    IJavaSearchConstants.ANNOTATION_TYPE);
            if (d.open() == OpenTypeSelectionDialog.OK) {
                SourceType type = (SourceType) d.getFirstResult();
                text.setText(type.getElementName());
            }
        }
    });
    button.setText("...");

    Label lblKind = new Label(container, SWT.NONE);
    lblKind.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblKind.setText("Kind : ");

    comboViewer = new ComboViewer(container, SWT.None);
    Combo combo = comboViewer.getCombo();
    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    comboViewer.setContentProvider(new ArrayContentProvider());
    comboViewer.setLabelProvider(new LabelProvider());
    input.addAll(JDTPreferences.getPreferences().keySet());
    comboViewer.setInput(input);
    comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            link = new JDTType(comboViewer.getCCombo().getText());
        }
    });
    return area;
}