@Override public void createPageContent(Composite parent) { mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); stackLayout = new StackLayout(); mainComposite.setLayout(stackLayout); noFeatureLabel = new Label(mainComposite, SWT.NONE); noFeatureLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); noFeatureLabel.setText(Messages.SimplePointEditorPage_0); StyleLayer layer = getSelectedLayer(); IGeoResource resource = layer.getGeoResource(); if (resource.canResolve(FeatureSource.class)) { StyleBlackboard styleBlackboard = layer.getStyleBlackboard(); oldStyle = (Style) styleBlackboard.get(SLDContent.ID); if (oldStyle == null) { oldStyle = Utilities.createDefaultPointStyle(); } DuplicatingStyleVisitor dsv = new DuplicatingStyleVisitor(); dsv.visit(oldStyle); style = (Style) dsv.getCopy(); if (isPointStyle(style)) { propertiesEditor = new PointPropertiesEditor(layer); propertiesEditor.open(mainComposite, style); stackLayout.topControl = propertiesEditor.getControl(); } else { stackLayout.topControl = noFeatureLabel; } } else { stackLayout.topControl = noFeatureLabel; } }
public void refresh() { Layer layer = getSelectedLayer(); IGeoResource resource = layer.getGeoResource(); if (!resource.canResolve(FeatureSource.class)) { return; } StyleBlackboard styleBlackboard = layer.getStyleBlackboard(); oldStyle = (Style) styleBlackboard.get(SLDContent.ID); if (oldStyle == null) { oldStyle = Utilities.createDefaultPointStyle(); } DuplicatingStyleVisitor dsv = new DuplicatingStyleVisitor(); dsv.visit(oldStyle); style = (Style) dsv.getCopy(); if (!isPointStyle(style)) { stackLayout.topControl = noFeatureLabel; } else { stackLayout.topControl = propertiesEditor.getControl(); propertiesEditor.updateStyle(style); } mainComposite.layout(); }